From c6e47cbbff56f39f6d81b079ebaeac41d793d4d9 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 27 Oct 2003 12:21:21 +0000 Subject: [PATCH] Source restructure. yaz-marcdump part of installation --- CHANGELOG | 14 +- Makefile.am | 4 +- README | 44 +- asn/Makefile.am | 12 - asn/proto.c | 1840 ------ asn/prt-acc.c | 202 - asn/prt-acc.h | 184 - asn/prt-add.c | 142 - asn/prt-add.h | 123 - asn/prt-arc.c | 197 - asn/prt-arc.h | 138 - asn/prt-dat.c | 190 - asn/prt-dat.h | 154 - asn/prt-dia.c | 420 -- asn/prt-dia.h | 333 - asn/prt-esp.c | 211 - asn/prt-esp.h | 146 - asn/prt-exd.c | 414 -- asn/prt-exd.h | 268 - asn/prt-exp.c | 1565 ----- asn/prt-exp.h | 1017 --- asn/prt-ext.h | 118 - asn/prt-grs.c | 267 - asn/prt-grs.h | 186 - asn/prt-proto.h | 1170 ---- asn/prt-rsc.c | 91 - asn/prt-rsc.h | 123 - asn/prt-univ.c | 58 - asn/prt-univ.h | 76 - asn/test.c | 67 - ccl/.cvsignore | 7 - ccl/LICENSE | 43 - ccl/Makefile.am | 23 - ccl/README | 15 - ccl/bib1 | 119 - ccl/cclerrms.c | 100 - ccl/cclfind.c | 1114 ---- ccl/cclptree.c | 271 - ccl/cclqfile.c | 262 - ccl/cclqual.c | 371 -- ccl/cclsh.c | 228 - ccl/cclstr.c | 110 - ccl/ccltoken.c | 426 -- ccl/tstccl.c | 84 - client/Makefile.am | 8 +- comstack/.cvsignore | 6 - comstack/Makefile.am | 8 - comstack/comstack.c | 247 - comstack/tcpip.c | 1100 ---- comstack/unix.c | 601 -- comstack/waislen.c | 46 - comstack/xmosi.c | 543 -- configure.in | 15 +- cql/.cvsignore | 9 - cql/Makefile.am | 17 - cql/cql.y | 275 - cql/cql2pqf.c | 60 - cql/cql2xcql.c | 28 - cql/cqlstdio.c | 36 - cql/cqlstrer.c | 61 - cql/cqlstring.c | 40 - cql/cqltransform.c | 469 -- cql/cqlutil.c | 177 - cql/lexer.c | 113 - cql/xcqlutil.c | 210 - doc/Makefile.am | 37 +- doc/yaz-asncomp-man.xml | 254 + doc/yaz-asncomp.sgml | 254 - doc/yaz-client-man.xml | 166 + doc/yaz-client.sgml | 166 - doc/yaz-config-man.xml | 137 + doc/yaz-config.sgml | 137 - doc/yaz-man.sgml | 109 - doc/yaz-man.xml | 109 + doc/yaz-marcdump-man.xml | 140 + doc/yaz-ztest-man.xml | 104 + doc/yaz-ztest.sgml | 104 - doc/zoomsh-man.xml | 162 + doc/zoomsh.sgml | 162 - ill/.cvsignore | 8 - ill/Makefile.am | 21 - ill/ill-get.c | 690 -- ill/ill.tcl | 63 - ill/ill9702.asn | 1165 ---- ill/item-req.asn | 58 - lib/.cvsignore | 8 - lib/Makefile.am | 83 - odr/.cvsignore | 8 - odr/Makefile.am | 25 - odr/ber_any.c | 152 - odr/ber_bit.c | 77 - odr/ber_bool.c | 53 - odr/ber_int.c | 105 - odr/ber_len.c | 133 - odr/ber_null.c | 46 - odr/ber_oct.c | 75 - odr/ber_oid.c | 113 - odr/ber_tag.c | 186 - odr/dumpber.c | 124 - odr/odr-priv.h | 95 - odr/odr.c | 183 - odr/odr_any.c | 36 - odr/odr_bit.c | 54 - odr/odr_bool.c | 45 - odr/odr_choice.c | 96 - odr/odr_cons.c | 180 - odr/odr_enum.c | 47 - odr/odr_int.c | 47 - odr/odr_mem.c | 109 - odr/odr_null.c | 51 - odr/odr_oct.c | 206 - odr/odr_oid.c | 53 - odr/odr_seq.c | 150 - odr/odr_tag.c | 57 - odr/odr_use.c | 66 - odr/odr_util.c | 94 - odr/tstodr.asn | 16 - odr/tstodr.c | 115 - retrieval/.cvsignore | 6 - server/.cvsignore | 6 - server/Makefile.am | 10 - server/eventl.c | 188 - server/eventl.h | 56 - server/requestq.c | 100 - server/service.c | 500 -- server/service.h | 51 - server/seshigh.c | 2605 -------- server/session.h | 107 - server/statserv.c | 961 --- server/tcpdchk.c | 97 - src/.cvsignore | 13 + src/Makefile.am | 167 + src/atoin.c | 28 + src/ber_any.c | 152 + src/ber_bit.c | 77 + src/ber_bool.c | 53 + src/ber_int.c | 105 + src/ber_len.c | 133 + src/ber_null.c | 46 + src/ber_oct.c | 75 + src/ber_oid.c | 113 + src/ber_tag.c | 186 + src/cclerrms.c | 100 + src/cclfind.c | 1114 ++++ src/cclptree.c | 271 + src/cclqfile.c | 262 + src/cclqual.c | 371 ++ src/cclstr.c | 110 + src/ccltoken.c | 426 ++ src/charconv.sgm | 586 ++ src/charconv.tcl | 275 + src/charconv_cjk.xml |15730 ++++++++++++++++++++++++++++++++++++++++++++++ src/charneg-3.asn | 212 + src/charneg.c | 376 ++ src/comstack.c | 247 + src/cql.y | 275 + src/cqlstdio.c | 36 + src/cqlstrer.c | 61 + src/cqlstring.c | 40 + src/cqltransform.c | 469 ++ src/cqlutil.c | 177 + src/datetime.asn | 81 + src/diagbib1.c | 233 + src/dumpber.c | 124 + src/esadmin.asn | 49 + src/esupdate.asn | 103 + src/eventl.c | 188 + src/eventl.h | 56 + src/grs1disp.c | 117 + src/ill-get.c | 693 ++ src/ill.tcl | 63 + src/ill9702.asn | 1165 ++++ src/item-req.asn | 58 + src/lexer.h | 113 + src/log.c | 235 + src/logrpn.c | 368 ++ src/marcdisp.c | 467 ++ src/matchstr.c | 78 + src/mterm2.asn | 10 + src/nmem.c | 483 ++ src/nmemsdup.c | 34 + src/oclcui.asn | 33 + src/odr-priv.h | 95 + src/odr.c | 183 + src/odr_any.c | 36 + src/odr_bit.c | 54 + src/odr_bool.c | 45 + src/odr_choice.c | 96 + src/odr_cons.c | 180 + src/odr_enum.c | 47 + src/odr_int.c | 47 + src/odr_mem.c | 109 + src/odr_null.c | 51 + src/odr_oct.c | 206 + src/odr_oid.c | 53 + src/odr_seq.c | 150 + src/odr_tag.c | 57 + src/odr_use.c | 66 + src/odr_util.c | 94 + src/oid.c | 614 ++ src/opacdisp.c | 135 + src/options.c | 121 + src/otherinfo.c | 211 + src/pquery.c | 817 +++ src/prt-ext.c | 232 + src/query.c | 116 + src/readconf.c | 132 + src/requestq.c | 100 + src/service.c | 503 ++ src/service.h | 54 + src/seshigh.c | 2605 ++++++++ src/session.h | 107 + src/siconv.c | 541 ++ src/soap.c | 262 + src/sortspec.c | 114 + src/srw.c | 855 +++ src/statserv.c | 961 +++ src/tcpdchk.c | 100 + src/tcpip.c | 1100 ++++ src/tpath.c | 91 + src/univres.asn | 23 + src/unix.c | 601 ++ src/version.c | 22 + src/waislen.c | 49 + src/wrbuf.c | 133 + src/xcqlutil.c | 210 + src/xmalloc.c | 277 + src/yaz-ccl.c | 46 + src/z.tcl | 351 ++ src/z3950oid.c | 82 + src/z3950v3.asn | 2667 ++++++++ src/zgdu.c | 364 ++ src/zget.c | 498 ++ src/zoom-c.c | 3224 ++++++++++ src/zoom-opt.c | 183 + src/zoom-p.h | 168 + srw/.cvsignore | 7 - srwapps/.cvsignore | 5 - tab/.cvsignore | 2 - test/Makefile.am | 38 + test/tstccl.c | 84 + test/tsticonv.c | 143 + test/tstmatchstr.c | 53 + test/tstnmem.c | 44 + test/tstodr.asn | 16 + test/tstodr.c | 115 + test/tstwrbuf.c | 58 + util/Makefile.am | 46 +- util/atoin.c | 28 - util/cclsh.c | 228 + util/charconv.sgm | 586 -- util/charconv.tcl | 275 - util/charconv_cjk.xml |15730 ---------------------------------------------- util/cql2pqf.c | 60 + util/cql2xcql.c | 28 + util/cvs-date.tcl | 35 - util/log.c | 235 - util/marcdisp.c | 467 -- util/matchstr.c | 78 - util/nmem.c | 483 -- util/nmemsdup.c | 34 - util/oid.c | 614 -- util/options.c | 118 - util/readconf.c | 129 - util/siconv.c | 541 -- util/srwtst.c | 107 + util/tpath.c | 91 - util/tsticonv.c | 143 - util/tstmatchstr.c | 53 - util/tstnmem.c | 44 - util/tstwrbuf.c | 58 - util/version.c | 22 - util/wrbuf.c | 133 - util/xmalloc.c | 277 - yaz-config.in | 12 +- z39.50/.cvsignore | 8 - z39.50/Makefile.am | 84 - z39.50/charneg-3.asn | 212 - z39.50/comp.sh | 7 - z39.50/datetime.asn | 81 - z39.50/esadmin.asn | 49 - z39.50/esupdate.asn | 103 - z39.50/mterm2.asn | 10 - z39.50/oclcui.asn | 33 - z39.50/prt-ext.c | 232 - z39.50/univres.asn | 23 - z39.50/z.tcl | 351 -- z39.50/z3950v3.asn | 2667 -------- zoom/Makefile.am | 4 +- ztest/Makefile.am | 8 +- zutil/.cvsignore | 6 - zutil/Makefile.am | 13 - zutil/charneg.c | 376 -- zutil/diagbib1.c | 233 - zutil/grs1disp.c | 117 - zutil/logrpn.c | 368 -- zutil/opacdisp.c | 135 - zutil/otherinfo.c | 211 - zutil/pquery.c | 817 --- zutil/query.c | 116 - zutil/soap.c | 262 - zutil/sortspec.c | 114 - zutil/srw.c | 855 --- zutil/srwtst.c | 107 - zutil/yaz-ccl.c | 46 - zutil/z3950oid.c | 82 - zutil/zgdu.c | 364 -- zutil/zget.c | 498 -- zutil/zoom-c.c | 3224 ---------- zutil/zoom-opt.c | 183 - zutil/zoom-p.h | 168 - 311 files changed, 49399 insertions(+), 59900 deletions(-) delete mode 100644 asn/Makefile.am delete mode 100644 asn/proto.c delete mode 100644 asn/prt-acc.c delete mode 100644 asn/prt-acc.h delete mode 100644 asn/prt-add.c delete mode 100644 asn/prt-add.h delete mode 100644 asn/prt-arc.c delete mode 100644 asn/prt-arc.h delete mode 100644 asn/prt-dat.c delete mode 100644 asn/prt-dat.h delete mode 100644 asn/prt-dia.c delete mode 100644 asn/prt-dia.h delete mode 100644 asn/prt-esp.c delete mode 100644 asn/prt-esp.h delete mode 100644 asn/prt-exd.c delete mode 100644 asn/prt-exd.h delete mode 100644 asn/prt-exp.c delete mode 100644 asn/prt-exp.h delete mode 100644 asn/prt-ext.h delete mode 100644 asn/prt-grs.c delete mode 100644 asn/prt-grs.h delete mode 100644 asn/prt-proto.h delete mode 100644 asn/prt-rsc.c delete mode 100644 asn/prt-rsc.h delete mode 100644 asn/prt-univ.c delete mode 100644 asn/prt-univ.h delete mode 100644 asn/test.c delete mode 100644 ccl/.cvsignore delete mode 100644 ccl/LICENSE delete mode 100644 ccl/Makefile.am delete mode 100644 ccl/README delete mode 100644 ccl/bib1 delete mode 100644 ccl/cclerrms.c delete mode 100644 ccl/cclfind.c delete mode 100644 ccl/cclptree.c delete mode 100644 ccl/cclqfile.c delete mode 100644 ccl/cclqual.c delete mode 100644 ccl/cclsh.c delete mode 100644 ccl/cclstr.c delete mode 100644 ccl/ccltoken.c delete mode 100644 ccl/tstccl.c delete mode 100644 comstack/.cvsignore delete mode 100644 comstack/Makefile.am delete mode 100644 comstack/comstack.c delete mode 100644 comstack/tcpip.c delete mode 100644 comstack/unix.c delete mode 100644 comstack/waislen.c delete mode 100644 comstack/xmosi.c delete mode 100644 cql/.cvsignore delete mode 100644 cql/Makefile.am delete mode 100644 cql/cql.y delete mode 100644 cql/cql2pqf.c delete mode 100644 cql/cql2xcql.c delete mode 100644 cql/cqlstdio.c delete mode 100644 cql/cqlstrer.c delete mode 100644 cql/cqlstring.c delete mode 100644 cql/cqltransform.c delete mode 100644 cql/cqlutil.c delete mode 100644 cql/lexer.c delete mode 100644 cql/xcqlutil.c create mode 100644 doc/yaz-asncomp-man.xml delete mode 100644 doc/yaz-asncomp.sgml create mode 100644 doc/yaz-client-man.xml delete mode 100644 doc/yaz-client.sgml create mode 100644 doc/yaz-config-man.xml delete mode 100644 doc/yaz-config.sgml delete mode 100644 doc/yaz-man.sgml create mode 100644 doc/yaz-man.xml create mode 100644 doc/yaz-marcdump-man.xml create mode 100644 doc/yaz-ztest-man.xml delete mode 100644 doc/yaz-ztest.sgml create mode 100644 doc/zoomsh-man.xml delete mode 100644 doc/zoomsh.sgml delete mode 100644 ill/.cvsignore delete mode 100644 ill/Makefile.am delete mode 100644 ill/ill-get.c delete mode 100644 ill/ill.tcl delete mode 100644 ill/ill9702.asn delete mode 100644 ill/item-req.asn delete mode 100644 lib/.cvsignore delete mode 100644 lib/Makefile.am delete mode 100644 lib/x.c delete mode 100644 odr/.cvsignore delete mode 100644 odr/Makefile.am delete mode 100644 odr/ber_any.c delete mode 100644 odr/ber_bit.c delete mode 100644 odr/ber_bool.c delete mode 100644 odr/ber_int.c delete mode 100644 odr/ber_len.c delete mode 100644 odr/ber_null.c delete mode 100644 odr/ber_oct.c delete mode 100644 odr/ber_oid.c delete mode 100644 odr/ber_tag.c delete mode 100644 odr/dumpber.c delete mode 100644 odr/odr-priv.h delete mode 100644 odr/odr.c delete mode 100644 odr/odr_any.c delete mode 100644 odr/odr_bit.c delete mode 100644 odr/odr_bool.c delete mode 100644 odr/odr_choice.c delete mode 100644 odr/odr_cons.c delete mode 100644 odr/odr_enum.c delete mode 100644 odr/odr_int.c delete mode 100644 odr/odr_mem.c delete mode 100644 odr/odr_null.c delete mode 100644 odr/odr_oct.c delete mode 100644 odr/odr_oid.c delete mode 100644 odr/odr_seq.c delete mode 100644 odr/odr_tag.c delete mode 100644 odr/odr_use.c delete mode 100644 odr/odr_util.c delete mode 100644 odr/tstodr.asn delete mode 100644 odr/tstodr.c delete mode 100644 retrieval/.cvsignore delete mode 100644 server/.cvsignore delete mode 100644 server/Makefile.am delete mode 100644 server/eventl.c delete mode 100644 server/eventl.h delete mode 100644 server/requestq.c delete mode 100644 server/service.c delete mode 100644 server/service.h delete mode 100644 server/seshigh.c delete mode 100644 server/session.h delete mode 100644 server/statserv.c delete mode 100644 server/tcpdchk.c create mode 100644 src/.cvsignore create mode 100644 src/Makefile.am create mode 100644 src/atoin.c create mode 100644 src/ber_any.c create mode 100644 src/ber_bit.c create mode 100644 src/ber_bool.c create mode 100644 src/ber_int.c create mode 100644 src/ber_len.c create mode 100644 src/ber_null.c create mode 100644 src/ber_oct.c create mode 100644 src/ber_oid.c create mode 100644 src/ber_tag.c create mode 100644 src/cclerrms.c create mode 100644 src/cclfind.c create mode 100644 src/cclptree.c create mode 100644 src/cclqfile.c create mode 100644 src/cclqual.c create mode 100644 src/cclstr.c create mode 100644 src/ccltoken.c create mode 100644 src/charconv.sgm create mode 100755 src/charconv.tcl create mode 100644 src/charconv_cjk.xml create mode 100644 src/charneg-3.asn create mode 100644 src/charneg.c create mode 100644 src/comstack.c create mode 100644 src/cql.y create mode 100644 src/cqlstdio.c create mode 100644 src/cqlstrer.c create mode 100644 src/cqlstring.c create mode 100644 src/cqltransform.c create mode 100644 src/cqlutil.c create mode 100644 src/datetime.asn create mode 100644 src/diagbib1.c create mode 100644 src/dumpber.c create mode 100644 src/esadmin.asn create mode 100644 src/esupdate.asn create mode 100644 src/eventl.c create mode 100644 src/eventl.h create mode 100644 src/grs1disp.c create mode 100644 src/ill-get.c create mode 100644 src/ill.tcl create mode 100644 src/ill9702.asn create mode 100644 src/item-req.asn create mode 100644 src/lexer.h create mode 100644 src/log.c create mode 100644 src/logrpn.c create mode 100644 src/marcdisp.c create mode 100644 src/matchstr.c create mode 100644 src/mterm2.asn create mode 100644 src/nmem.c create mode 100644 src/nmemsdup.c create mode 100644 src/oclcui.asn create mode 100644 src/odr-priv.h create mode 100644 src/odr.c create mode 100644 src/odr_any.c create mode 100644 src/odr_bit.c create mode 100644 src/odr_bool.c create mode 100644 src/odr_choice.c create mode 100644 src/odr_cons.c create mode 100644 src/odr_enum.c create mode 100644 src/odr_int.c create mode 100644 src/odr_mem.c create mode 100644 src/odr_null.c create mode 100644 src/odr_oct.c create mode 100644 src/odr_oid.c create mode 100644 src/odr_seq.c create mode 100644 src/odr_tag.c create mode 100644 src/odr_use.c create mode 100644 src/odr_util.c create mode 100644 src/oid.c create mode 100644 src/opacdisp.c create mode 100644 src/options.c create mode 100644 src/otherinfo.c create mode 100644 src/pquery.c create mode 100644 src/prt-ext.c create mode 100644 src/query.c create mode 100644 src/readconf.c create mode 100644 src/requestq.c create mode 100644 src/service.c create mode 100644 src/service.h create mode 100644 src/seshigh.c create mode 100644 src/session.h create mode 100644 src/siconv.c create mode 100644 src/soap.c create mode 100644 src/sortspec.c create mode 100644 src/srw.c create mode 100644 src/statserv.c create mode 100644 src/tcpdchk.c create mode 100644 src/tcpip.c create mode 100644 src/tpath.c create mode 100644 src/univres.asn create mode 100644 src/unix.c create mode 100644 src/version.c create mode 100644 src/waislen.c create mode 100644 src/wrbuf.c create mode 100644 src/xcqlutil.c create mode 100644 src/xmalloc.c create mode 100644 src/yaz-ccl.c create mode 100644 src/z.tcl create mode 100644 src/z3950oid.c create mode 100644 src/z3950v3.asn create mode 100644 src/zgdu.c create mode 100644 src/zget.c create mode 100644 src/zoom-c.c create mode 100644 src/zoom-opt.c create mode 100644 src/zoom-p.h delete mode 100644 srw/.cvsignore delete mode 100644 srwapps/.cvsignore delete mode 100644 tab/.cvsignore create mode 100644 test/Makefile.am create mode 100644 test/tstccl.c create mode 100644 test/tsticonv.c create mode 100644 test/tstmatchstr.c create mode 100644 test/tstnmem.c create mode 100644 test/tstodr.asn create mode 100644 test/tstodr.c create mode 100644 test/tstwrbuf.c delete mode 100644 util/atoin.c create mode 100644 util/cclsh.c delete mode 100644 util/charconv.sgm delete mode 100755 util/charconv.tcl delete mode 100644 util/charconv_cjk.xml create mode 100644 util/cql2pqf.c create mode 100644 util/cql2xcql.c delete mode 100755 util/cvs-date.tcl delete mode 100644 util/log.c delete mode 100644 util/marcdisp.c delete mode 100644 util/matchstr.c delete mode 100644 util/nmem.c delete mode 100644 util/nmemsdup.c delete mode 100644 util/oid.c delete mode 100644 util/options.c delete mode 100644 util/readconf.c delete mode 100644 util/siconv.c create mode 100644 util/srwtst.c delete mode 100644 util/tpath.c delete mode 100644 util/tsticonv.c delete mode 100644 util/tstmatchstr.c delete mode 100644 util/tstnmem.c delete mode 100644 util/tstwrbuf.c delete mode 100644 util/version.c delete mode 100644 util/wrbuf.c delete mode 100644 util/xmalloc.c delete mode 100644 z39.50/.cvsignore delete mode 100644 z39.50/Makefile.am delete mode 100644 z39.50/charneg-3.asn delete mode 100755 z39.50/comp.sh delete mode 100644 z39.50/datetime.asn delete mode 100644 z39.50/esadmin.asn delete mode 100644 z39.50/esupdate.asn delete mode 100644 z39.50/mterm2.asn delete mode 100644 z39.50/oclcui.asn delete mode 100644 z39.50/prt-ext.c delete mode 100644 z39.50/univres.asn delete mode 100644 z39.50/z.tcl delete mode 100644 z39.50/z3950v3.asn delete mode 100644 zutil/.cvsignore delete mode 100644 zutil/Makefile.am delete mode 100644 zutil/charneg.c delete mode 100644 zutil/diagbib1.c delete mode 100644 zutil/grs1disp.c delete mode 100644 zutil/logrpn.c delete mode 100644 zutil/opacdisp.c delete mode 100644 zutil/otherinfo.c delete mode 100644 zutil/pquery.c delete mode 100644 zutil/query.c delete mode 100644 zutil/soap.c delete mode 100644 zutil/sortspec.c delete mode 100644 zutil/srw.c delete mode 100644 zutil/srwtst.c delete mode 100644 zutil/yaz-ccl.c delete mode 100644 zutil/z3950oid.c delete mode 100644 zutil/zgdu.c delete mode 100644 zutil/zget.c delete mode 100644 zutil/zoom-c.c delete mode 100644 zutil/zoom-opt.c delete mode 100644 zutil/zoom-p.h diff --git a/CHANGELOG b/CHANGELOG index 84511c9..19e1430 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,18 @@ Possible compatibility problems with earlier versions marked with '*'. --- (IN PROGRESS) +Major restructure of YAZ source. All source in libyaz is in src directory. +Programs in client (yaz-client), ztest (yaz-ztest), zoom (zoom programs), +util (utility programs such as ASN.1 compiler, yaz-marcdump). + +Added man page for utility yaz-marcdump (used to be called marcdump). +yaz-marcdump is installed by 'make install'. + +Fixed a memory leak in Generic Frontend Server that occurred when decoding +of incoming package failed. + +Fixed a potential DOS attack vulnerability in COMSTACK/ODR. + Change prototype of odr_perror: add const to message string. New function yaz_log_reopen which reopens log file (for log rotate, etc.) @@ -14,7 +26,7 @@ assuming that blocking=1 or 0 is used. Fix bad reference in UNIX comstack in function cs_addrstr. -Fix for AIX compile. +Fix for compilation on AIX. The generic front-end server (server/seshigh.c) now supports returning Init diagnostics to the client in User-information-field, in diff --git a/Makefile.am b/Makefile.am index d61b8d9..b29227d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,10 +1,10 @@ ## Copyright (C) 1994-2003, Index Data ## All rights reserved. -## $Id: Makefile.am,v 1.22 2003-05-06 12:07:33 adam Exp $ +## $Id: Makefile.am,v 1.23 2003-10-27 12:21:21 adam Exp $ AUTOMAKE_OPTIONS = foreign -SUBDIRS = util odr comstack z39.50 ill zutil ccl cql server include lib client ztest zoom doc etc +SUBDIRS = src include test util client ztest zoom doc etc aclocaldir=$(datadir)/aclocal diff --git a/README b/README index eae60c3..a8bc9f2 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -YAZ toolkit - $Id: README,v 1.43 2003-02-20 21:23:47 adam Exp $ +YAZ toolkit - $Id: README,v 1.44 2003-10-27 12:21:21 adam Exp $ Copyright (C) 1995-2003, Index Data ApS. See the file LICENSE for details. @@ -24,52 +24,18 @@ File organisation: doc Documentation. -util Various little utility functions. Logging, memory debugging, - primitive ISO 2709 presentation for the yaz-client, etc. You'll - find the ASN.1 Compiler for YAZ here as well (yaz-comp). +src Source for the YAZ library. -odr Open Data Representation. This module implements the BER - encoding rules. - -z39.50 codecs for the Z39.50 protocol. This module does the same job - as the old 'asn' module except that the source files are - auto-generated using an YAZ' ASN.1 Compiler (yaz-comp). - -zutil This module implements a collection of Z39.50 and SRW utilities, - such as query parsing, etc. - -ill Codecs for the ISO ILL protocol. - -comstack This module implements the transport transparency - stack (COMSTACK). The comstack implements a generic interface - for exchanging BER-encoded records over a network. It supports - the 'American' mode of exchanging the records straight over - TCP/IP, and uses Peter Furniss' XTIMOSI package over RFC1006. - Look for documentation in the file comstack.man. - -zoom An implementation of Mike Taylors Z39.50 Object Oriented - Model : ZOOM. If you'd like to build Z39.50 client applications - in C this may be good start. You'll find example programs in - this directory too. - -server This is the implementation of the Z39.50 server frontend. It - provides event-handling and server managament functions, - and calls the backend primitives (best documentation of these - is in the file include/yaz/backend.h). - -ccl CCL parser. - -cql CQL parser. +util Utility programs, ASN.1 compiler, MARC dump utility, and others. client A demonstration client for testing the protocol. It's bug'n ugly. But, it supports many features. ztest A demonstration server that implements a backend. -include/yaz The various header files. +etc Various configuration files. -lib The libraries. Primarily libyaz.la. The makefile gathers the - libraries from previous modules into libyaz.la. +include/yaz The various header files. To get more information or assistance, send mail to yaz-help@indexdata.dk. Even better, sign on to the YAZ mailing list here: diff --git a/asn/Makefile.am b/asn/Makefile.am deleted file mode 100644 index ab975b6..0000000 --- a/asn/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -## $Id: Makefile.am,v 1.7 2002-09-11 21:25:57 adam Exp $ - -noinst_LTLIBRARIES=libasn.la - -libasn_la_SOURCES = proto.c prt-rsc.c prt-acc.c prt-exp.c prt-grs.c prt-exd.c \ - prt-dia.c prt-esp.c prt-arc.c prt-add.c prt-dat.c prt-univ.c - -pkginclude_HEADERS = \ - prt-acc.h prt-add.h prt-arc.h prt-dat.h prt-dia.h prt-esp.h prt-exd.h \ - prt-exp.h prt-ext.h prt-grs.h prt-proto.h prt-rsc.h prt-univ.h - -AM_CPPFLAGS=-I$(top_srcdir)/include diff --git a/asn/proto.c b/asn/proto.c deleted file mode 100644 index 0097d2b..0000000 --- a/asn/proto.c +++ /dev/null @@ -1,1840 +0,0 @@ -/* - * Copyright (c) 1995-1999, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: proto.c,v $ - * Revision 1.61 1999-11-30 13:47:10 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.60 1999/06/11 16:45:59 adam - * Fixed minor bug in ScanRequest encoder. - * - * Revision 1.59 1999/04/21 11:46:00 adam - * Fixed bug in {en,de}coder for OtherInformation. - * - * Revision 1.58 1999/04/20 09:56:47 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.57 1998/10/20 13:55:37 quinn - * Fixed Scan bug in asn and client - * - * Revision 1.56 1998/08/19 16:10:04 adam - * Changed som member names of DeleteResultSetRequest/Response. - * - * Revision 1.55 1998/02/11 11:53:32 adam - * Changed code so that it compiles as C++. - * - * Revision 1.54 1996/11/11 13:14:46 adam - * Fixed tagging bug in z_ProximityOperator. - * - * Revision 1.53 1996/10/09 15:54:55 quinn - * Added SearchInfoReport - * - * Revision 1.52 1996/10/08 12:56:57 adam - * Bug fix: tagging of type 101 query. - * - * Revision 1.51 1996/07/26 14:07:21 quinn - * Small - * - * Revision 1.50 1996/07/26 13:36:15 quinn - * Various smallish - * - * Revision 1.49 1996/07/06 19:58:28 quinn - * System headerfiles gathered in yconfig - * - * Revision 1.48 1996/06/10 08:53:33 quinn - * Added Summary,OPAC,ResourceReport - * - * Revision 1.47 1996/05/29 15:47:50 quinn - * Fixed in bug DiagRecs decoder. Thanks to Linda Harris. - * - * Revision 1.46 1996/04/10 11:39:42 quinn - * Fixed bug in UserInfo - * - * Revision 1.45 1996/02/23 10:00:25 quinn - * Fixes to SCAN - * - * Revision 1.44 1996/02/20 12:51:41 quinn - * Completed SCAN. Fixed problems with EXTERNAL. - * - * Revision 1.43 1996/02/10 12:22:49 quinn - * Work on SCAN - * - * Revision 1.42 1996/01/22 09:46:31 quinn - * Added Sort PDU. Moved StringList to main protocol file. - * - * Revision 1.41 1996/01/10 15:21:24 quinn - * Added links to access control PDUs - * - * Revision 1.40 1996/01/02 11:46:40 quinn - * Changed 'operator' to 'roperator' to avoid C++ conflict. - * - * Revision 1.39 1995/09/29 17:11:53 quinn - * Smallish - * - * Revision 1.38 1995/09/27 15:02:40 quinn - * Modified function heads & prototypes. - * - * Revision 1.37 1995/08/21 09:10:15 quinn - * Smallish fixes to suppport new formats. - * - * Revision 1.36 1995/08/15 11:59:39 quinn - * Updated External - * - * Revision 1.35 1995/08/10 08:53:59 quinn - * Added Explain - * - * Revision 1.34 1995/06/19 17:01:48 quinn - * This should bring us in sync with the version distributed as 1.0b - * - * Revision 1.33 1995/06/19 13:39:56 quinn - * *** empty log message *** - * - * Revision 1.32 1995/06/19 12:37:28 quinn - * Fixed a bug in the compspec. - * - * Revision 1.31 1995/06/16 13:15:56 quinn - * Fixed Defaultdiagformat. - * - * Revision 1.30 1995/06/15 15:42:01 quinn - * Fixed some v3 bugs - * - * Revision 1.29 1995/06/15 07:44:49 quinn - * Moving to v3. - * - * Revision 1.28 1995/06/14 15:26:35 quinn - * *** empty log message *** - * - * Revision 1.27 1995/06/07 14:36:22 quinn - * Added CLOSE - * - * Revision 1.26 1995/06/02 09:49:13 quinn - * Adding access control - * - * Revision 1.25 1995/05/25 11:00:08 quinn - * *** empty log message *** - * - * Revision 1.24 1995/05/22 13:58:18 quinn - * Fixed an ODR_NULLVAL. - * - * Revision 1.23 1995/05/22 11:30:18 quinn - * Adding Z39.50-1992 stuff to proto.c. Adding zget.c - * - * Revision 1.22 1995/05/17 08:40:56 quinn - * Added delete. Fixed some sequence_begins. Smallish. - * - * Revision 1.21 1995/05/16 08:50:24 quinn - * License, documentation, and memory fixes - * - * Revision 1.20 1995/05/15 11:55:25 quinn - * Smallish. - * - * Revision 1.19 1995/04/11 11:58:35 quinn - * Fixed bug. - * - * Revision 1.18 1995/04/11 11:52:02 quinn - * Fixed possible buf in proto.c - * - * Revision 1.17 1995/04/10 10:22:22 quinn - * Added SCAN. - * - * Revision 1.16 1995/03/30 10:26:43 quinn - * Added Term structure - * - * Revision 1.15 1995/03/30 09:08:39 quinn - * Added Resource control protocol - * - * Revision 1.14 1995/03/29 08:06:13 quinn - * Added a few v3 elements - * - * Revision 1.13 1995/03/20 11:26:52 quinn - * *** empty log message *** - * - * Revision 1.12 1995/03/20 09:45:09 quinn - * Working towards v3 - * - * Revision 1.11 1995/03/17 10:17:25 quinn - * Added memory management. - * - * Revision 1.10 1995/03/15 11:17:40 quinn - * Fixed some return-checks from choice.. need better ay to handle those.. - * - * Revision 1.9 1995/03/15 08:37:06 quinn - * Fixed protocol bugs. - * - * Revision 1.8 1995/03/14 16:59:24 quinn - * Fixed OPTIONAL flag in attributeelement - * - * Revision 1.7 1995/03/07 16:29:33 quinn - * Added authentication stuff. - * - * Revision 1.6 1995/03/01 14:46:03 quinn - * Fixed protocol bug in 8777query. - * - * Revision 1.5 1995/02/14 11:54:22 quinn - * Fixing include. - * - * Revision 1.4 1995/02/10 15:54:30 quinn - * Small adjustments. - * - * Revision 1.3 1995/02/09 15:51:39 quinn - * Works better now. - * - * Revision 1.2 1995/02/06 21:26:07 quinn - * Repaired this evening's damages.. - * - * Revision 1.1 1995/02/06 16:44:47 quinn - * First hack at Z/SR protocol - * - */ - -#include - -#include - -/* ---------------------- GLOBAL DEFS ------------------- */ - -/* - * We'll use a general octetstring here, since string operations are - * clumsy on long strings. - */ -int z_SUTRS(ODR o, Odr_oct **p, int opt, const char *name) -{ - return odr_implicit(o, odr_octetstring, p, ODR_UNIVERSAL, - ODR_GENERALSTRING, opt); -} - -int z_ReferenceId(ODR o, Z_ReferenceId **p, int opt, const char *name) -{ - return odr_implicit(o, odr_octetstring, (Odr_oct**) p, ODR_CONTEXT, 2, - opt); -} - -int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt, const char *name) -{ - return odr_implicit(o, odr_visiblestring, (char **) p, ODR_CONTEXT, 105, - opt); -} - -int z_ResultSetId(ODR o, char **p, int opt, const char *name) -{ - return odr_implicit(o, odr_visiblestring, (char **) p, ODR_CONTEXT, 31, - opt); -} - -int z_ElementSetName(ODR o, char **p, int opt, const char *name) -{ - return odr_implicit(o, odr_visiblestring, p, ODR_CONTEXT, 103, opt); -} - -int z_UserInformationField(ODR o, Z_External **p, int opt, const char *name) -{ - return odr_explicit(o, z_External, (Z_External **)p, ODR_CONTEXT, - 11, opt); -} - -int z_InternationalString(ODR o, char **p, int opt, const char *name) -{ - return odr_generalstring(o, p, opt, 0); -} - -int z_InfoCategory(ODR o, Z_InfoCategory **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_oid, &(*p)->categoryTypeId, ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_integer, &(*p)->categoryValue, ODR_CONTEXT, 2, - 0) && - odr_sequence_end(o); -} - -int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt, - const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_OtherInfo_characterInfo, - odr_visiblestring, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_OtherInfo_binaryInfo, - (Odr_fun)odr_octetstring, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_OtherInfo_externallyDefinedInfo, - (Odr_fun)z_External, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_OtherInfo_oid, - (Odr_fun)odr_oid, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_sequence_begin(o, p, sizeof(**p), name)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InfoCategory, &(*p)->category, ODR_CONTEXT, 1, 1) && - odr_choice(o, arm, &(*p)->information, &(*p)->which, name) && - odr_sequence_end(o); -} - -int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt, - const char *name) -{ - if (!odr_initmember (o, p, sizeof(**p))) - return opt && odr_ok(o); - odr_implicit_settag(o, ODR_CONTEXT, 201); - if (odr_sequence_of(o, (Odr_fun)z_OtherInformationUnit, &(*p)->list, - &(*p)->num_elements, name)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_StringOrNumeric_string, - odr_visiblestring, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_StringOrNumeric_numeric, - (Odr_fun)odr_integer, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_StringOrNumeric *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -/* - * check tagging!! - */ -int z_Unit(ODR o, Z_Unit **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_explicit(o, z_InternationalString, &(*p)->unitSystem, ODR_CONTEXT, - 1, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->unitType, ODR_CONTEXT, - 2, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->unit, ODR_CONTEXT, 3, 1) && - odr_implicit(o, odr_integer, &(*p)->scaleFactor, ODR_CONTEXT, 4, 1) && - odr_sequence_end(o); -} - -int z_IntUnit(ODR o, Z_IntUnit **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->value, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_Unit, &(*p)->unitUsed, ODR_CONTEXT, 2, 0) && - odr_sequence_end(o); -} - -int z_StringList(ODR o, Z_StringList **p, int opt, const char *name) -{ - if (o->direction == ODR_DECODE) - *p = (Z_StringList *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_sequence_of(o, (Odr_fun)z_InternationalString, &(*p)->strings, - &(*p)->num_strings, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -/* ---------------------- INITIALIZE SERVICE ------------------- */ - -#if 1 -int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_visiblestring(o, &(*p)->user, 0, 0) && - odr_visiblestring(o, &(*p)->password, 0, 0) && - odr_visiblestring(o, &(*p)->account, 0, 0) && - odr_sequence_end(o); -} -#endif - -int z_IdPass(ODR o, Z_IdPass **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_visiblestring, &(*p)->groupId, ODR_CONTEXT, 0, - 1) && - odr_implicit(o, odr_visiblestring, &(*p)->userId, ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_visiblestring, &(*p)->password, ODR_CONTEXT, 2, - 1) && - odr_sequence_end(o); -} - -int z_StrAuthentication(ODR o, char **p, int opt, const char *name) -{ - return odr_visiblestring(o, p, opt, 0); -} - -int z_IdAuthentication(ODR o, Z_IdAuthentication **p, int opt, - const char *name) -{ - static Odr_arm arm[] = - { - {-1, -1, -1, Z_IdAuthentication_open, z_StrAuthentication, 0}, - {-1, -1, -1, Z_IdAuthentication_idPass, (Odr_fun)z_IdPass, 0}, - {-1, -1, -1, Z_IdAuthentication_anonymous, (Odr_fun)odr_null, 0}, - {-1, -1, -1, Z_IdAuthentication_other, (Odr_fun)z_External, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_IdAuthentication *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_InitRequest(ODR o, Z_InitRequest **p, int opt, const char *name) -{ - Z_InitRequest *pp; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - pp = *p; - return - z_ReferenceId(o, &pp->referenceId, 1, 0) && - odr_implicit(o, odr_bitstring, &pp->protocolVersion, - ODR_CONTEXT, 3, 0) && - odr_implicit(o, odr_bitstring, &pp->options, ODR_CONTEXT, 4, 0) && - odr_implicit(o, odr_integer, &pp->preferredMessageSize, ODR_CONTEXT, - 5, 0) && - odr_implicit(o, odr_integer, &pp->maximumRecordSize, - ODR_CONTEXT, 6, 0) && - odr_explicit(o, z_IdAuthentication, &pp->idAuthentication, - ODR_CONTEXT, 7, 1) && - odr_implicit(o, odr_visiblestring, &pp->implementationId, - ODR_CONTEXT, 110, 1) && - odr_implicit(o, odr_visiblestring, &pp->implementationName, - ODR_CONTEXT, 111, 1) && - odr_implicit(o, odr_visiblestring, &pp->implementationVersion, - ODR_CONTEXT, 112, 1) && - z_UserInformationField(o, &pp->userInformationField, 1, 0) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -int z_InitResponse(ODR o, Z_InitResponse **p, int opt, const char *name) -{ - Z_InitResponse *pp; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - pp = *p; - return - z_ReferenceId(o, &pp->referenceId, 1, 0) && - odr_implicit(o, odr_bitstring, &pp->protocolVersion, - ODR_CONTEXT, 3, 0) && - odr_implicit(o, odr_bitstring, &pp->options, ODR_CONTEXT, 4, 0) && - odr_implicit(o, odr_integer, &pp->preferredMessageSize, - ODR_CONTEXT, 5, 0) && - odr_implicit(o, odr_integer, &pp->maximumRecordSize, - ODR_CONTEXT, 6, 0) && - odr_implicit(o, odr_bool, &pp->result, ODR_CONTEXT, 12, 0) && - odr_implicit(o, odr_visiblestring, &pp->implementationId, - ODR_CONTEXT, 110, 1) && - odr_implicit(o, odr_visiblestring, &pp->implementationName, - ODR_CONTEXT, 111, 1) && - odr_implicit(o, odr_visiblestring, &pp->implementationVersion, - ODR_CONTEXT, 112, 1) && - z_UserInformationField(o, &pp->userInformationField, 1, 0) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -/* ------------------ RESOURCE CONTROL ----------------*/ - -int z_TriggerResourceControlRequest(ODR o, Z_TriggerResourceControlRequest **p, - int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->requestedAction, ODR_CONTEXT, - 46, 0) && - odr_implicit(o, odr_oid, &(*p)->prefResourceReportFormat, - ODR_CONTEXT, 47, 1) && - odr_implicit(o, odr_bool, &(*p)->resultSetWanted, ODR_CONTEXT, - 48, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -int z_ResourceControlRequest(ODR o, Z_ResourceControlRequest **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit(o, odr_bool, &(*p)->suspendedFlag, ODR_CONTEXT, 39, 1)&& - odr_explicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT, - 40, 1) && - odr_implicit(o, odr_integer, &(*p)->partialResultsAvailable, - ODR_CONTEXT, 41, 1) && - odr_implicit(o, odr_bool, &(*p)->responseRequired, ODR_CONTEXT, - 42, 0) && - odr_implicit(o, odr_bool, &(*p)->triggeredRequestFlag, - ODR_CONTEXT, 43, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -int z_ResourceControlResponse(ODR o, Z_ResourceControlResponse **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit(o, odr_bool, &(*p)->continueFlag, ODR_CONTEXT, 44, 0) && - odr_implicit(o, odr_bool, &(*p)->resultSetWanted, ODR_CONTEXT, - 45, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -/* ------------------------ SEARCH SERVICE ----------------------- */ - -int z_DatabaseSpecificUnit(ODR o, Z_DatabaseSpecificUnit **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_DatabaseName(o, &(*p)->databaseName, 0, 0) && - z_ElementSetName(o, &(*p)->elementSetName, 0, 0) && - odr_sequence_end(o); -} - -int z_DatabaseSpecific(ODR o, Z_DatabaseSpecific **p, int opt, - const char *name) -{ - if (o->direction == ODR_DECODE) - *p = (Z_DatabaseSpecific *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - - odr_implicit_settag(o, ODR_CONTEXT, 1); - if (odr_sequence_of(o, (Odr_fun)z_DatabaseSpecificUnit, &(*p)->elements, - &(*p)->num_elements, 0)) - return 1; - *p = 0; - return 0; -} - -int z_ElementSetNames(ODR o, Z_ElementSetNames **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ElementSetNames_generic, - z_ElementSetName, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementSetNames_databaseSpecific, - (Odr_fun)z_DatabaseSpecific, 0}, - {-1, -1, -1, -1, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_ElementSetNames *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt && odr_ok(o); - - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return 0; -} - -/* ----------------------- RPN QUERY -----------------------*/ - -int z_ComplexAttribute(ODR o, Z_ComplexAttribute **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit_settag(o, ODR_CONTEXT, 1) && - odr_sequence_of(o, (Odr_fun)z_StringOrNumeric, &(*p)->list, - &(*p)->num_list, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)odr_integer, &(*p)->semanticAction, - &(*p)->num_semanticAction, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_AttributeElement(ODR o, Z_AttributeElement **p, int opt, - const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 121, Z_AttributeValue_numeric, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 224, Z_AttributeValue_complex, - (Odr_fun)z_ComplexAttribute, 0}, - {-1, -1, -1, -1, 0, 0} - }; - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_oid, &(*p)->attributeSet, ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_integer, &(*p)->attributeType, ODR_CONTEXT, - 120, 0) && - odr_choice(o, arm, &(*p)->value, &(*p)->which, 0) && - odr_sequence_end(o); -} - -int z_Term(ODR o, Z_Term **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 45, Z_Term_general, - (Odr_fun)odr_octetstring, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 215, Z_Term_numeric, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 216, Z_Term_characterString, - odr_visiblestring, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 217, Z_Term_oid, (Odr_fun)odr_oid, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 218, Z_Term_dateTime, odr_cstring, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 219, Z_Term_external, - (Odr_fun) z_External, 0}, - /* add intUnit here */ - {ODR_IMPLICIT, ODR_CONTEXT, 221, Z_Term_null, (Odr_fun)odr_null, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction ==ODR_DECODE) - *p = (Z_Term *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_AttributesPlusTerm(ODR o, Z_AttributesPlusTerm **p, int opt, - const char *name) -{ - if (!(odr_implicit_settag(o, ODR_CONTEXT, 102) && - odr_sequence_begin(o, p, sizeof(**p), 0))) - return opt && odr_ok(o); - return - odr_implicit_settag(o, ODR_CONTEXT, 44) && - odr_sequence_of(o, (Odr_fun)z_AttributeElement, &(*p)->attributeList, - &(*p)->num_attributes, 0) && - z_Term(o, &(*p)->term, 0, 0) && - odr_sequence_end(o); -} - -int z_ResultSetPlusAttributes(ODR o, Z_ResultSetPlusAttributes **p, int opt, - const char *name) -{ - if (!(odr_implicit_settag(o, ODR_CONTEXT, 214) && - odr_sequence_begin(o, p, sizeof(**p), 0))) - return opt && odr_ok(o); - return - z_ResultSetId(o, &(*p)->resultSet, 0, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 44) && - odr_sequence_of(o, (Odr_fun)z_AttributeElement, &(*p)->attributeList, - &(*p)->num_attributes, 0) && - odr_sequence_end(o); -} - -int z_ProximityOperator(ODR o, Z_ProximityOperator **p, int opt, - const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ProxCode_known, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ProxCode_private, - (Odr_fun)odr_integer, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_bool, &(*p)->exclusion, ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_integer, &(*p)->distance, ODR_CONTEXT, 2, 0) && - odr_implicit(o, odr_bool, &(*p)->ordered, ODR_CONTEXT, 3, 0) && - odr_implicit(o, odr_integer, &(*p)->relationType, ODR_CONTEXT, 4, 0) && - odr_constructed_begin(o, &(*p)->proximityUnitCode, - ODR_CONTEXT, 5, 0) && - odr_choice(o, arm, &(*p)->proximityUnitCode, &(*p)->which, 0) && - odr_constructed_end(o) && - odr_sequence_end(o); -} - -int z_Operator(ODR o, Z_Operator **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_Operator_and, (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Operator_or, (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Operator_and_not, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Operator_prox, - (Odr_fun)z_ProximityOperator, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!*p && o->direction != ODR_DECODE) - return opt; - if (!odr_constructed_begin(o, p, ODR_CONTEXT, 46, 0)) - return opt && odr_ok(o); - if (o->direction == ODR_DECODE) - *p = (Z_Operator *)odr_malloc(o, sizeof(**p)); - - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) && - odr_constructed_end(o)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_Operand(ODR o, Z_Operand **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {-1, -1, -1, Z_Operand_APT, (Odr_fun)z_AttributesPlusTerm, 0}, - {-1, -1, -1, Z_Operand_resultSetId, (Odr_fun)z_ResultSetId, 0}, - {-1, -1, -1, Z_Operand_resultAttr, - (Odr_fun)z_ResultSetPlusAttributes, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_Operand *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_RPNStructure(ODR o, Z_RPNStructure **p, int opt, const char *name); - -int z_Complex(ODR o, Z_Complex **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_RPNStructure(o, &(*p)->s1, 0, 0) && - z_RPNStructure(o, &(*p)->s2, 0, 0) && - z_Operator(o, &(*p)->roperator, 0, 0) && - odr_sequence_end(o); -} - -int z_RPNStructure(ODR o, Z_RPNStructure **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_RPNStructure_simple, - (Odr_fun)z_Operand, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_RPNStructure_complex, - (Odr_fun)z_Complex, 0}, - {-1 -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_RPNStructure *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_RPNQuery(ODR o, Z_RPNQuery **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_oid(o, &(*p)->attributeSetId, 0, 0) && - z_RPNStructure(o, &(*p)->RPNStructure, 0, 0) && - odr_sequence_end(o); -} - -/* -----------------------END RPN QUERY ----------------------- */ - -int z_Query(ODR o, Z_Query **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Query_type_1, - (Odr_fun)z_RPNQuery, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Query_type_2, - (Odr_fun)odr_octetstring, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 101, Z_Query_type_101, - (Odr_fun)z_RPNQuery, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_Query *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_SearchRequest(ODR o, Z_SearchRequest **p, int opt, const char *name) -{ - Z_SearchRequest *pp; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - pp = *p; - return - z_ReferenceId(o, &pp->referenceId, 1, 0) && - odr_implicit(o, odr_integer, &pp->smallSetUpperBound, ODR_CONTEXT, - 13, 0) && - odr_implicit(o, odr_integer, &pp->largeSetLowerBound, ODR_CONTEXT, - 14, 0) && - odr_implicit(o, odr_integer, &pp->mediumSetPresentNumber, ODR_CONTEXT, - 15, 0) && - odr_implicit(o, odr_bool, &pp->replaceIndicator, ODR_CONTEXT, 16, 1) && - odr_implicit(o, odr_visiblestring, &pp->resultSetName, ODR_CONTEXT, - 17, 9) && - odr_implicit_settag(o, ODR_CONTEXT, 18) && - odr_sequence_of(o, z_DatabaseName, &pp->databaseNames, - &pp->num_databaseNames, 0) && - odr_explicit(o, z_ElementSetNames, &pp->smallSetElementSetNames, - ODR_CONTEXT, 100, 1) && - odr_explicit(o, z_ElementSetNames, &pp->mediumSetElementSetNames, - ODR_CONTEXT, 101, 1) && - odr_implicit(o, odr_oid, &pp->preferredRecordSyntax, - ODR_CONTEXT, 104, 1) && - odr_explicit(o, z_Query, &pp->query, ODR_CONTEXT, 21, 0) && - odr_implicit_tag(o, z_OtherInformation, &(*p)->additionalSearchInfo, - ODR_CONTEXT, 203, 1, 0) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -/* ------------------------ RECORD ------------------------- */ - -int z_DatabaseRecord(ODR o, Z_DatabaseRecord **p, int opt, const char *name) -{ - return z_External(o, (Z_External **) p, opt, 0); -} - -int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt, - const char *name) -{ - static Odr_arm arm[] = - { - {-1, -1, -1, Z_DiagForm_v2AddInfo, odr_visiblestring, 0}, - {-1, -1, -1, Z_DiagForm_v3AddInfo, z_InternationalString, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, ODR_VISIBLESTRING, Z_DiagForm_v2AddInfo, - odr_visiblestring, 0}, /* To cater to a bug in the CNIDR servers */ - {-1, -1, -1, -1, 0, 0} - }; - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_oid(o, &(*p)->diagnosticSetId, 1, 0) && /* SHOULD NOT BE OPT! */ - odr_integer(o, &(*p)->condition, 0, 0) && - /* - * I no longer recall what server tagged the addinfo.. but it isn't - * hurting anyone, so... - * We need to turn it into a choice, or something, because of - * that damn generalstring in v3. - */ - odr_choice(o, arm, &(*p)->addinfo, &(*p)->which, 0) && - odr_sequence_end(o); -} - -int z_DiagRec(ODR o, Z_DiagRec **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {-1, -1, -1, Z_DiagRec_defaultFormat, (Odr_fun)z_DefaultDiagFormat, 0}, - {-1, -1, -1, Z_DiagRec_externallyDefined, (Odr_fun)z_External, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_DiagRec *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt, const char *name) -{ - if (o->direction == ODR_DECODE) - *p = (Z_DiagRecs *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - - if (odr_sequence_of(o, (Odr_fun)z_DiagRec, &(*p)->diagRecs, - &(*p)->num_diagRecs, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_NamePlusRecord(ODR o, Z_NamePlusRecord **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_EXPLICIT, ODR_CONTEXT, 1, Z_NamePlusRecord_databaseRecord, - (Odr_fun)z_DatabaseRecord, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_NamePlusRecord_surrogateDiagnostic, - (Odr_fun)z_DiagRec, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_DatabaseName, &(*p)->databaseName, ODR_CONTEXT, - 0, 1) && - odr_constructed_begin(o, &(*p)->u, ODR_CONTEXT, 1, 0) && - odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) && - odr_constructed_end(o) && - odr_sequence_end(o); -} - -int z_NamePlusRecordList(ODR o, Z_NamePlusRecordList **p, int opt, - const char *name) -{ - if (o->direction == ODR_DECODE) - *p = (Z_NamePlusRecordList *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_sequence_of(o, (Odr_fun)z_NamePlusRecord, &(*p)->records, - &(*p)->num_records, 0)) - return 1; - *p = 0; - return 0; -} - -int z_Records(ODR o, Z_Records **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 28, Z_Records_DBOSD, - (Odr_fun)z_NamePlusRecordList, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 130, Z_Records_NSD, - (Odr_fun)z_DiagRec, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 205, Z_Records_multipleNSD, - (Odr_fun)z_DiagRecs, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_Records *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -/* ------------------------ ACCESS CTRL SERVICE ----------------------- */ - -int z_AccessControlRequest(ODR o, Z_AccessControlRequest **p, int opt, - const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 37, Z_AccessRequest_simpleForm, - (Odr_fun)odr_octetstring, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_AccessRequest_externallyDefined, - (Odr_fun)z_External, 0}, - {-1, -1, -1, -1, 0, 0} - }; - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -int z_AccessControlResponse(ODR o, Z_AccessControlResponse **p, int opt, - const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 38, Z_AccessResponse_simpleForm, - (Odr_fun)odr_octetstring, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_AccessResponse_externallyDefined, - (Odr_fun)z_External, 0}, - {-1, -1, -1, -1, 0, 0} - }; - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) && - odr_explicit(o, z_DiagRec, &(*p)->diagnostic, ODR_CONTEXT, 223, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -/* ------------------------ SCAN SERVICE -------------------- */ - -int z_AttributeList(ODR o, Z_AttributeList **p, int opt, const char *name) -{ - if (o->direction == ODR_DECODE) - *p = (Z_AttributeList *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - - odr_implicit_settag(o, ODR_CONTEXT, 44); - if (odr_sequence_of(o, (Odr_fun)z_AttributeElement, &(*p)->attributes, - &(*p)->num_attributes, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -/* - * This is a temporary hack. We don't know just *what* old version of the - * protocol willow uses, so we'll just patiently wait for them to update - */ -static int willow_scan = 0; - -int z_WillowAttributesPlusTerm(ODR o, Z_AttributesPlusTerm **p, int opt, - const char *name) -{ - if (!*p && o->direction != ODR_DECODE) - return opt; - if (!odr_constructed_begin(o, p, ODR_CONTEXT, 4, 0)) - { - o->t_class = -1; - return opt && odr_ok(o); - } - if (!odr_constructed_begin(o, p, ODR_CONTEXT, 1, 0)) - return 0; - if (!odr_constructed_begin(o, p, ODR_UNIVERSAL, ODR_SEQUENCE, 0)) - return 0; - if (!odr_implicit_settag(o, ODR_CONTEXT, 44)) - return 0; - if (o->direction == ODR_DECODE) - *p = (Z_AttributesPlusTerm*)odr_malloc(o, sizeof(**p)); - if (!odr_sequence_of(o, (Odr_fun)z_AttributeElement, &(*p)->attributeList, - &(*p)->num_attributes, 0)) - return 0; - if (!odr_sequence_end(o) || !odr_sequence_end(o)) - return 0; - if (!z_Term(o, &(*p)->term, 0, 0)) - return 0; - if (!odr_constructed_end(o)) - return 0; - willow_scan = 1; - return 1; -} - -int z_AlternativeTerm(ODR o, Z_AlternativeTerm **p, int opt, const char *name) -{ - if (o->direction == ODR_DECODE) - *p = (Z_AlternativeTerm *)odr_malloc(o, sizeof(**p)); - else if (!*p) - { - o->t_class = -1; - return opt && odr_ok(o); - } - - if (odr_sequence_of(o, (Odr_fun)z_AttributesPlusTerm, &(*p)->terms, - &(*p)->num_terms, 0)) - return 1; - *p = 0; - return opt && !o->error; -} - -int z_ByDatabase(ODR o, Z_ByDatabase **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_DatabaseName(o, &(*p)->db, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->num, ODR_CONTEXT, 1, 1) && - z_OtherInformation(o, &(*p)->otherDbInfo, 1, 0) && - odr_sequence_end(o); -} - -int z_ByDatabaseList(ODR o, Z_ByDatabaseList **p, int opt, const char *name) -{ - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of(o, (Odr_fun)z_ByDatabase, &(*p)->elements, - &(*p)->num_elements, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_ScanOccurrences(ODR o, Z_ScanOccurrences **p, int opt, const char *name) -{ - Odr_arm arm[] = - { - {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_ScanOccurrences_global, - (Odr_fun)odr_integer, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 3, Z_ScanOccurrences_byDatabase, - (Odr_fun)z_ByDatabaseList, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_OccurrenceByAttributesElem(ODR o, Z_OccurrenceByAttributesElem **p, - int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_explicit(o, z_AttributeList, &(*p)->attributes, ODR_CONTEXT, - 1, 1) && - z_ScanOccurrences(o, &(*p)->occurrences, 1, 0) && - z_OtherInformation(o, &(*p)->otherOccurInfo, 1, 0) && - odr_sequence_end(o); -} - -int z_OccurrenceByAttributes(ODR o, Z_OccurrenceByAttributes **p, int opt, const char *name) -{ - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (!odr_sequence_of(o, (Odr_fun)z_OccurrenceByAttributesElem, - &(*p)->elements, &(*p)->num_elements, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_TermInfo(ODR o, Z_TermInfo **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - (willow_scan ? - odr_implicit(o, z_Term, &(*p)->term, ODR_CONTEXT, 1, 0) : - z_Term(o, &(*p)->term, 0, 0)) && - odr_implicit(o, z_InternationalString, &(*p)->displayTerm, ODR_CONTEXT, - 0, 1) && - z_AttributeList(o, &(*p)->suggestedAttributes, 1, 0) && - odr_implicit(o, z_AlternativeTerm, &(*p)->alternativeTerm, - ODR_CONTEXT, 4, 1) && - odr_implicit(o, odr_integer, &(*p)->globalOccurrences, ODR_CONTEXT, - 2, 1) && - odr_implicit(o, z_OccurrenceByAttributes, &(*p)->byAttributes, - ODR_CONTEXT, 3, 1) && - z_OtherInformation(o, &(*p)->otherTermInfo, 1, 0) && - odr_sequence_end(o); -} - -int z_Entry(ODR o, Z_Entry **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Entry_termInfo, - (Odr_fun)z_TermInfo, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Entry_surrogateDiagnostic, - (Odr_fun)z_DiagRec, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_Entry *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_ListEntries (ODR o, Z_ListEntries **p, int opt, const char *name) -{ - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - odr_implicit_settag (o, ODR_CONTEXT, 1) && - (odr_sequence_of(o, (Odr_fun) z_Entry, &(*p)->entries, - &(*p)->num_entries, 0) || odr_ok(o)) && - odr_implicit_settag (o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun) z_DiagRec, - &(*p)->nonsurrogateDiagnostics, - &(*p)->num_nonsurrogateDiagnostics, 0) - || odr_ok(o)) && - odr_sequence_end (o); -} - -int z_ScanRequest(ODR o, Z_ScanRequest **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - willow_scan = 0; - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - odr_sequence_of(o, z_DatabaseName, &(*p)->databaseNames, - &(*p)->num_databaseNames, 0) && - odr_oid(o, &(*p)->attributeSet, 1, 0) && - (z_AttributesPlusTerm(o, &(*p)->termListAndStartPoint, 1, 0) ? - ((*p)->termListAndStartPoint ? 1 : - z_WillowAttributesPlusTerm(o, &(*p)->termListAndStartPoint, 0, 0)) - : 0) && - odr_implicit(o, odr_integer, &(*p)->stepSize, ODR_CONTEXT, 5, 1) && - odr_implicit(o, odr_integer, &(*p)->numberOfTermsRequested, - ODR_CONTEXT, 6, 0) && - odr_implicit(o, odr_integer, &(*p)->preferredPositionInResponse, - ODR_CONTEXT, 7, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, "otherInfo") && - odr_sequence_end(o); -} - -int z_ScanResponse(ODR o, Z_ScanResponse **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->stepSize, ODR_CONTEXT, 3, 1) && - odr_implicit(o, odr_integer, &(*p)->scanStatus, ODR_CONTEXT, 4, 0) && - odr_implicit(o, odr_integer, &(*p)->numberOfEntriesReturned, - ODR_CONTEXT, 5, 0) && - odr_implicit(o, odr_integer, &(*p)->positionOfTerm, - ODR_CONTEXT, 6, 1) && - odr_implicit(o, z_ListEntries, &(*p)->entries, ODR_CONTEXT, 7, 1) && - odr_implicit(o, odr_oid, &(*p)->attributeSet, ODR_CONTEXT, 8, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -/* ------------------------ SEARCHRESPONSE ----------------*/ - -int z_NumberOfRecordsReturned(ODR o, int **p, int opt, const char *name) -{ - return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 24, opt); -} - -int z_NextResultSetPosition(ODR o, int **p, int opt, const char *name) -{ - return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 25, opt); -} - -int z_PresentStatus(ODR o, int **p, int opt, const char *name) -{ - return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 27, opt); -} - -int z_SearchResponse(ODR o, Z_SearchResponse **p, int opt, const char *name) -{ - Z_SearchResponse *pp; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - pp = *p; - return - z_ReferenceId(o, &pp->referenceId, 1, 0) && - odr_implicit(o, odr_integer, &pp->resultCount, ODR_CONTEXT, 23, 0) && - z_NumberOfRecordsReturned(o, &pp->numberOfRecordsReturned, 0, 0) && - z_NextResultSetPosition(o, &pp->nextResultSetPosition, 0, 0) && - odr_implicit(o, odr_bool, &pp->searchStatus, ODR_CONTEXT, 22, 0) && - odr_implicit(o, odr_integer, &pp->resultSetStatus, - ODR_CONTEXT, 26, 1) && - z_PresentStatus(o, &pp->presentStatus, 1, 0) && - z_Records(o, &pp->records, 1, 0) && - odr_implicit(o, z_OtherInformation, &(*p)->additionalSearchInfo, - ODR_CONTEXT, 203, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -/* --------------------- PRESENT SERVICE ---------------------- */ - -int z_ElementSpec(ODR o, Z_ElementSpec **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementSpec_elementSetName, - odr_visiblestring, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ElementSpec_externalSpec, - (Odr_fun)z_External, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_ElementSpec *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_Specification(ODR o, Z_Specification **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_oid, &(*p)->schema, ODR_CONTEXT, 1, 1) && - z_ElementSpec(o, &(*p)->elementSpec, 1, 0) && - odr_sequence_end(o); -} - -int z_DbSpecific(ODR o, Z_DbSpecific **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_explicit(o, z_DatabaseName, &(*p)->databaseName, ODR_CONTEXT, - 1, 0) && - odr_implicit(o, z_Specification, &(*p)->spec, ODR_CONTEXT, 2, 0) && - odr_sequence_end(o); -} - -int z_CompSpec(ODR o, Z_CompSpec **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_bool, &(*p)->selectAlternativeSyntax, ODR_CONTEXT, - 1, 0) && - odr_implicit(o, z_Specification, &(*p)->generic, ODR_CONTEXT, 2, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, (Odr_fun)z_DbSpecific, &(*p)->dbSpecific, - &(*p)->num_dbSpecific, 0) || odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 4) && - (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->recordSyntax, - &(*p)->num_recordSyntax, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_RecordComposition(ODR o, Z_RecordComposition **p, int opt, - const char *name) -{ - static Odr_arm arm[] = - { - {ODR_EXPLICIT, ODR_CONTEXT, 19, Z_RecordComp_simple, - (Odr_fun)z_ElementSetNames, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 209, Z_RecordComp_complex, - (Odr_fun)z_CompSpec, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_RecordComposition *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_Range(ODR o, Z_Range **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->startingPosition, - ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->numberOfRecords, - ODR_CONTEXT, 2, 0) && - odr_sequence_end(o); -} - -int z_PresentRequest(ODR o, Z_PresentRequest **p, int opt, const char *name) -{ - Z_PresentRequest *pp; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - pp = *p; - return - z_ReferenceId(o, &pp->referenceId, 1, 0) && - z_ResultSetId(o, &pp->resultSetId, 0, 0) && - odr_implicit(o, odr_integer, &pp->resultSetStartPoint, - ODR_CONTEXT, 30, 0) && - odr_implicit(o, odr_integer, &pp->numberOfRecordsRequested, - ODR_CONTEXT, 29, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 212) && - (odr_sequence_of(o, (Odr_fun)z_Range, &(*p)->additionalRanges, - &(*p)->num_ranges, 0) || odr_ok(o)) && - z_RecordComposition(o, &(*p)->recordComposition, 1, 0) && - odr_implicit(o, odr_oid, &(*p)->preferredRecordSyntax, ODR_CONTEXT, - 104, 1) && - odr_implicit(o, odr_integer, &(*p)->maxSegmentCount, ODR_CONTEXT, - 204, 1) && - odr_implicit(o, odr_integer, &(*p)->maxRecordSize, ODR_CONTEXT, - 206, 1) && - odr_implicit(o, odr_integer, &(*p)->maxSegmentSize, ODR_CONTEXT, - 207, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -int z_PresentResponse(ODR o, Z_PresentResponse **p, int opt, const char *name) -{ - Z_PresentResponse *pp; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - pp = *p; - return - z_ReferenceId(o, &pp->referenceId, 1, 0) && - z_NumberOfRecordsReturned(o, &pp->numberOfRecordsReturned, 0, 0) && - z_NextResultSetPosition(o, &pp->nextResultSetPosition, 0, 0) && - z_PresentStatus(o, &pp->presentStatus, 0, 0) && - z_Records(o, &pp->records, 1, 0) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -/* ----------------------DELETE -------------------------- */ - -int z_DeleteSetStatus(ODR o, int **p, int opt, const char *name) -{ - return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 33, opt); -} - -int z_ListStatus(ODR o, Z_ListStatus **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ResultSetId(o, &(*p)->id, 0, 0) && - z_DeleteSetStatus(o, &(*p)->status, 0, 0) && - odr_sequence_end(o); -} - -int z_DeleteResultSetRequest(ODR o, Z_DeleteResultSetRequest **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->deleteFunction, ODR_CONTEXT, 32, - 0) && - (odr_sequence_of(o, z_ResultSetId, &(*p)->resultSetList, - &(*p)->num_resultSetList, 0) || odr_ok(o)) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -int z_ListStatuses (ODR o, Z_ListStatuses **p, int opt, const char *name) -{ - if (!odr_initmember (o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of (o, (Odr_fun) z_ListStatus, &(*p)->elements, - &(*p)->num, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_DeleteResultSetResponse(ODR o, Z_DeleteResultSetResponse **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit(o, z_DeleteSetStatus, &(*p)->deleteOperationStatus, - ODR_CONTEXT, 0, 0) && - odr_implicit (o, z_ListStatuses, - &(*p)->deleteListStatuses, ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_integer, &(*p)->numberNotDeleted, ODR_CONTEXT, - 34, 1) && - odr_implicit (o, z_ListStatuses, - &(*p)->bulkStatuses, ODR_CONTEXT, 35, 1) && - odr_implicit(o, odr_visiblestring, &(*p)->deleteMessage, ODR_CONTEXT, - 36, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -/* ------------------------ SEGMENT SERVICE -------------- */ - -int z_Segment(ODR o, Z_Segment **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->numberOfRecordsReturned, - ODR_CONTEXT, 24, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 0) && - odr_sequence_of(o, (Odr_fun)z_NamePlusRecord, &(*p)->segmentRecords, - &(*p)->num_segmentRecords, 0) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -/* ------------------------ CLOSE SERVICE ---------------- */ - -int z_Close(ODR o, Z_Close **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->closeReason, ODR_CONTEXT, 211, 0) - && - odr_implicit(o, odr_visiblestring, &(*p)->diagnosticInformation, - ODR_CONTEXT, 3, 1) && - odr_implicit(o, odr_oid, &(*p)->resourceReportFormat, ODR_CONTEXT, - 4, 1) && - odr_implicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT, - 5, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -/* ------------------------ APDU ------------------------- */ - -int z_Permissions(ODR o, Z_Permissions **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->userId, ODR_CONTEXT, - 1, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - odr_sequence_of(o, (Odr_fun)odr_integer, &(*p)->allowableFunctions, - &(*p)->num_allowableFunctions, 0) && - odr_sequence_end(o); -} - -int z_ExtendedServicesRequest(ODR o, Z_ExtendedServicesRequest **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->function, ODR_CONTEXT, 3, 0) && - odr_implicit(o, odr_oid, &(*p)->packageType, ODR_CONTEXT, 4, 0) && - odr_implicit(o, z_InternationalString, &(*p)->packageName, - ODR_CONTEXT, 5, 1) && - odr_implicit(o, z_InternationalString, &(*p)->userId, - ODR_CONTEXT, 6, 1) && - odr_implicit(o, z_IntUnit, &(*p)->retentionTime, - ODR_CONTEXT, 7, 1) && - odr_implicit(o, z_Permissions, &(*p)->permissions, - ODR_CONTEXT, 8, 1) && - odr_implicit(o, z_InternationalString, &(*p)->description, - ODR_CONTEXT, 9, 1) && - odr_implicit(o, z_External, &(*p)->taskSpecificParameters, - ODR_CONTEXT, 10, 1) && - odr_implicit(o, odr_integer, &(*p)->waitAction, - ODR_CONTEXT, 11, 0) && - z_ElementSetName(o, &(*p)->elements, 1, 0) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -int z_ExtendedServicesResponse(ODR o, Z_ExtendedServicesResponse **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->operationStatus, ODR_CONTEXT, - 3, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 4) && - (odr_sequence_of(o, (Odr_fun)z_DiagRec, &(*p)->diagnostics, - &(*p)->num_diagnostics, 0) || odr_ok(o)) && - odr_implicit(o, z_External, &(*p)->taskPackage, ODR_CONTEXT, 5, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -/* ------------------------ SORT ------------------------- */ - -int z_SortAttributes(ODR o, Z_SortAttributes **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_oid(o, &(*p)->id, 0, 0) && - z_AttributeList(o, &(*p)->list, 0, 0) && - odr_sequence_end(o); -} - -int z_SortKey(ODR o, Z_SortKey **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortKey_sortField, - z_InternationalString, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKey_elementSpec, - (Odr_fun)z_Specification, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKey_sortAttributes, - (Odr_fun)z_SortAttributes, 0}, - {-1, -1, -1, -1, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_SortDbSpecific(ODR o, Z_SortDbSpecific **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_DatabaseName(o, &(*p)->databaseName, 0, 0) && - z_SortKey(o, &(*p)->dbSort, 0, 0) && - odr_sequence_end(o); -} - -int z_SortDbSpecificList(ODR o, Z_SortDbSpecificList **p, int opt, - const char *name) -{ - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of(o, (Odr_fun)z_SortDbSpecific, &(*p)->dbSpecific, - &(*p)->num_dbSpecific, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_SortElement(ODR o, Z_SortElement **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_EXPLICIT, ODR_CONTEXT, 1, Z_SortElement_generic, - (Odr_fun)z_SortKey, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortElement_databaseSpecific, - (Odr_fun)z_SortDbSpecificList, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_SortMissingValueAction(ODR o, Z_SortMissingValueAction **p, int opt, - const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortMissingValAct_abort, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortMissingValAct_null, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_SortMissingValAct_valData, - (Odr_fun)odr_octetstring, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_SortKeySpec(ODR o, Z_SortKeySpec **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_SortElement(o, &(*p)->sortElement, 0, 0) && - odr_implicit(o, odr_integer, &(*p)->sortRelation, ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->caseSensitivity, - ODR_CONTEXT, 2, 0) && - odr_explicit(o, z_SortMissingValueAction, &(*p)->missingValueAction, - ODR_CONTEXT, 3, 1) && - odr_sequence_end(o); -} - -int z_SortResponse(ODR o, Z_SortResponse **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->sortStatus, ODR_CONTEXT, - 3, 0) && - odr_implicit(o, odr_integer, &(*p)->resultSetStatus, ODR_CONTEXT, - 4, 1) && - odr_implicit(o, z_DiagRecs, &(*p)->diagnostics, ODR_CONTEXT, 5, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -int z_SortKeySpecList(ODR o, Z_SortKeySpecList **p, int opt, const char *name) -{ - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of(o, (Odr_fun)z_SortKeySpec, &(*p)->specs, - &(*p)->num_specs, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_SortRequest(ODR o, Z_SortRequest **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit(o, z_StringList, &(*p)->inputResultSetNames, - ODR_CONTEXT, 3, 0) && - odr_implicit(o, z_InternationalString, &(*p)->sortedResultSetName, - ODR_CONTEXT, 4, 0) && - odr_implicit(o, z_SortKeySpecList, &(*p)->sortSequence, ODR_CONTEXT, - 5, 0) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -/* ---------------------- Resource Report ---------------- */ - -int z_ResourceReportRequest(ODR o, Z_ResourceReportRequest **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit(o, z_ReferenceId, &(*p)->opId, ODR_CONTEXT, 210, 1) && - odr_implicit(o, odr_oid, &(*p)->prefResourceReportFormat, ODR_CONTEXT, - 49, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -int z_ResourceReportResponse(ODR o, Z_ResourceReportResponse **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_ReferenceId(o, &(*p)->referenceId, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->resourceReportStatus, - ODR_CONTEXT, 50, 0) && - odr_explicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT, - 51, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -/* ------------------------ APDU ------------------------- */ - -int z_APDU(ODR o, Z_APDU **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 20, Z_APDU_initRequest, - (Odr_fun)z_InitRequest, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 21, Z_APDU_initResponse, - (Odr_fun)z_InitResponse, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 22, Z_APDU_searchRequest, - (Odr_fun)z_SearchRequest, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 23, Z_APDU_searchResponse, - (Odr_fun)z_SearchResponse, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 24, Z_APDU_presentRequest, - (Odr_fun)z_PresentRequest, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 25, Z_APDU_presentResponse, - (Odr_fun)z_PresentResponse, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 26, Z_APDU_deleteResultSetRequest, - (Odr_fun)z_DeleteResultSetRequest, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 27, Z_APDU_deleteResultSetResponse, - (Odr_fun)z_DeleteResultSetResponse, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 28, Z_APDU_accessControlRequest, - (Odr_fun)z_AccessControlRequest, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 29, Z_APDU_accessControlResponse, - (Odr_fun)z_AccessControlResponse, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 30, Z_APDU_resourceControlRequest, - (Odr_fun)z_ResourceControlRequest, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 31, Z_APDU_resourceControlResponse, - (Odr_fun)z_ResourceControlResponse, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 32, Z_APDU_triggerResourceControlRequest, - (Odr_fun)z_TriggerResourceControlRequest, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 33, Z_APDU_resourceReportRequest, - (Odr_fun)z_ResourceReportRequest, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 34, Z_APDU_resourceReportResponse, - (Odr_fun)z_ResourceReportResponse, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 35, Z_APDU_scanRequest, - (Odr_fun)z_ScanRequest, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 36, Z_APDU_scanResponse, - (Odr_fun)z_ScanResponse, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 43, Z_APDU_sortRequest, - (Odr_fun)z_SortRequest, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 44, Z_APDU_sortResponse, - (Odr_fun)z_SortResponse, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 45, Z_APDU_segmentRequest, - (Odr_fun)z_Segment, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 46, Z_APDU_extendedServicesRequest, - (Odr_fun)z_ExtendedServicesRequest, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 47, Z_APDU_extendedServicesResponse, - (Odr_fun)z_ExtendedServicesResponse}, - {ODR_IMPLICIT, ODR_CONTEXT, 48, Z_APDU_close, - (Odr_fun)z_Close, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_APDU *)odr_malloc(o, sizeof(**p)); - odr_setlenlen(o, 5); - if (!odr_choice(o, arm, &(*p)->u, &(*p)->which, name)) - { - if (o->direction == ODR_DECODE) - *p = 0; - return opt && odr_ok(o); - } - return 1; -} diff --git a/asn/prt-acc.c b/asn/prt-acc.c deleted file mode 100644 index 0e3817f..0000000 --- a/asn/prt-acc.c +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) 1995-1999, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: prt-acc.c,v $ - * Revision 1.9 1999-11-30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.8 1999/04/20 09:56:47 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.7 1998/02/11 11:53:32 adam - * Changed code so that it compiles as C++. - * - * Revision 1.6 1998/01/05 09:04:57 adam - * Fixed bugs in encoders/decoders - Not operator (!) missing. - * - * Revision 1.5 1995/09/29 17:11:53 quinn - * Smallish - * - * Revision 1.4 1995/09/27 15:02:41 quinn - * Modified function heads & prototypes. - * - * Revision 1.3 1995/08/15 11:59:41 quinn - * Updated External - * - * Revision 1.2 1995/06/05 10:52:05 quinn - * Fixed some negligences. - * - * Revision 1.1 1995/06/02 09:49:15 quinn - * Adding access control - * - * - */ - -#include - -int z_Encryption1(ODR o, Z_Encryption1 **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_octetstring, &(*p)->cryptType, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_octetstring, &(*p)->credential, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, odr_octetstring, &(*p)->data, ODR_CONTEXT, 3, 0) && - odr_sequence_end(o); -} - -int z_EnumeratedPrompt1(ODR o, Z_EnumeratedPrompt1 **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->type, ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_visiblestring, &(*p)->suggestedString, ODR_CONTEXT, - 2, 1) && - odr_sequence_end(o); -} - -int z_PromptId1(ODR o, Z_PromptId1 **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_PromptId1_enumeratedPrompt, - (Odr_fun)z_EnumeratedPrompt1, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_PromptId1_nonEnumeratedPrompt, - odr_visiblestring, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_PromptId1 *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_PromptInfo1(ODR o, Z_PromptInfo1 **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Challenge1_character, - odr_visiblestring, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Challenge1_encrypted, - (Odr_fun)z_Encryption1, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_PromptInfo1 *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_ChallengeUnit1(ODR o, Z_ChallengeUnit1 **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_explicit(o, z_PromptId1, &(*p)->promptId, ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_visiblestring, &(*p)->defaultResponse, - ODR_CONTEXT, 2, 1) && - odr_explicit(o, z_PromptInfo1, &(*p)->promptInfo, - ODR_CONTEXT, 3, 1) && - odr_implicit(o, odr_visiblestring, &(*p)->regExpr, - ODR_CONTEXT, 4, 1) && - odr_implicit(o, odr_null, &(*p)->responseRequired, - ODR_CONTEXT, 5, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 6) && - (odr_sequence_of(o, odr_visiblestring, &(*p)->allowedValues, - &(*p)->num_values, 0) || odr_ok(o)) && - odr_implicit(o, odr_null, &(*p)->shouldSave, ODR_CONTEXT, 7, 1) && - odr_implicit(o, odr_integer, &(*p)->dataType, ODR_CONTEXT, 8, 1) && - odr_implicit(o, z_External, &(*p)->diagnostic, ODR_CONTEXT, 9, 1) && - odr_sequence_end(o); -} - -int z_Challenge1(ODR o, Z_Challenge1 **p, int opt, const char *name) -{ - if (o->direction == ODR_ENCODE) - *p = (Z_Challenge1 *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_sequence_of(o, (Odr_fun)z_ChallengeUnit1, &(*p)->list, - &(*p)->num_challenges, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_ResponseUnit1(ODR o, Z_ResponseUnit1 **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Response1_string, - odr_visiblestring, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Response1_accept, - (Odr_fun)odr_bool, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Response1_acknowledge, - (Odr_fun)odr_null, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 4, Z_Response1_diagnostic, - (Odr_fun)z_DiagRec, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_Response1_encrypted, - (Odr_fun)z_Encryption1, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_explicit(o, z_PromptId1, &(*p)->promptId, ODR_CONTEXT, 1, 0) && - odr_constructed_begin(o, p, ODR_CONTEXT, 2, 0) && - odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) && - odr_constructed_end(o) && - odr_sequence_end(o); -} - -int z_Response1(ODR o, Z_Response1 **p, int opt, const char *name) -{ - if (o->direction == ODR_ENCODE) - *p = (Z_Response1 *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_sequence_of(o, (Odr_fun)z_ResponseUnit1, &(*p)->list, - &(*p)->num_responses, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_PromptObject1(ODR o, Z_PromptObject1 **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_PromptObject1_challenge, - (Odr_fun)z_Challenge1, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_PromptObject1_response, - (Odr_fun)z_Response1, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_PromptObject1 *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} diff --git a/asn/prt-acc.h b/asn/prt-acc.h deleted file mode 100644 index 214b4c7..0000000 --- a/asn/prt-acc.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 1995, Index Data. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The name of Index Data or the individual authors may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR - * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - * $Log: prt-acc.h,v $ - * Revision 1.1 2000-10-03 12:55:50 adam - * Removed several auto-generated files from CVS. - * - * Revision 1.1 1999/11/30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.9 1999/04/20 09:56:48 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.8 1997/09/01 08:49:51 adam - * New windows NT/95 port using MSV5.0. To export DLL functions the - * YAZ_EXPORT modifier was added. Defined in yconfig.h. - * - * Revision 1.7 1997/05/14 06:53:46 adam - * C++ support. - * - * Revision 1.6 1996/01/02 08:57:35 quinn - * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass - * - * Revision 1.5 1995/09/29 17:12:09 quinn - * Smallish - * - * Revision 1.4 1995/09/27 15:02:49 quinn - * Modified function heads & prototypes. - * - * Revision 1.3 1995/08/17 12:45:16 quinn - * Fixed minor problems with GRS-1. Added support in c&s. - * - * Revision 1.2 1995/08/15 12:00:13 quinn - * Updated External - * - * Revision 1.1 1995/06/02 09:49:49 quinn - * Add access control - * - * - */ - -#ifndef PRT_ACC_H -#define PRT_ACC_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct Z_Encryption1 -{ - Odr_oct *cryptType; /* OPTIONAL */ - Odr_oct *credential; /* OPTIONAL */ - Odr_oct *data; -} Z_Encryption1; - -typedef struct Z_EnumeratedPrompt1 -{ - int *type; -#define Z_Prompt1_groupId 0 -#define Z_Prompt1_userId 1 -#define Z_Prompt1_password 2 -#define Z_Prompt1_newPassword 3 -#define Z_Prompt1_copyright 4 - char *suggestedString; /* OPTIONAL */ -} Z_EnumeratedPrompt1; - -typedef struct Z_PromptId1 -{ - int which; -#define Z_PromptId1_enumeratedPrompt 0 -#define Z_PromptId1_nonEnumeratedPrompt 1 - union - { - Z_EnumeratedPrompt1 *enumeratedPrompt; - char *nonEnumeratedPrompt; - } u; -} Z_PromptId1; - -typedef struct Z_PromptInfo1 -{ - int which; -#define Z_Challenge1_character 0 -#define Z_Challenge1_encrypted 1 - union - { - char *character; - Z_Encryption1 *encrypted; - } u; -} Z_PromptInfo1; - -typedef struct Z_ChallengeUnit1 -{ - Z_PromptId1 *promptId; - char *defaultResponse; /* OPTIONAL */ - Z_PromptInfo1 *promptInfo; /* OPTIONAL */ - char *regExpr; /* OPTIONAL */ - Odr_null *responseRequired; /* OPTIONAL */ - int num_values; - char **allowedValues; /* OPTIONAL */ - Odr_null *shouldSave; /* OPTIONAL */ - int *dataType; /* OPTIONAL */ -#define Z_ChalDataType_integer 1 -#define Z_ChalDataType_date 2 -#define Z_ChalDataType_float 3 -#define Z_ChalDataType_alphaNumeric 4 -#define Z_ChalDataType_urlUrn 5 -#define Z_ChalDataType_boolean 6 - Z_External *diagnostic; /* OPTIONAL */ -} Z_ChallengeUnit1; - -typedef struct Z_Challenge1 -{ - int num_challenges; - Z_ChallengeUnit1 **list; -} Z_Challenge1; - -typedef struct Z_ResponseUnit1 -{ - Z_PromptId1 *promptId; - int which; -#define Z_Response1_string 0 -#define Z_Response1_accept 1 -#define Z_Response1_acknowledge 2 -#define Z_Response1_diagnostic 3 -#define Z_Response1_encrypted 4 - union - { - char *string; - bool_t *accept; - Odr_null *acknowledge; - Z_DiagRec *diagnostic; - Z_Encryption1 *encrypted; - } u; -} Z_ResponseUnit1; - -typedef struct Z_Response1 -{ - int num_responses; - Z_ResponseUnit1 **list; -} Z_Response1; - -typedef struct Z_PromptObject1 -{ - int which; -#define Z_PromptObject1_challenge 0 -#define Z_PromptObject1_response 1 - union - { - Z_Challenge1 *challenge; - Z_Response1 *response; - } u; -} Z_PromptObject1; - -YAZ_EXPORT int z_PromptObject1(ODR o, Z_PromptObject1 **p, int opt, - const char *name); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/asn/prt-add.c b/asn/prt-add.c deleted file mode 100644 index dc18e3f..0000000 --- a/asn/prt-add.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 1995-1999, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: prt-add.c,v $ - * Revision 1.6 1999-11-30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.5 1999/04/20 09:56:47 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.4 1998/02/11 11:53:32 adam - * Changed code so that it compiles as C++. - * - * Revision 1.3 1998/01/05 09:04:57 adam - * Fixed bugs in encoders/decoders - Not operator (!) missing. - * - * Revision 1.2 1997/04/30 08:52:02 quinn - * Null - * - * Revision 1.1 1996/10/10 11:52:18 quinn - * Added SearchResult additionalInfo - * - * - */ - -#include - -int z_ResultsByDBList (ODR o, Z_ResultsByDBList **p, int opt, const char *name) -{ - if (!odr_initmember (o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of (o, z_DatabaseName, &(*p)->elements, - &(*p)->num, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_ResultsByDB_elem (ODR o, Z_ResultsByDB_elem **p, int opt, - const char *name) -{ - static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ResultsByDB_all, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ResultsByDB_list, - (Odr_fun)z_ResultsByDBList, 0}, - {-1, -1, -1, -1, 0, 0} - }; - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, 0) && - odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && - odr_constructed_end (o) && - odr_implicit (o, odr_integer, - &(*p)->count, ODR_CONTEXT, 2, 1) && - odr_implicit (o, z_InternationalString, - &(*p)->resultSetName, ODR_CONTEXT, 3, 1) && - odr_sequence_end (o); -} - -int z_ResultsByDB (ODR o, Z_ResultsByDB **p, int opt, const char *name) -{ - if (!odr_initmember (o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of (o, (Odr_fun)z_ResultsByDB_elem, &(*p)->elements, - &(*p)->num, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_QueryExpressionTerm (ODR o, Z_QueryExpressionTerm **p, int opt, - const char *name) -{ - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - odr_explicit (o, z_Term, - &(*p)->queryTerm, ODR_CONTEXT, 1, 0) && - odr_implicit (o, z_InternationalString, - &(*p)->termComment, ODR_CONTEXT, 2, 1) && - odr_sequence_end (o); -} - -int z_QueryExpression (ODR o, Z_QueryExpression **p, int opt, - const char *name) -{ - static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_QueryExpression_term, - (Odr_fun)z_QueryExpressionTerm, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_QueryExpression_query, - (Odr_fun)z_Query, 0}, - {-1, -1, -1, -1, 0, 0} - }; - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_SearchInfoReport_elem (ODR o, Z_SearchInfoReport_elem **p, int opt, - const char *name) -{ - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - odr_implicit (o, z_InternationalString, - &(*p)->subqueryId, ODR_CONTEXT, 1, 1) && - odr_implicit (o, odr_bool, - &(*p)->fullQuery, ODR_CONTEXT, 2, 0) && - odr_explicit (o, z_QueryExpression, - &(*p)->subqueryExpression, ODR_CONTEXT, 3, 1) && - odr_explicit (o, z_QueryExpression, - &(*p)->subqueryInterpretation, ODR_CONTEXT, 4, 1) && - odr_explicit (o, z_QueryExpression, - &(*p)->subqueryRecommendation, ODR_CONTEXT, 5, 1) && - odr_implicit (o, odr_integer, - &(*p)->subqueryCount, ODR_CONTEXT, 6, 1) && - odr_implicit (o, z_IntUnit, - &(*p)->subqueryWeight, ODR_CONTEXT, 7, 1) && - odr_implicit (o, z_ResultsByDB, - &(*p)->resultsByDB, ODR_CONTEXT, 8, 1) && - odr_sequence_end (o); -} - -int z_SearchInfoReport (ODR o, Z_SearchInfoReport **p, int opt, - const char *name) -{ - if (!odr_initmember (o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of (o, (Odr_fun)z_SearchInfoReport_elem, &(*p)->elements, - &(*p)->num, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} diff --git a/asn/prt-add.h b/asn/prt-add.h deleted file mode 100644 index e942d7b..0000000 --- a/asn/prt-add.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 1995, Index Data. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The name of Index Data or the individual authors may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR - * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - * $Log: prt-add.h,v $ - * Revision 1.1 2000-10-03 12:55:50 adam - * Removed several auto-generated files from CVS. - * - * Revision 1.1 1999/11/30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.4 1999/04/20 09:56:48 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.3 1997/05/14 06:53:46 adam - * C++ support. - * - * Revision 1.2 1997/04/30 08:52:09 quinn - * Null - * - * Revision 1.1 1996/10/10 11:51:58 quinn - * Added SerchResult additional info - * - * - */ - -#ifndef PRT_ADD_H -#define PRT_ADD_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct Z_QueryExpressionTerm -{ - Z_Term *queryTerm; - char *termComment; /* OPTIONAL */ -} Z_QueryExpressionTerm; - -typedef struct Z_QueryExpression -{ - int which; -#define Z_QueryExpression_term 1 -#define Z_QueryExpression_query 2 - union { - Z_QueryExpressionTerm *term; - Z_Query *query; - } u; -} Z_QueryExpression; - -typedef struct Z_ResultsByDBList -{ - int num; - Z_DatabaseName **elements; -} Z_ResultsByDBList; - -typedef struct Z_ResultsByDB_elem -{ - int which; -#define Z_ResultsByDB_all 1 -#define Z_ResultsByDB_list 2 - union { - Odr_null *all; - Z_ResultsByDBList *list; - } u; - int *count; /* OPTIONAL */ - char *resultSetName; /* OPTIONAL */ -} Z_ResultsByDB_elem; - -typedef struct Z_ResultsByDB -{ - int num; - Z_ResultsByDB_elem **elements; -} Z_ResultsByDB; - -typedef struct Z_SearchInfoReport_elem -{ - char *subqueryId; /* OPTIONAL */ - bool_t *fullQuery; - Z_QueryExpression *subqueryExpression; /* OPTIONAL */ - Z_QueryExpression *subqueryInterpretation; /* OPTIONAL */ - Z_QueryExpression *subqueryRecommendation; /* OPTIONAL */ - int *subqueryCount; /* OPTIONAL */ - Z_IntUnit *subqueryWeight; /* OPTIONAL */ - Z_ResultsByDB *resultsByDB; /* OPTIONAL */ -} Z_SearchInfoReport_elem; - -typedef struct Z_SearchInfoReport -{ - int num; - Z_SearchInfoReport_elem **elements; -} Z_SearchInfoReport; - -int z_SearchInfoReport (ODR o, Z_SearchInfoReport **p, int opt, - const char *name); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/asn/prt-arc.c b/asn/prt-arc.c deleted file mode 100644 index a3974c7..0000000 --- a/asn/prt-arc.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (c) 1995-1999, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: prt-arc.c,v $ - * Revision 1.4 1999-11-30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.3 1999/04/20 09:56:47 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.2 1998/02/11 11:53:32 adam - * Changed code so that it compiles as C++. - * - * Revision 1.1 1996/06/10 08:55:20 quinn - * Added Summary, OPAC - * - * - */ - -#include - -/* ----------------------- Summary Record --------------- */ - -int z_FormatSpec(ODR o, Z_FormatSpec **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->type, - ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->size, ODR_CONTEXT, 2, 1) && - odr_implicit(o, odr_integer, &(*p)->bestPosn, ODR_CONTEXT, 3, 1) && - odr_sequence_end(o); -} - -int z_BriefBib(ODR o, Z_BriefBib **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->title, - ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->author, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_InternationalString, &(*p)->callNumber, - ODR_CONTEXT, 3, 1) && - odr_implicit(o, z_InternationalString, &(*p)->recordType, - ODR_CONTEXT, 4, 1) && - odr_implicit(o, z_InternationalString, &(*p)->bibliographicLevel, - ODR_CONTEXT, 5, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 6) && - (odr_sequence_of(o, (Odr_fun)z_FormatSpec, &(*p)->format, - &(*p)->num_format, 0) || - odr_ok(o)) && - odr_implicit(o, z_InternationalString, &(*p)->publicationPlace, - ODR_CONTEXT, 7, 1) && - odr_implicit(o, z_InternationalString, &(*p)->publicationDate, - ODR_CONTEXT, 8, 1) && - odr_implicit(o, z_InternationalString, &(*p)->targetSystemKey, - ODR_CONTEXT, 9, 1) && - odr_implicit(o, z_InternationalString, &(*p)->satisfyingElement, - ODR_CONTEXT, 10, 1) && - odr_implicit(o, odr_integer, &(*p)->rank, - ODR_CONTEXT, 11, 1) && - odr_implicit(o, z_InternationalString, &(*p)->documentId, - ODR_CONTEXT, 12, 1) && - odr_implicit(o, z_InternationalString, &(*p)->abstract, - ODR_CONTEXT, 13, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -/* ----------------------- Summary Record --------------- */ - -int z_CircRecord(ODR o, Z_CircRecord **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_bool, &(*p)->availableNow, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->availabilityDate, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_InternationalString, &(*p)->availableThru, - ODR_CONTEXT, 3, 1) && - odr_implicit(o, z_InternationalString, &(*p)->restrictions, - ODR_CONTEXT, 4, 1) && - odr_implicit(o, z_InternationalString, &(*p)->itemId, - ODR_CONTEXT, 5, 1) && - odr_implicit(o, odr_bool, &(*p)->renewable, ODR_CONTEXT, 6, 0) && - odr_implicit(o, odr_bool, &(*p)->onHold, ODR_CONTEXT, 7, 0) && - odr_implicit(o, z_InternationalString, &(*p)->enumAndChron, - ODR_CONTEXT, 8, 1) && - odr_implicit(o, z_InternationalString, &(*p)->midspine, - ODR_CONTEXT, 9, 1) && - odr_implicit(o, z_InternationalString, &(*p)->temporaryLocation, - ODR_CONTEXT, 10, 1) && - odr_sequence_end(o); -} - -int z_Volume(ODR o, Z_Volume **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->enumeration, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_InternationalString, &(*p)->chronology, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_InternationalString, &(*p)->enumAndChron, - ODR_CONTEXT, 3, 1) && - odr_sequence_end(o); -} - -int z_HoldingsAndCircData(ODR o, Z_HoldingsAndCircData **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->typeOfRecord, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_InternationalString, &(*p)->encodingLevel, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_InternationalString, &(*p)->format, - ODR_CONTEXT, 3, 1) && - odr_implicit(o, z_InternationalString, &(*p)->receiptAcqStatus, - ODR_CONTEXT, 4, 1) && - odr_implicit(o, z_InternationalString, &(*p)->generalRetention, - ODR_CONTEXT, 5, 1) && - odr_implicit(o, z_InternationalString, &(*p)->completeness, - ODR_CONTEXT, 6, 1) && - odr_implicit(o, z_InternationalString, &(*p)->dateOfReport, - ODR_CONTEXT, 7, 1) && - odr_implicit(o, z_InternationalString, &(*p)->nucCode, - ODR_CONTEXT, 8, 1) && - odr_implicit(o, z_InternationalString, &(*p)->localLocation, - ODR_CONTEXT, 9, 1) && - odr_implicit(o, z_InternationalString, &(*p)->shelvingLocation, - ODR_CONTEXT, 10, 1) && - odr_implicit(o, z_InternationalString, &(*p)->callNumber, - ODR_CONTEXT, 11, 1) && - odr_implicit(o, z_InternationalString, &(*p)->shelvingData, - ODR_CONTEXT, 12, 1) && - odr_implicit(o, z_InternationalString, &(*p)->copyNumber, - ODR_CONTEXT, 13, 1) && - odr_implicit(o, z_InternationalString, &(*p)->publicNote, - ODR_CONTEXT, 14, 1) && - odr_implicit(o, z_InternationalString, &(*p)->reproductionNote, - ODR_CONTEXT, 15, 1) && - odr_implicit(o, z_InternationalString, &(*p)->termsUseRepro, - ODR_CONTEXT, 16, 1) && - odr_implicit(o, z_InternationalString, &(*p)->enumAndChron, - ODR_CONTEXT, 17, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 18) && - (odr_sequence_of(o, (Odr_fun)z_Volume, &(*p)->volumes, - &(*p)->num_volumes, 0) || - odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 19) && - (odr_sequence_of(o, (Odr_fun)z_CircRecord, &(*p)->circulationData, - &(*p)->num_circulationData, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_HoldingsRecord(ODR o, Z_HoldingsRecord **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_HoldingsRecord_marcHoldingsRecord, - (Odr_fun)z_External, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_HoldingsRecord_holdingsAndCirc, - (Odr_fun)z_HoldingsAndCircData, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_OPACRecord(ODR o, Z_OPACRecord **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_External, &(*p)->bibliographicRecord, - ODR_CONTEXT, 1, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)z_HoldingsRecord, &(*p)->holdingsData, - &(*p)->num_holdingsData, 0) || odr_ok(o)) && - odr_sequence_end(o); -} diff --git a/asn/prt-arc.h b/asn/prt-arc.h deleted file mode 100644 index df159c7..0000000 --- a/asn/prt-arc.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 1995,1996 Index Data. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of Index Data or the individual authors may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR - * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - */ - -#ifndef PRT_ARC_H -#define PRT_ARC_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* ------------------- Summary Record --------------------- */ - -typedef struct Z_FormatSpec -{ - char *type; - int *size; /* OPTIONAL */ - int *bestPosn; /* OPTIONAL */ -} Z_FormatSpec; - -typedef struct Z_BriefBib -{ - char *title; - char *author; /* OPTIONAL */ - char *callNumber; /* OPTIONAL */ - char *recordType; /* OPTIONAL */ - char *bibliographicLevel; /* OPTIONAL */ - int num_format; - Z_FormatSpec **format; /* OPTIONAL */ - char *publicationPlace; /* OPTIONAL */ - char *publicationDate; /* OPTIONAL */ - char *targetSystemKey; /* OPTIONAL */ - char *satisfyingElement; /* OPTIONAL */ - int *rank; /* OPTIONAL */ - char *documentId; /* OPTIONAL */ - char *abstract; /* OPTIONAL */ - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_BriefBib; - -/* ------------------- OPAC Record --------------------- */ - -typedef struct Z_CircRecord -{ - bool_t *availableNow; - char *availabilityDate; /* OPTIONAL */ - char *availableThru; /* OPTIONAL */ - char *restrictions; /* OPTIONAL */ - char *itemId; /* OPTIONAL */ - bool_t *renewable; - bool_t *onHold; - char *enumAndChron; /* OPTIONAL */ - char *midspine; /* OPTIONAL */ - char *temporaryLocation; /* OPTIONAL */ -} Z_CircRecord; - -typedef struct Z_Volume -{ - char *enumeration; /* OPTIONAL */ - char *chronology; /* OPTIONAL */ - char *enumAndChron; /* OPTIONAL */ -} Z_Volume; - -typedef struct Z_HoldingsAndCircData -{ - char *typeOfRecord; /* OPTIONAL */ - char *encodingLevel; /* OPTIONAL */ - char *format; /* OPTIONAL */ - char *receiptAcqStatus; /* OPTIONAL */ - char *generalRetention; /* OPTIONAL */ - char *completeness; /* OPTIONAL */ - char *dateOfReport; /* OPTIONAL */ - char *nucCode; /* OPTIONAL */ - char *localLocation; /* OPTIONAL */ - char *shelvingLocation; /* OPTIONAL */ - char *callNumber; /* OPTIONAL */ - char *shelvingData; /* OPTIONAL */ - char *copyNumber; /* OPTIONAL */ - char *publicNote; /* OPTIONAL */ - char *reproductionNote; /* OPTIONAL */ - char *termsUseRepro; /* OPTIONAL */ - char *enumAndChron; /* OPTIONAL */ - int num_volumes; - Z_Volume **volumes; /* OPTIONAL */ - int num_circulationData; - Z_CircRecord **circulationData;/* OPTIONAL */ -} Z_HoldingsAndCircData; - -typedef struct Z_HoldingsRecord -{ - int which; -#define Z_HoldingsRecord_marcHoldingsRecord 0 -#define Z_HoldingsRecord_holdingsAndCirc 1 - union - { - Z_External *marcHoldingsRecord; - Z_HoldingsAndCircData *holdingsAndCirc; - } u; -} Z_HoldingsRecord; - -typedef struct Z_OPACRecord -{ - Z_External *bibliographicRecord; /* OPTIONAL */ - int num_holdingsData; - Z_HoldingsRecord **holdingsData; /* OPTIONAL */ -} Z_OPACRecord; - -YAZ_EXPORT int z_BriefBib(ODR o, Z_BriefBib **p, int opt, const char *name); -YAZ_EXPORT int z_OPACRecord(ODR o, Z_OPACRecord **p, int opt, - const char *name); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/asn/prt-dat.c b/asn/prt-dat.c deleted file mode 100644 index c396b99..0000000 --- a/asn/prt-dat.c +++ /dev/null @@ -1,190 +0,0 @@ -/* - * This file is part of the YAZ toolkit: - * Copyright (c) 1998-1999, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * Contribution by Ronald van Der Meer (RVDM): - * Databasix Information Systems B.V., Utrecht, The Netherlands. - * - * $Log: prt-dat.c,v $ - * Revision 1.4 1999-11-30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.3 1999/04/20 09:56:47 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.2 1998/02/11 11:53:32 adam - * Changed code so that it compiles as C++. - * - * Revision 1.1 1998/02/10 15:31:46 adam - * Implemented date and time structure. Changed the Update Extended - * Service. - * - */ - -#include - -int z_MonthAndDay(ODR o, Z_MonthAndDay **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->month, ODR_CONTEXT, 2, 0) && - odr_implicit(o, odr_integer, &(*p)->day, ODR_CONTEXT, 3, 1) && - odr_sequence_end(o); -} - -int z_Quarter(ODR o, Z_Quarter **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Quarter_first, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Quarter_second, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Quarter_third, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Quarter_fourth, - (Odr_fun)odr_null, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_Season(ODR o, Z_Season **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Season_winter, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Season_spring, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Season_summer, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Season_autumn, - (Odr_fun)odr_null, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_PartOfYear(ODR o, Z_PartOfYear **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_PartOfYear_monthAndDay, - (Odr_fun) z_MonthAndDay, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_PartOfYear_julianDay, - (Odr_fun) odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_PartOfYear_weekNumber, - (Odr_fun) odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_PartOfYear_quarter, - (Odr_fun) z_Quarter, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_PartOfYear_season, - (Odr_fun) z_Season, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_Era(ODR o, Z_Era **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Era_decade, (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Era_century, (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Era_millennium, (Odr_fun)odr_null, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_DateFlags(ODR o, Z_DateFlags **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_null, &(*p)->circa, ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_Era, &(*p)->era, ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); -} - -int z_Date(ODR o, Z_Date **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->year, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_PartOfYear, &(*p)->partOfYear, ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_DateFlags, &(*p)->flags, ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); -} - -int z_Zone(ODR o, Z_Zone **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Zone_local, (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Zone_utc, (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Zone_utcOffset, - (Odr_fun)odr_integer, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_Time(ODR o, Z_Time **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->hour, ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->minute, ODR_CONTEXT, 2, 1) && - odr_implicit(o, odr_integer, &(*p)->second, ODR_CONTEXT, 3, 1) && - odr_implicit(o, z_IntUnit, &(*p)->partOfSecond, ODR_CONTEXT, 4, 1) && - odr_implicit(o, z_Zone, &(*p)->zone, ODR_CONTEXT, 5, 1) && - odr_sequence_end(o); -} - -int z_DateTime(ODR o, Z_DateTime **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_Date, &(*p)->z3950Date, ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_Time, &(*p)->z3950Time, ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); -} - diff --git a/asn/prt-dat.h b/asn/prt-dat.h deleted file mode 100644 index 9e3d9b1..0000000 --- a/asn/prt-dat.h +++ /dev/null @@ -1,154 +0,0 @@ -/* - * This file is part of the YAZ toolkit: - * Copyright (c) 1998, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * Contribution by Ronald van Der Meer (RVDM): - * Databasix Information Systems B.V., Utrecht, The Netherlands. - * - * $Log: prt-dat.h,v $ - * Revision 1.1 2000-10-03 12:55:50 adam - * Removed several auto-generated files from CVS. - * - * Revision 1.1 1999/11/30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.2 1999/04/20 09:56:48 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.1 1998/02/10 15:31:52 adam - * Implemented date and time structure. Changed the Update Extended - * Service. - * - */ - -#ifndef __PRT_DAT_H -#define __PRT_DAT_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct Z_MonthAndDay -{ - int *month; - int *day; /* OPTIONAL */ -} Z_MonthAndDay; - -typedef struct Z_Quarter -{ - int which; -#define Z_Quarter_first 0 -#define Z_Quarter_second 1 -#define Z_Quarter_third 2 -#define Z_Quarter_fourth 3 - union - { - Odr_null *first; - Odr_null *second; - Odr_null *third; - Odr_null *fourth; - } u; -} Z_Quarter; - -typedef struct Z_Season -{ - int which; -#define Z_Season_winter 0 -#define Z_Season_spring 1 -#define Z_Season_summer 2 -#define Z_Season_autumn 3 - union - { - Odr_null *winter; - Odr_null *spring; - Odr_null *summer; - Odr_null *autumn; - } u; -} Z_Season; - -typedef struct Z_PartOfYear -{ - int which; -#define Z_PartOfYear_monthAndDay 0 -#define Z_PartOfYear_julianDay 1 -#define Z_PartOfYear_weekNumber 2 -#define Z_PartOfYear_quarter 3 -#define Z_PartOfYear_season 4 - union - { - Z_MonthAndDay *monthAndDay; - int *julianDay; - int *weekNumber; - Z_Quarter *quarter; - Z_Season *season; - } u; -} Z_PartOfYear; - -typedef struct Z_Era -{ - int which; -#define Z_Era_decade 0 -#define Z_Era_century 1 -#define Z_Era_millennium 2 - union - { - Odr_null *decade; - Odr_null *century; - Odr_null *millennium; - } u; -} Z_Era; - -typedef struct Z_DateFlags -{ - Odr_null *circa; /* OPTIONAL */ - Z_Era *era; /* OPTIONAL */ -} Z_DateFlags; - -typedef struct Z_Date -{ - int *year; - Z_PartOfYear *partOfYear; /* OPTIONAL */ - Z_DateFlags *flags; /* OPTIONAL */ -} Z_Date; - -typedef struct Z_Zone -{ - int which; -#define Z_Zone_local 0 -#define Z_Zone_utc 1 -#define Z_Zone_utcOffset 2 - union - { - Odr_null *local; - Odr_null *utc; - int *utcOffset; - } u; -} Z_Zone; - -typedef struct Z_Time -{ - int *hour; - int *minute; /* OPTIONAL */ - int *second; /* OPTIONAL */ - Z_IntUnit *partOfSecond; /* OPTIONAL */ - Z_Zone *zone; /* OPTIONAL */ -} Z_Time; - -typedef struct Z_DateTime -{ - Z_Date *z3950Date; /* OPTIONAL */ - Z_Time *z3950Time; /* OPTIONAL */ -} Z_DateTime; - -YAZ_EXPORT int z_DateTime(ODR o, Z_DateTime **p, int opt, const char *name); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/asn/prt-dia.c b/asn/prt-dia.c deleted file mode 100644 index e8de2c9..0000000 --- a/asn/prt-dia.c +++ /dev/null @@ -1,420 +0,0 @@ -/* - * Copyright (c) 1995-1999, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: prt-dia.c,v $ - * Revision 1.7 1999-11-30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.6 1999/04/20 09:56:47 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.5 1998/02/11 11:53:32 adam - * Changed code so that it compiles as C++. - * - * Revision 1.4 1996/01/22 09:46:34 quinn - * Added Sort PDU. Moved StringList to main protocol file. - * - * Revision 1.3 1995/09/29 17:11:54 quinn - * Smallish - * - * Revision 1.2 1995/09/27 15:02:41 quinn - * Modified function heads & prototypes. - * - * Revision 1.1 1995/08/29 11:19:31 quinn - * Added Diagnostic Format - * - * - */ - -#include - -int z_TooMany(ODR o, Z_TooMany **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->tooManyWhat, ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->max, ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); -} - -int z_BadSpec(ODR o, Z_BadSpec **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_Specification, &(*p)->spec, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_DatabaseName, &(*p)->db, ODR_CONTEXT, 2, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, (Odr_fun)z_Specification, &(*p)->goodOnes, - &(*p)->num_goodOnes, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_DbUnavailWhy(ODR o, Z_DbUnavailWhy **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->reasonCode, ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_InternationalString, &(*p)->message, ODR_CONTEXT, - 2, 1) && - odr_sequence_end(o); -} - -int z_DbUnavail(ODR o, Z_DbUnavail **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_DatabaseName, &(*p)->db, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_DbUnavailWhy, &(*p)->why, ODR_CONTEXT, 2, 0) && - odr_sequence_end(o); -} - -int z_Attribute(ODR o, Z_Attribute **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_oid, &(*p)->id, ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->type, ODR_CONTEXT, 2, 1) && - odr_implicit(o, odr_integer, &(*p)->value, ODR_CONTEXT, 3, 1) && - odr_explicit(o, z_Term, &(*p)->term, ODR_CONTEXT, 4, 1) && - odr_sequence_end(o); -} - -int z_AttCombo(ODR o, Z_AttCombo **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_AttributeList, &(*p)->unsupportedCombination, - ODR_CONTEXT, 1, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)z_AttributeList, &(*p)->alternatives, - &(*p)->num_alternatives, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_DiagTerm(ODR o, Z_DiagTerm **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->problem, ODR_CONTEXT, 1, 1) && - odr_explicit(o, z_Term, &(*p)->term, ODR_CONTEXT, 2, 0) && - odr_sequence_end(o); -} - -int z_Proximity(ODR o, Z_Proximity **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Proximity_resultSets, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Proximity_badSet, - (Odr_fun)z_InternationalString, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Proximity_relation, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Proximity_unit, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_Proximity_distance, - (Odr_fun)odr_integer, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 6, Z_Proximity_attributes, - (Odr_fun)z_AttributeList, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_Proximity_ordered, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 8, Z_Proximity_exclusion, - (Odr_fun)odr_null, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_Proximity *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_AttrListList(ODR o, Z_AttrListList **p, int opt, const char *name) -{ - if (o->direction == ODR_DECODE) - *p = (Z_AttrListList *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_sequence_of(o, (Odr_fun)z_AttributeList, &(*p)->lists, - &(*p)->num_lists, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_Scan(ODR o, Z_Scan **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ScanD_nonZeroStepSize, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ScanD_specifiedStepSize, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ScanD_termList1, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_ScanD_termList2, - (Odr_fun)z_AttrListList, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_ScanD_posInResponse, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_ScanD_resources, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_ScanD_endOfList, - (Odr_fun)odr_null, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_Scan *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_Sort(ODR o, Z_Sort **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortD_sequence, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortD_noRsName, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortD_tooMany, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_SortD_incompatible, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_SortD_generic, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_SortD_dbSpecific, - (Odr_fun)odr_null, 0}, -#if 0 - {ODR_EXPLICIT, ODR_CONTEXT, 6, Z_SortD_sortElement, - (Odr_fun)z_SortElement, 0}, -#endif - {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_SortD_key, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 8, Z_SortD_action, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 9, Z_SortD_illegal, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 10, Z_SortD_inputTooLarge, - (Odr_fun)z_StringList, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 11, Z_SortD_aggregateTooLarge, - (Odr_fun)odr_null, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_Sort *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_Segmentation(ODR o, Z_Segmentation **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SegmentationD_segments, - (Odr_fun)odr_null, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_Segmentation *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_ExtServices(ODR o, Z_ExtServices **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ExtServicesD_req, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ExtServicesD_permission, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ExtServicesD_immediate, - (Odr_fun)odr_integer, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_ExtServices *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_OidList(ODR o, Z_OidList **p, int opt, const char *name) -{ - if (o->direction == ODR_DECODE) - *p = (Z_OidList *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->oids, &(*p)->num_oids, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_AccessCtrl(ODR o, Z_AccessCtrl **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_AccessCtrlD_noUser, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_AccessCtrlD_refused, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_AccessCtrlD_simple, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_AccessCtrlD_oid, - (Odr_fun)z_OidList, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_AccessCtrlD_alternative, - (Odr_fun)z_OidList, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_AccessCtrlD_pwdInv, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_AccessCtrlD_pwdExp, - (Odr_fun)odr_null, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_AccessCtrl *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_RecordSyntax(ODR o, Z_RecordSyntax **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_oid, &(*p)->unsupportedSyntax, - ODR_CONTEXT, 1, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->suggestedAlternatives, - &(*p)->num_suggestedAlternatives, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_DiagFormat(ODR o, Z_DiagFormat **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1000, Z_DiagFormat_tooMany, - (Odr_fun)z_TooMany, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1001, Z_DiagFormat_badSpec, - (Odr_fun)z_BadSpec, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1002, Z_DiagFormat_dbUnavail, - (Odr_fun)z_DbUnavail, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1003, Z_DiagFormat_unSupOp, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1004, Z_DiagFormat_attribute, - (Odr_fun)z_Attribute, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1005, Z_DiagFormat_attCombo, - (Odr_fun)z_AttCombo, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1006, Z_DiagFormat_term, - (Odr_fun)z_DiagTerm, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 1007, Z_DiagFormat_proximity, - (Odr_fun)z_Proximity, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 1008, Z_DiagFormat_scan, - (Odr_fun)z_Scan, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 1009, Z_DiagFormat_sort, - (Odr_fun)z_Sort, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 1010, Z_DiagFormat_segmentation, - (Odr_fun)z_Segmentation, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 1011, Z_DiagFormat_extServices, - (Odr_fun)z_ExtServices, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 1012, Z_DiagFormat_accessCtrl, - (Odr_fun)z_AccessCtrl, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1013, Z_DiagFormat_recordSyntax, - (Odr_fun)z_RecordSyntax, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_DiagFormat *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_Diagnostic(ODR o, Z_Diagnostic **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Diagnostic_defaultDiagRec, - (Odr_fun)z_DefaultDiagFormat, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Diagnostic_explicitDiagnostic, - (Odr_fun)z_DiagFormat, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_Diagnostic *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_DiagnosticUnit(ODR o, Z_DiagnosticUnit **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_explicit(o, z_Diagnostic, &(*p)->diagnostic, ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_InternationalString, &(*p)->message, - ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); -} - -int z_DiagnosticFormat(ODR o, Z_DiagnosticFormat **p, int opt, - const char *name) -{ - if (o->direction == ODR_DECODE) - *p = (Z_DiagnosticFormat *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_sequence_of(o, (Odr_fun)z_DiagnosticUnit, &(*p)->diagnostics, - &(*p)->num_diagnostics, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} diff --git a/asn/prt-dia.h b/asn/prt-dia.h deleted file mode 100644 index 88dc8a0..0000000 --- a/asn/prt-dia.h +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Copyright (c) 1995-1998, Index Data. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of Index Data or the individual authors may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR - * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - */ - -#ifndef PRT_DIA_H -#define PRT_DIA_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct Z_TooMany -{ - int *tooManyWhat; -#define Z_TooMany_argumentWords 1 -#define Z_TooMany_truncatedWords 2 -#define Z_TooMany_booleanOperators 3 -#define Z_TooMany_incompleteSubfields 4 -#define Z_TooMany_characters 5 -#define Z_TooMany_recordsRetrieved 6 -#define Z_TooMany_databasesSpecified 7 -#define Z_TooMany_resultSetsCreated 8 -#define Z_TooMany_indexTermsProcessed 9 - int *max; /* OPTIONAL */ -} Z_TooMany; - -typedef struct Z_BadSpec -{ - Z_Specification *spec; - char *db; /* OPTIONAL */ - int num_goodOnes; - Z_Specification **goodOnes; /* OPTIONAL */ -} Z_BadSpec; - -typedef struct Z_DbUnavailWhy -{ - int *reasonCode; /* OPTIONAL */ -#define Z_DbUnavail_doesNotExist 0 -#define Z_DbUnavail_existsButUnavail 1 -#define Z_DbUnavail_locked 2 -#define Z_DbUnavail_accessDenied 3 - char *message; /* OPTIONAL */ -} Z_DbUnavailWhy; - -typedef struct Z_DbUnavail -{ - char *db; - Z_DbUnavailWhy *why; /* OPTIONAL */ -} Z_DbUnavail; - -typedef struct Z_Attribute -{ - Odr_oid *id; - int *type; /* OPTIONAL */ - int *value; /* OPTIONAL */ - Z_Term *term; /* OPTIONAL */ -} Z_Attribute; - -typedef struct Z_AttCombo -{ - Z_AttributeList *unsupportedCombination; - int num_alternatives; - Z_AttributeList **alternatives; /* OPTIONAL */ -} Z_AttCombo; - -typedef struct Z_DiagTerm -{ - int *problem; /* OPTIONAL */ -#define Z_DiagtermProb_codedValue 1 -#define Z_DiagtermProb_unparsable 2 -#define Z_DiagtermProb_tooShort 3 -#define Z_DiagtermProb_type 4 - Z_Term *term; -} Z_DiagTerm; - -typedef struct Z_Proximity -{ - int which; -#define Z_Proximity_resultSets 0 -#define Z_Proximity_badSet 1 -#define Z_Proximity_relation 2 -#define Z_Proximity_unit 3 -#define Z_Proximity_distance 4 -#define Z_Proximity_attributes 5 -#define Z_Proximity_ordered 6 -#define Z_Proximity_exclusion 7 - union - { - Odr_null *resultSets; - char *badSet; - int *relation; - int *unit; - int *distance; - Z_AttributeList *attributes; - Odr_null *ordered; - Odr_null *exclusion; - } u; -} Z_Proximity; - -typedef struct Z_AttrListList -{ - int num_lists; - Z_AttributeList *lists; -} Z_AttrListList; - -typedef struct Z_Scan -{ - int which; -#define Z_ScanD_nonZeroStepSize 0 -#define Z_ScanD_specifiedStepSize 1 -#define Z_ScanD_termList1 2 -#define Z_ScanD_termList2 3 -#define Z_ScanD_posInResponse 4 -#define Z_ScanD_resources 5 -#define Z_ScanD_endOfList 6 - union - { - Odr_null *nonZeroStepSize; - Odr_null *specifiedStepSize; - Odr_null *termList1; - Z_AttrListList *termList2; - int *posInResponse; -#define Z_ScanPosInRsp_mustBeOne 1 -#define Z_ScanPosInRsp_mustBePositive 2 -#define Z_ScanPosInRsp_mustBeNonNegative 3 -#define Z_ScanPosInRsp_other 4 - Odr_null *resources; - Odr_null *endOfList; - } u; -} Z_Scan; - -typedef struct Z_Sort -{ - int which; -#define Z_SortD_sequence 0 -#define Z_SortD_noRsName 1 -#define Z_SortD_tooMany 2 -#define Z_SortD_incompatible 3 -#define Z_SortD_generic 4 -#define Z_SortD_dbSpecific 5 -#define Z_SortD_sortElement 6 -#define Z_SortD_key 7 -#define Z_SortD_action 8 -#define Z_SortD_illegal 9 -#define Z_SortD_inputTooLarge 10 -#define Z_SortD_aggregateTooLarge 11 - union - { - Odr_null *sequence; - Odr_null *noRsName; - int *tooMany; - Odr_null *incompatible; - Odr_null *generic; - Odr_null *dbSpecific; - int *key; -#define Z_SortKey_tooMany 1 -#define Z_SortKey_duplicate 2 - Odr_null *action; - int *illegal; -#define Z_SortIllegal_relation 1 -#define Z_SortIllegal_case 2 -#define Z_SortIllegal_action 3 -#define Z_SortIllegal_sort 4 - Z_StringList *inputTooLarge; - Odr_null *aggregateTooLarge; - } u; -} Z_Sort; - -typedef struct Z_Segmentation -{ - int which; -#define Z_SegmentationD_segments 0 - union - { - Odr_null *segments; - } u; -} Z_Segmentation; - -typedef struct Z_ExtServices -{ - int which; -#define Z_ExtServicesD_req 0 -#define Z_ExtServicesD_permission 1 -#define Z_ExtServicesD_immediate 2 - union - { - int *req; -#define Z_ExtSrvReq_nameInUse 1 -#define Z_ExtSrvReq_noSuchname 2 -#define Z_ExtSrvReq_quota 3 -#define Z_ExtSrvReq_type 4 - int *permission; -#define Z_ExtSrvPerm_id 1 -#define Z_ExtSrvPerm_modifyDelete 2 - int *immediate; -#define Z_ExtSrvImm_failed 1 -#define Z_ExtSrvImm_service 2 -#define Z_ExtSrvImm_parameters 3 - } u; -} Z_ExtServices; - -typedef struct Z_OidList -{ - int num_oids; - Odr_oid **oids; -} Z_OidList; - -typedef struct Z_AccessCtrl -{ - int which; -#define Z_AccessCtrlD_noUser 0 -#define Z_AccessCtrlD_refused 1 -#define Z_AccessCtrlD_simple 2 -#define Z_AccessCtrlD_oid 3 -#define Z_AccessCtrlD_alternative 4 -#define Z_AccessCtrlD_pwdInv 5 -#define Z_AccessCtrlD_pwdExp 6 - union - { - Odr_null *noUser; - Odr_null *refused; - Odr_null *simple; - Z_OidList *oid; - Z_OidList *alternative; - Odr_null *pwdInv; - Odr_null *pwdExp; - } u; -} Z_AccessCtrl; - -typedef struct Z_RecordSyntax -{ - Odr_oid *unsupportedSyntax; - int num_suggestedAlternatives; /* OPTIONAL */ - Odr_oid **suggestedAlternatives; /* OPTIONAL */ -} Z_RecordSyntax; - -typedef struct Z_DiagFormat -{ - int which; -#define Z_DiagFormat_tooMany 0 -#define Z_DiagFormat_badSpec 1 -#define Z_DiagFormat_dbUnavail 2 -#define Z_DiagFormat_unSupOp 3 -#define Z_DiagFormat_attribute 4 -#define Z_DiagFormat_attCombo 5 -#define Z_DiagFormat_term 6 -#define Z_DiagFormat_proximity 7 -#define Z_DiagFormat_scan 8 -#define Z_DiagFormat_sort 9 -#define Z_DiagFormat_segmentation 10 -#define Z_DiagFormat_extServices 11 -#define Z_DiagFormat_accessCtrl 12 -#define Z_DiagFormat_recordSyntax 13 - union - { - Z_TooMany *tooMany; - Z_BadSpec *badSpec; - Z_DbUnavail *dbUnavail; - int *unSupOp; -#define Z_UnSupOp_and 0 -#define Z_UnSupOp_or 1 -#define Z_UnSupOp_and_not 2 -#define Z_UnSupOp_prox 3 - Z_Attribute *attribute; - Z_AttributeList *attCombo; - Z_DiagTerm *term; - Z_Proximity *proximity; - Z_Scan *scan; - Z_Sort *sort; - Z_Segmentation *segmentation; - Z_ExtServices *extServices; - Z_AccessCtrl *accessCtrl; - Z_RecordSyntax *recordSyntax; - } u; -} Z_DiagFormat; - -typedef struct Z_Diagnostic -{ - int which; -#define Z_Diagnostic_defaultDiagRec 0 -#define Z_Diagnostic_explicitDiagnostic 1 - union - { - Z_DefaultDiagFormat *defaultDiagRec; - Z_DiagFormat *explicitDiagnostic; - } u; -} Z_Diagnostic; - -typedef struct Z_DiagnosticUnit -{ - Z_Diagnostic *diagnostic; /* OPTIONAL */ - char *message; /* OPTIONAL */ -} Z_DiagnosticUnit; - -typedef struct Z_DiagnosticFormat -{ - int num_diagnostics; - Z_DiagnosticUnit **diagnostics; -} Z_DiagnosticFormat; - -YAZ_EXPORT int z_DiagnosticFormat(ODR o, Z_DiagnosticFormat **p, int opt, - const char *name); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/asn/prt-esp.c b/asn/prt-esp.c deleted file mode 100644 index f731a80..0000000 --- a/asn/prt-esp.c +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (c) 1995-1999, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: prt-esp.c,v $ - * Revision 1.5 1999-11-30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.4 1999/04/20 09:56:47 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.3 1998/02/11 11:53:32 adam - * Changed code so that it compiles as C++. - * - * Revision 1.2 1998/02/10 15:31:46 adam - * Implemented date and time structure. Changed the Update Extended - * Service. - * - * Revision 1.1 1995/10/12 10:34:37 quinn - * Added Espec-1. - * - * - */ - -#include - -int z_OccurValues(ODR o, Z_OccurValues **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->start, ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->howMany, ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); -} - -int z_Occurrences(ODR o, Z_Occurrences **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Occurrences_all, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Occurrences_last, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Occurrences_values, - (Odr_fun)z_OccurValues, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_Occurrences *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_SpecificTag(ODR o, Z_SpecificTag **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_oid, &(*p)->schemaId, ODR_CONTEXT, 0, 1) && - odr_implicit(o, odr_integer, &(*p)->tagType, ODR_CONTEXT, 1, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->tagValue, ODR_CONTEXT, - 2, 0) && - odr_explicit(o, z_Occurrences, &(*p)->occurrences, - ODR_CONTEXT, 3, 1) && - odr_sequence_end(o); -} - -int z_ETagUnit(ODR o, Z_ETagUnit **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ETagUnit_specificTag, - (Odr_fun)z_SpecificTag, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_ETagUnit_wildThing, - (Odr_fun)z_Occurrences, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ETagUnit_wildPath, - (Odr_fun)odr_null, 0}, - {-1, -1, -1 -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_ETagUnit *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_ETagPath(ODR o, Z_ETagPath **p, int opt, const char *name) -{ - if (o->direction == ODR_DECODE) - *p = (Z_ETagPath *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_sequence_of(o, (Odr_fun)z_ETagUnit, &(*p)->tags, - &(*p)->num_tags, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_SimpleElement(ODR o, Z_SimpleElement **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_ETagPath, &(*p)->path, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_Variant, &(*p)->variantRequest, - ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); -} - -int z_CompoPrimitives(ODR o, Z_CompoPrimitives **p, int opt, const char *name) -{ - if (o->direction == ODR_DECODE) - *p = (Z_CompoPrimitives *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_sequence_of(o, z_InternationalString, &(*p)->primitives, - &(*p)->num_primitives, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_CompoSpecs(ODR o, Z_CompoSpecs **p, int opt, const char *name) -{ - if (o->direction == ODR_DECODE) - *p = (Z_CompoSpecs *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_sequence_of(o, (Odr_fun)z_SimpleElement, &(*p)->specs, - &(*p)->num_specs, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_CompositeElement(ODR o, Z_CompositeElement **p, int opt, - const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_CompoElement_primitives, - (Odr_fun)z_CompoPrimitives, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_CompoElement_specs, - (Odr_fun)z_CompoSpecs, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_constructed_begin(o, &(*p)->elementList, ODR_CONTEXT, 1, 0) && - odr_choice(o, arm, &(*p)->elementList, &(*p)->which, 0) && - odr_constructed_end(o) && - odr_implicit(o, z_ETagPath, &(*p)->deliveryTag, ODR_CONTEXT, 2, 0) && - odr_implicit(o, z_Variant, &(*p)->variantRequest, ODR_CONTEXT, 3, 1) && - odr_sequence_end(o); -} - -int z_ElementRequest(ODR o, Z_ElementRequest **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ERequest_simpleElement, - (Odr_fun)z_SimpleElement, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ERequest_compositeElement, - (Odr_fun)z_CompositeElement, 0}, - {-1, -1, -1 -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_ElementRequest *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_Espec1(ODR o, Z_Espec1 **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit_settag(o, ODR_CONTEXT, 1) && - (odr_sequence_of(o, z_InternationalString, &(*p)->elementSetNames, - &(*p)->num_elementSetNames, 0) || odr_ok(o)) && - odr_implicit(o, odr_oid, &(*p)->defaultVariantSetId, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_Variant, &(*p)->defaultVariantRequest, - ODR_CONTEXT, 3, 1) && - odr_implicit(o, odr_integer, &(*p)->defaultTagType, - ODR_CONTEXT, 4, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 5) && - (odr_sequence_of(o, (Odr_fun)z_ElementRequest, &(*p)->elements, - &(*p)->num_elements, 0) || odr_ok(o)) && - odr_sequence_end(o); -} diff --git a/asn/prt-esp.h b/asn/prt-esp.h deleted file mode 100644 index 86bf403..0000000 --- a/asn/prt-esp.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 1995, Index Data. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of Index Data or the individual authors may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR - * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - */ - -#ifndef PRT_ESP_H -#define PRT_ESP_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct Z_OccurValues -{ - int *start; - int *howMany; /* OPTIONAL */ -} Z_OccurValues; - -typedef struct Z_Occurrences -{ - int which; -#define Z_Occurrences_all 0 -#define Z_Occurrences_last 1 -#define Z_Occurrences_values 2 - union - { - Odr_null *all; - Odr_null *last; - Z_OccurValues *values; - } u; -} Z_Occurrences; - -typedef struct Z_SpecificTag -{ - Odr_oid *schemaId; /* OPTIONAL */ - int *tagType; /* OPTIONAL */ - Z_StringOrNumeric *tagValue; - Z_Occurrences *occurrences; /* OPTIONAL */ -} Z_SpecificTag; - -typedef struct Z_ETagUnit -{ - int which; -#define Z_ETagUnit_specificTag 0 -#define Z_ETagUnit_wildThing 1 -#define Z_ETagUnit_wildPath 2 - union - { - Z_SpecificTag *specificTag; - Z_Occurrences *wildThing; - Odr_null *wildPath; - } u; -} Z_ETagUnit; - -typedef struct Z_ETagPath -{ - int num_tags; - Z_ETagUnit **tags; -} Z_ETagPath; - -typedef struct Z_SimpleElement -{ - Z_ETagPath *path; - Z_Variant *variantRequest; /* OPTIONAL */ -} Z_SimpleElement; - -typedef struct Z_CompoPrimitives -{ - int num_primitives; - char **primitives; -} Z_CompoPrimitives; - -typedef struct Z_CompoSpecs -{ - int num_specs; - Z_SimpleElement **specs; -} Z_CompoSpecs; - -typedef struct Z_CompositeElement -{ - int which; -#define Z_CompoElement_primitives 0 -#define Z_CompoElement_specs 1 - union - { - Z_CompoPrimitives *primitives; - Z_CompoSpecs *specs; - } elementList; - Z_ETagPath *deliveryTag; - Z_Variant *variantRequest; -} Z_CompositeElement; - -typedef struct Z_ElementRequest -{ - int which; -#define Z_ERequest_simpleElement 0 -#define Z_ERequest_compositeElement 1 - union - { - Z_SimpleElement *simpleElement; - Z_CompositeElement *compositeElement; - } u; -} Z_ElementRequest; - -typedef struct Z_Espec1 -{ - int num_elementSetNames; - char **elementSetNames; /* OPTIONAL */ - Odr_oid *defaultVariantSetId; /* OPTIONAL */ - Z_Variant *defaultVariantRequest; /* OPTIONAL */ - int *defaultTagType; /* OPTIONAL */ - int num_elements; - Z_ElementRequest **elements; /* OPTIONAL */ -} Z_Espec1; - -YAZ_EXPORT int z_Espec1(ODR o, Z_Espec1 **p, int opt, const char *name); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/asn/prt-exd.c b/asn/prt-exd.c deleted file mode 100644 index 05de183..0000000 --- a/asn/prt-exd.c +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Copyright (c) 1995-1999, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: prt-exd.c,v $ - * Revision 1.11 1999-11-30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.10 1999/05/26 13:49:12 adam - * DB Update implemented in client (very basic). - * - * Revision 1.9 1999/04/20 09:56:48 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.8 1998/02/11 11:53:32 adam - * Changed code so that it compiles as C++. - * - * Revision 1.7 1998/02/10 15:31:46 adam - * Implemented date and time structure. Changed the Update Extended - * Service. - * - * Revision 1.6 1998/01/05 09:04:57 adam - * Fixed bugs in encoders/decoders - Not operator (!) missing. - * - * Revision 1.5 1997/04/30 08:52:02 quinn - * Null - * - * Revision 1.4 1996/10/10 12:35:12 quinn - * Added Update extended service. - * - * Revision 1.3 1995/09/29 17:11:54 quinn - * Smallish - * - * Revision 1.2 1995/09/27 15:02:41 quinn - * Modified function heads & prototypes. - * - * Revision 1.1 1995/08/21 09:16:32 quinn - * Added Extended services + Item Order - * - * - */ - -#include - -int z_TaskPackage(ODR o, Z_TaskPackage **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_oid, &(*p)->packageType, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->packageName, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_InternationalString, &(*p)->userId, - ODR_CONTEXT, 3, 1) && - odr_implicit(o, z_IntUnit, &(*p)->retentionTime, ODR_CONTEXT, 4, 1) && - odr_implicit(o, z_Permissions, &(*p)->permissions, - ODR_CONTEXT, 5, 1) && - odr_implicit(o, z_InternationalString, &(*p)->description, - ODR_CONTEXT, 6, 1) && - odr_implicit(o, odr_octetstring, &(*p)->targetReference, - ODR_CONTEXT, 7, 0) && - odr_implicit(o, odr_generalizedtime, &(*p)->creationDateTime, - ODR_CONTEXT, 8, 1) && - odr_implicit(o, odr_integer, &(*p)->taskStatus, - ODR_CONTEXT, 9, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 10) && - (odr_sequence_of(o, (Odr_fun)z_DiagRec, &(*p)->packageDiagnostics, - &(*p)->num_packageDiagnostics, 0) || odr_ok(o)) && - odr_implicit(o, z_External, &(*p)->taskSpecificParameters, - ODR_CONTEXT, 11, 0) && - odr_sequence_end(o); -} - -/* ----------------------- ITEM ORDER --------------------- */ - -int z_IOTargetPart(ODR o, Z_IOTargetPart **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_External, &(*p)->itemRequest, ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_External, &(*p)->statusOrErrorReport, ODR_CONTEXT, - 2, 0) && - odr_implicit(o, odr_integer, &(*p)->auxiliaryStatus, ODR_CONTEXT, - 3, 1) && - odr_sequence_end(o); -} - -int z_IOResultSetItem(ODR o, Z_IOResultSetItem **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->resultSetId, ODR_CONTEXT, - 1, 0) && - odr_implicit(o, odr_integer, &(*p)->item, ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); -} - -int z_IOOriginPartNotToKeep(ODR o, Z_IOOriginPartNotToKeep **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_IOResultSetItem, &(*p)->resultSetItem, ODR_CONTEXT, - 1, 0) && - odr_implicit(o, z_External, &(*p)->itemRequest, ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); -} - -int z_IOContact(ODR o, Z_IOContact **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, - 1, 1) && - odr_implicit(o, z_InternationalString, &(*p)->phone, ODR_CONTEXT, - 2, 1) && - odr_implicit(o, z_InternationalString, &(*p)->email, ODR_CONTEXT, - 3, 1) && - odr_sequence_end(o); -} - -int z_IOCreditCardInfo(ODR o, Z_IOCreditCardInfo **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->nameOnCard, ODR_CONTEXT, - 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->expirationDate, - ODR_CONTEXT, 2, 0) && - odr_implicit(o, z_InternationalString, &(*p)->cardNumber, ODR_CONTEXT, - 3, 0) && - odr_sequence_end(o); -} - -int z_IOBilling(ODR o, Z_IOBilling **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_IOBilling_billInvoice, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IOBilling_prepay, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IOBilling_depositAccount, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IOBilling_creditCard, - (Odr_fun)z_IOCreditCardInfo, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_IOBilling_cardInfoPreviouslySupplied, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_IOBilling_privateKnown, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_IOBilling_privateNotKnown, - (Odr_fun)z_External, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_constructed_begin(o, &(*p)->paymentMethod, - ODR_CONTEXT, 1, 0) && - odr_choice(o, arm, &(*p)->paymentMethod, &(*p)->which, 0) && - odr_constructed_end(o) && - odr_implicit(o, z_InternationalString, &(*p)->customerReference, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_InternationalString, &(*p)->customerPONumber, - ODR_CONTEXT, 3, 1) && - odr_sequence_end(o); -} - -int z_IOOriginPartToKeep(ODR o, Z_IOOriginPartToKeep **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_External, &(*p)->supplDescription, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_IOContact, &(*p)->contact, ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_IOBilling, &(*p)->addlBilling, - ODR_CONTEXT, 3, 1) && - odr_sequence_end(o); -} - -int z_IORequest(ODR o, Z_IORequest **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_IOOriginPartToKeep, &(*p)->toKeep, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_IOOriginPartNotToKeep, &(*p)->notToKeep, - ODR_CONTEXT, 2, 0) && - odr_sequence_end(o); -} - -int z_IOTaskPackage(ODR o, Z_IOTaskPackage **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_IOOriginPartToKeep, &(*p)->originPart, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_IOTargetPart, &(*p)->targetPart, - ODR_CONTEXT, 2, 0) && - odr_sequence_end(o); -} - -int z_ItemOrder(ODR o, Z_ItemOrder **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ItemOrder_esRequest, - (Odr_fun)z_IORequest, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ItemOrder_taskPackage, - (Odr_fun)z_IOTaskPackage, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_ItemOrder *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -/* ----------------------- ITEM UPDATE -------------------- */ - -int z_IUSuppliedRecordsId (ODR o, Z_IUSuppliedRecordsId **p, int opt, - const char *name) -{ - static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUSuppliedRecordsId_timeStamp, - odr_generalizedtime, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IUSuppliedRecordsId_versionNumber, - z_InternationalString, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IUSuppliedRecordsId_previousVersion, - (Odr_fun)odr_external, 0}, - {-1, -1, -1, -1, 0, 0} - }; - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_IUCorrelationInfo (ODR o, Z_IUCorrelationInfo **p, int opt, - const char *name) -{ - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - odr_implicit (o, z_InternationalString, - &(*p)->note, ODR_CONTEXT, 1, 1) && - odr_implicit (o, odr_integer, - &(*p)->id, ODR_CONTEXT, 2, 1) && - odr_sequence_end (o); -} - -int z_IUSuppliedRecords_elem (ODR o, Z_IUSuppliedRecords_elem **p, int opt, - const char *name) -{ - static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUSuppliedRecords_number, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IUSuppliedRecords_string, - (Odr_fun)z_InternationalString, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IUSuppliedRecords_opaque, - (Odr_fun)odr_octetstring, 0}, - {-1, -1, -1, -1, 0, 0} - }; - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, 0) && - odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && - odr_constructed_end (o)) || odr_ok(o)) && - odr_explicit (o, z_IUSuppliedRecordsId, - &(*p)->supplementalId, ODR_CONTEXT, 2, 1) && - odr_implicit (o, z_IUCorrelationInfo, - &(*p)->correlationInfo, ODR_CONTEXT, 3, 1) && - odr_implicit (o, z_External, - &(*p)->record, ODR_CONTEXT, 4, 0) && - odr_sequence_end (o); -} - -int z_IUSuppliedRecords (ODR o, Z_IUSuppliedRecords **p, int opt, - const char *name) -{ - if (!odr_initmember (o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of (o, (Odr_fun)z_IUSuppliedRecords_elem, &(*p)->elements, - &(*p)->num, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_IUTaskPackageRecordStructure (ODR o, Z_IUTaskPackageRecordStructure **p, - int opt, const char *name) -{ - static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUTaskPackageRecordStructure_record, - (Odr_fun)odr_external, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 2, - Z_IUTaskPackageRecordStructure_surrogateDiagnostics, - (Odr_fun)z_DiagRecs, 0}, - {-1, -1, -1, -1, 0, 0} - }; - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1, 0) && - odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && - odr_constructed_end (o)) || odr_ok(o)) && - odr_implicit (o, z_IUCorrelationInfo, - &(*p)->correlationInfo, ODR_CONTEXT, 2, 1) && - odr_implicit (o, odr_integer, - &(*p)->recordStatus, ODR_CONTEXT, 3, 0) && - odr_implicit (o, z_DiagRecs, - &(*p)->supplementalDiagnostics, ODR_CONTEXT, 4, 1) && - odr_sequence_end (o); -} - -int z_IUOriginPartToKeep (ODR o, Z_IUOriginPartToKeep **p, int opt, - const char *name) -{ - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - odr_implicit (o, odr_integer, - &(*p)->action, ODR_CONTEXT, 1, 0) && - odr_implicit (o, z_InternationalString, - &(*p)->databaseName, ODR_CONTEXT, 2, 0) && - odr_implicit (o, odr_oid, - &(*p)->schema, ODR_CONTEXT, 3, 1) && - odr_implicit (o, z_InternationalString, - &(*p)->elementSetName, ODR_CONTEXT, 4, 1) && - odr_implicit (o, odr_external, - &(*p)->actionQualifier, ODR_CONTEXT, 5, 1) && - odr_sequence_end (o); -} - -int z_IUTargetPart (ODR o, Z_IUTargetPart **p, int opt, const char *name) -{ - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - odr_implicit (o, odr_integer, - &(*p)->updateStatus, ODR_CONTEXT, 1, 0) && - odr_implicit_settag (o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)z_DiagRec, &(*p)->globalDiagnostics, - &(*p)->num_globalDiagnostics, 0) || odr_ok(o)) && - odr_implicit_settag (o, ODR_CONTEXT, 3) && - odr_sequence_of(o, (Odr_fun)z_IUTaskPackageRecordStructure, - &(*p)->taskPackageRecords, - &(*p)->num_taskPackageRecords, 0) && - odr_sequence_end (o); -} - -int z_IUUpdateEsRequest (ODR o, Z_IUUpdateEsRequest **p, int opt, - const char *name) -{ - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - odr_explicit (o, z_IUOriginPartToKeep, - &(*p)->toKeep, ODR_CONTEXT, 1, 0) && - odr_explicit (o, z_IUSuppliedRecords, - &(*p)->notToKeep, ODR_CONTEXT, 2, 0) && - odr_sequence_end (o); -} - -int z_IUUpdateTaskPackage (ODR o, Z_IUUpdateTaskPackage **p, int opt, - const char *name) -{ - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - odr_explicit (o, z_IUOriginPartToKeep, - &(*p)->originPart, ODR_CONTEXT, 1, 0) && - odr_explicit (o, z_IUTargetPart, - &(*p)->targetPart, ODR_CONTEXT, 2, 0) && - odr_sequence_end (o); -} - -int z_IUUpdate (ODR o, Z_IUUpdate **p, int opt, const char *name) -{ - static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUUpdate_esRequest, - (Odr_fun)z_IUUpdateEsRequest, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IUUpdate_taskPackage, - (Odr_fun)z_IUUpdateTaskPackage, 0}, - {-1, -1, -1, -1, 0, 0} - }; - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} diff --git a/asn/prt-exd.h b/asn/prt-exd.h deleted file mode 100644 index d5b1a2a..0000000 --- a/asn/prt-exd.h +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (c) 1995-1998, Index Data. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of Index Data or the individual authors may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR - * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - */ - -#ifndef PRT_EXD_H -#define PRT_EXD_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct Z_TaskPackage -{ - Odr_oid *packageType; - char *packageName; /* OPTIONAL */ - char *userId; /* OPTIONAL */ - Z_IntUnit *retentionTime; /* OPTIONAL */ - Z_Permissions *permissions; /* OPTIONAL */ - char *description; /* OPTIONAL */ - Odr_oct *targetReference; - char *creationDateTime; /* OPTIONAL */ - int *taskStatus; -#define Z_TaskPackage_pending 0 -#define Z_TaskPackage_active 1 -#define Z_TaskPackage_complete 2 -#define Z_TaskPackage_aborted 3 - int num_packageDiagnostics; - Z_DiagRec **packageDiagnostics; /* OPTIONAL */ - Z_External *taskSpecificParameters; -} Z_TaskPackage; - -int z_TaskPackage(ODR o, Z_TaskPackage **p, int opt, const char *name); - -/* ----------------------- ITEM ORDER ------------------------- */ - -typedef struct Z_IOTargetPart -{ - Z_External *itemRequest; /* OPTIONAL */ - Z_External *statusOrErrorReport; - int *auxiliaryStatus; /* OPTIONAL */ -#define Z_IOTargetPart_notReceived 1 -#define Z_IOTargetPart_loanQueue 2 -#define Z_IOTargetPart_forwarded 3 -#define Z_IOTargetPart_unfilledCopyright 4 -#define Z_IOTargetPart_filledCopyright 1 -} Z_IOTargetPart; - -typedef struct Z_IOResultSetItem -{ - char *resultSetId; - int *item; -} Z_IOResultSetItem; - -typedef struct Z_IOOriginPartNotToKeep -{ - Z_IOResultSetItem *resultSetItem; /* OPTIONAL */ - Z_External *itemRequest; /* OPTIONAL */ -} Z_IOOriginPartNotToKeep; - -typedef struct Z_IOContact -{ - char *name; /* OPTIONAL */ - char *phone; /* OPTIONAL */ - char *email; /* OPTIONAL */ -} Z_IOContact; - -typedef struct Z_IOCreditCardInfo -{ - char *nameOnCard; - char *expirationDate; - char *cardNumber; -} Z_IOCreditCardInfo; - -typedef struct Z_IOBilling -{ - int which; -#define Z_IOBilling_billInvoice 0 -#define Z_IOBilling_prepay 1 -#define Z_IOBilling_depositAccount 2 -#define Z_IOBilling_creditCard 3 -#define Z_IOBilling_cardInfoPreviouslySupplied 4 -#define Z_IOBilling_privateKnown 5 -#define Z_IOBilling_privateNotKnown 6 - union - { - Odr_null *noinfo; - Z_IOCreditCardInfo *creditCard; - Z_External *privateNotKnown; - } paymentMethod; - char *customerReference; /* OPTIONAL */ - char *customerPONumber; /* OPTIONAL */ -} Z_IOBilling; - -typedef struct Z_IOOriginPartToKeep -{ - Z_External *supplDescription; /* OPTIONAL */ - Z_IOContact *contact; /* OPTIONAL */ - Z_IOBilling *addlBilling; /* OPTIONAL */ -} Z_IOOriginPartToKeep; - -typedef struct Z_IORequest -{ - Z_IOOriginPartToKeep *toKeep; /* OPTIONAL */ - Z_IOOriginPartNotToKeep *notToKeep; -} Z_IORequest; - -typedef struct Z_IOTaskPackage -{ - Z_IOOriginPartToKeep *originPart; /* OPTIONAL */ - Z_IOTargetPart *targetPart; -} Z_IOTaskPackage; - -typedef struct Z_ItemOrder -{ - int which; -#define Z_ItemOrder_esRequest 0 -#define Z_ItemOrder_taskPackage 1 - union - { - Z_IORequest *esRequest; - Z_IOTaskPackage *taskPackage; - } u; -} Z_ItemOrder; - -int z_ItemOrder(ODR o, Z_ItemOrder **p, int opt, const char *name); - -/* ----------------------- ITEM UPDATE ------------------------ */ - -typedef struct Z_IUSuppliedRecordsId -{ - int which; -#define Z_IUSuppliedRecordsId_timeStamp 1 -#define Z_IUSuppliedRecordsId_versionNumber 2 -#define Z_IUSuppliedRecordsId_previousVersion 3 - union { - char *timeStamp; - char *versionNumber; - Odr_external *previousVersion; - } u; -} Z_IUSuppliedRecordsId; - -typedef struct Z_IUCorrelationInfo -{ - char *note; /* OPTIONAL */ - int *id; /* OPTIONAL */ -} Z_IUCorrelationInfo; - -typedef struct Z_IUSuppliedRecords_elem -{ - int which; -#define Z_IUSuppliedRecords_number 1 -#define Z_IUSuppliedRecords_string 2 -#define Z_IUSuppliedRecords_opaque 3 - union { - int *number; - char *string; - Odr_oct *opaque; - } u; /* OPTIONAL */ - Z_IUSuppliedRecordsId *supplementalId; /* OPTIONAL */ - Z_IUCorrelationInfo *correlationInfo; /* OPTIONAL */ - Z_External *record; -} Z_IUSuppliedRecords_elem; - -typedef struct Z_IUSuppliedRecords -{ - int num; - Z_IUSuppliedRecords_elem **elements; -} Z_IUSuppliedRecords; - -typedef struct Z_IUOriginPartToKeep -{ - int *action; -#define Z_IUOriginPartToKeep_recordInsert 1 -#define Z_IUOriginPartToKeep_recordReplace 2 -#define Z_IUOriginPartToKeep_recordDelete 3 -#define Z_IUOriginPartToKeep_elementUpdate 4 -#define Z_IUOriginPartToKeep_specialUpdate 5 - char *databaseName; - Odr_oid *schema; /* OPTIONAL */ - char *elementSetName; /* OPTIONAL */ - Odr_external *actionQualifier; /* OPTIONAL */ -} Z_IUOriginPartToKeep; - -typedef struct Z_IUTaskPackageRecordStructure -{ - int which; -#define Z_IUTaskPackageRecordStructure_record 1 -#define Z_IUTaskPackageRecordStructure_surrogateDiagnostics 2 - union { - Odr_external *record; - Z_DiagRecs *surrogateDiagnostics; - } u; /* OPTIONAL */ - Z_IUCorrelationInfo *correlationInfo; /* OPTIONAL */ - int *recordStatus; -#define Z_IUTaskPackageRecordStructureS_success 1 -#define Z_IUTaskPackageRecordStructureS_queued 2 -#define Z_IUTaskPackageRecordStructureS_inProcess 3 -#define Z_IUTaskPackageRecordStructureS_failure 4 - Z_DiagRecs *supplementalDiagnostics; /* OPTIONAL */ -} Z_IUTaskPackageRecordStructure; - -typedef struct Z_IUTargetPart -{ - int *updateStatus; -#define Z_IUTargetPart_success 1 -#define Z_IUTargetPart_partial 2 -#define Z_IUTargetPart_failure 3 - int num_globalDiagnostics; - Z_DiagRec **globalDiagnostics; /* OPTIONAL */ - int num_taskPackageRecords; - Z_IUTaskPackageRecordStructure **taskPackageRecords; -} Z_IUTargetPart; - -typedef struct Z_IUUpdateEsRequest -{ - Z_IUOriginPartToKeep *toKeep; - Z_IUSuppliedRecords *notToKeep; -} Z_IUUpdateEsRequest; - -typedef struct Z_IUUpdateTaskPackage -{ - Z_IUOriginPartToKeep *originPart; - Z_IUTargetPart *targetPart; -} Z_IUUpdateTaskPackage; - -typedef struct Z_IUUpdate -{ - int which; -#define Z_IUUpdate_esRequest 1 -#define Z_IUUpdate_taskPackage 2 - union { - Z_IUUpdateEsRequest *esRequest; - Z_IUUpdateTaskPackage *taskPackage; - } u; -} Z_IUUpdate; - -YAZ_EXPORT int z_IUUpdate(ODR o, Z_IUUpdate **p, int opt, const char *name); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/asn/prt-exp.c b/asn/prt-exp.c deleted file mode 100644 index 9e9243f..0000000 --- a/asn/prt-exp.c +++ /dev/null @@ -1,1565 +0,0 @@ -/* - * Copyright (c) 1995-1999, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: prt-exp.c,v $ - * Revision 1.13 1999-11-30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.12 1999/04/20 09:56:48 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.11 1999/03/18 12:57:13 adam - * Fixed bug in TargetInfo encoder/decoder. - * - * Revision 1.10 1998/05/18 13:06:52 adam - * Changed the way attribute sets are handled by the retriaval module. - * Extended Explain conversion / schema. - * Modified server and client to work with ASN.1 compiled protocol handlers. - * - * Revision 1.9 1998/02/11 11:53:32 adam - * Changed code so that it compiles as C++. - * - * Revision 1.8 1996/01/02 11:46:41 quinn - * Changed 'operator' to 'roperator' to avoid C++ conflict. - * - * Revision 1.7 1995/12/14 16:28:07 quinn - * More explain stuff. - * - * Revision 1.6 1995/12/14 11:09:09 quinn - * Fixed bug in tagging. - * - * Revision 1.5 1995/12/05 11:15:50 quinn - * Work. - * - * Revision 1.4 1995/09/29 17:11:54 quinn - * Smallish - * - * Revision 1.3 1995/09/27 15:02:42 quinn - * Modified function heads & prototypes. - * - * Revision 1.2 1995/08/15 11:59:43 quinn - * Updated External - * - * Revision 1.1 1995/08/10 08:54:02 quinn - * Added Explain - * - * - */ - -#include - -int z_LanguageCode(ODR o, char **p, int opt, const char *name); -int z_CommonInfo(ODR o, Z_CommonInfo **p, int opt, const char *name); -int z_HumanStringUnit(ODR o, Z_HumanStringUnit **p, int opt, const char *name); -int z_HumanString(ODR o, Z_HumanString **p, int opt, const char *name); -int z_IconObjectUnit(ODR o, Z_IconObjectUnit **p, int opt, const char *name); -int z_IconObject(ODR o, Z_IconObject **p, int opt, const char *name); -int z_ContactInfo(ODR o, Z_ContactInfo **p, int opt, const char *name); -int z_NetworkAddressIA(ODR o, Z_NetworkAddressIA **p, int opt, - const char *name); -int z_NetworkAddressOPA(ODR o, Z_NetworkAddressOPA **p, int opt, - const char *name); -int z_NetworkAddressOther(ODR o, Z_NetworkAddressOther **p, int opt, - const char *name); -int z_NetworkAddress(ODR o, Z_NetworkAddress **p, int opt, const char *name); -int z_AccessInfo(ODR o, Z_AccessInfo **p, int opt, const char *name); -int z_QueryTypeDetails(ODR o, Z_QueryTypeDetails **p, int opt, - const char *name); -int z_PrivateCapOperator(ODR o, Z_PrivateCapOperator **p, int opt, - const char *name); -int z_PrivateCapabilities(ODR o, Z_PrivateCapabilities **p, int opt, - const char *name); -int z_RpnCapabilities(ODR o, Z_RpnCapabilities **p, int opt, const char *name); -int z_Iso8777Capabilities(ODR o, Z_Iso8777Capabilities **p, int opt, - const char *name); -int z_ProxSupportPrivate(ODR o, Z_ProxSupportPrivate **p, int opt, - const char *name); -int z_ProxSupportUnit(ODR o, Z_ProxSupportUnit **p, int opt, const char *name); -int z_ProximitySupport(ODR o, Z_ProximitySupport **p, int opt, - const char *name); -int z_SearchKey(ODR o, Z_SearchKey **p, int opt, const char *name); -int z_AccessRestrictionsUnit(ODR o, Z_AccessRestrictionsUnit **p, int opt, - const char *name); -int z_AccessRestrictions(ODR o, Z_AccessRestrictions **p, int opt, - const char *name); -int z_CostsOtherCharge(ODR o, Z_CostsOtherCharge **p, int opt, - const char *name); -int z_Costs(ODR o, Z_Costs **p, int opt, const char *name); -int z_Charge(ODR o, Z_Charge **p, int opt, const char *name); -int z_DatabaseList(ODR o, Z_DatabaseList **p, int opt, const char *name); -int z_AttributeCombinations(ODR o, Z_AttributeCombinations **p, int opt, - const char *name); -int z_AttributeCombination(ODR o, Z_AttributeCombination **p, int opt, - const char *name); -int z_AttributeValueList(ODR o, Z_AttributeValueList **p, int opt, - const char *name); -int z_AttributeOccurrence(ODR o, Z_AttributeOccurrence **p, int opt, - const char *name); -int z_AttributeValue(ODR o, Z_AttributeValue **p, int opt, const char *name); -int z_TargetInfo(ODR o, Z_TargetInfo **p, int opt, const char *name); -int z_DatabaseInfo(ODR o, Z_DatabaseInfo **p, int opt, const char *name); -int z_TagTypeMapping(ODR o, Z_TagTypeMapping **p, int opt, const char *name); -int z_SchemaInfo(ODR o, Z_SchemaInfo **p, int opt, const char *name); -int z_ElementInfo(ODR o, Z_ElementInfo **p, int opt, const char *name); -int z_PathUnit(ODR o, Z_PathUnit **p, int opt, const char *name); -int z_Path(ODR o, Z_Path **p, int opt, const char *name); -int z_ElementInfoList(ODR o, Z_Path **p, int opt, const char *name); -int z_ElementDataType(ODR o, Z_ElementDataType **p, int opt, const char *name); -int z_TagSetInfoElements(ODR o, Z_TagSetInfoElements **p, int opt, - const char *name); -int z_TagSetInfo(ODR o, Z_TagSetInfo **p, int opt, const char *name); -int z_RecordSyntaxInfo(ODR o, Z_RecordSyntaxInfo **p, int opt, - const char *name); -int z_AttributeSetInfo(ODR o, Z_AttributeSetInfo **p, int opt, - const char *name); -int z_AttributeType(ODR o, Z_AttributeType **p, int opt, const char *name); -int z_AttributeDescription(ODR o, Z_AttributeDescription **p, int opt, - const char *name); -int z_TermListElement(ODR o, Z_TermListElement **p, int opt, const char *name); -int z_TermListInfo(ODR o, Z_TermListInfo **p, int opt, const char *name); -int z_ExtendedServicesInfo(ODR o, Z_ExtendedServicesInfo **p, int opt, - const char *name); -int z_AttributeDetails(ODR o, Z_AttributeDetails **p, int opt, - const char *name); -int z_AttributeSetDetails(ODR o, Z_AttributeSetDetails **p, int opt, - const char *name); -int z_AttributeTypeDetails(ODR o, Z_AttributeTypeDetails **p, int opt, - const char *name); -int z_OmittedAttributeInterpretation(ODR o, - Z_OmittedAttributeInterpretation **p, - int opt, const char *name); -int z_EScanInfo(ODR o, Z_EScanInfo **p, int opt, const char *name); -int z_TermListDetails(ODR o, Z_TermListDetails **p, int opt, const char *name); -int z_ElementSetDetails(ODR o, Z_ElementSetDetails **p, int opt, - const char *name); -int z_RetrievalRecordDetails(ODR o, Z_RetrievalRecordDetails **p, int opt, - const char *name); -int z_PerElementDetails(ODR o, Z_PerElementDetails **p, int opt, - const char *name); -int z_RecordTag(ODR o, Z_RecordTag **p, int opt, const char *name); -int z_SortDetails(ODR o, Z_SortDetails **p, int opt, const char *name); -int z_SortKeyDetails(ODR o, Z_SortKeyDetails **p, int opt, const char *name); -int z_ProcessingInformation(ODR o, Z_ProcessingInformation **p, int opt, - const char *name); -int z_VariantSetInfo(ODR o, Z_VariantSetInfo **p, int opt, const char *name); -int z_VariantClass(ODR o, Z_VariantClass **p, int opt, const char *name); -int z_VariantType(ODR o, Z_VariantType **p, int opt, const char *name); -int z_VariantValue(ODR o, Z_VariantValue **p, int opt, const char *name); -int z_ValueSetEnumerated(ODR o, Z_ValueSetEnumerated **p, int opt, - const char *name); -int z_ValueSet(ODR o, Z_ValueSet **p, int opt, const char *name); -int z_ValueRange(ODR o, Z_ValueRange **p, int opt, const char *name); -int z_ValueDescription(ODR o, Z_ValueDescription **p, int opt, - const char *name); -int z_UnitInfo(ODR o, Z_UnitInfo **p, int opt, const char *name); -int z_UnitType(ODR o, Z_UnitType **p, int opt, const char *name); -int z_Units(ODR o, Z_Units **p, int opt, const char *name); -int z_CategoryList(ODR o, Z_CategoryList **p, int opt, const char *name); -int z_CategoryInfo(ODR o, Z_CategoryInfo **p, int opt, const char *name); -int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt, const char *name); - -int z_LanguageCode(ODR o, char **p, int opt, const char *name) -{ - return z_InternationalString(o, p, opt, 0); -} - -int z_CommonInfo(ODR o, Z_CommonInfo **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_generalizedtime, &(*p)->dateAdded, - ODR_CONTEXT, 0, 1) && - odr_implicit(o, odr_generalizedtime, &(*p)->dateChanged, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_generalizedtime, &(*p)->expiry, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_LanguageCode, &(*p)->humanStringLanguage, - ODR_CONTEXT, 3, 1) && - z_OtherInformation(o, &(*p)->otherInfo, 1, 0) && - odr_sequence_end(o); -} - -int z_HumanStringUnit(ODR o, Z_HumanStringUnit **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_LanguageCode, &(*p)->language, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_InternationalString, &(*p)->text, ODR_CONTEXT, - 1, 0) && - odr_sequence_end(o); -} - -int z_HumanString(ODR o, Z_HumanString **p, int opt, const char *name) -{ - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of(o, (Odr_fun)z_HumanStringUnit, &(*p)->strings, - &(*p)->num_strings, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_IconObjectUnit(ODR o, Z_IconObjectUnit **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IconObjectUnit_ianaType, - z_InternationalString, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IconObjectUnit_z3950type, - z_InternationalString, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IconObjectUnit_otherType, - z_InternationalString, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_constructed_begin(o, &(*p)->bodyType, ODR_CONTEXT, 1, 0) && - odr_choice(o, arm, &(*p)->bodyType, &(*p)->which, 0) && - odr_constructed_end(o) && - odr_implicit(o, odr_octetstring, &(*p)->content, ODR_CONTEXT, 2, 0) && - odr_sequence_end(o); -} - -int z_IconObject(ODR o, Z_IconObject **p, int opt, const char *name) -{ - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of(o, (Odr_fun)z_IconObjectUnit, &(*p)->elements, - &(*p)->num, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_ContactInfo(ODR o, Z_ContactInfo **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_HumanString, &(*p)->address, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_InternationalString, &(*p)->email, - ODR_CONTEXT, 3, 1) && - odr_implicit(o, z_InternationalString, &(*p)->phone, - ODR_CONTEXT, 4, 1) && - odr_sequence_end(o); -} - -int z_NetworkAddressIA(ODR o, Z_NetworkAddressIA **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt; - return - odr_implicit(o, z_InternationalString, &(*p)->hostAddress, - ODR_CONTEXT, 0, 0) && - odr_implicit(o, odr_integer, &(*p)->port, ODR_CONTEXT, 1, 0) && - odr_sequence_end(o); -} - -int z_NetworkAddressOPA(ODR o, Z_NetworkAddressOPA **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt; - return - odr_implicit(o, z_InternationalString, &(*p)->pSel, - ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_InternationalString, &(*p)->sSel, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_InternationalString, &(*p)->tSel, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_InternationalString, &(*p)->nSap, - ODR_CONTEXT, 3, 0) && - odr_sequence_end(o); -} - -int z_NetworkAddressOther(ODR o, Z_NetworkAddressOther **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt; - return - odr_implicit(o, z_InternationalString, &(*p)->type, - ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_InternationalString, &(*p)->address, - ODR_CONTEXT, 1, 0) && - odr_sequence_end(o); -} - -int z_NetworkAddress(ODR o, Z_NetworkAddress **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_NetworkAddress_iA, - (Odr_fun)z_NetworkAddressIA, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_NetworkAddress_oPA, - (Odr_fun)z_NetworkAddressOPA, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_NetworkAddress_other, - (Odr_fun)z_NetworkAddressOther, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_AccessInfo(ODR o, Z_AccessInfo **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit_settag(o, ODR_CONTEXT, 0) && - (odr_sequence_of(o, (Odr_fun)z_QueryTypeDetails, - &(*p)->queryTypesSupported, - &(*p)->num_queryTypesSupported, 0) || odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 1) && - (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->diagnosticsSets, - &(*p)->num_diagnosticsSets, 0) || odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->attributeSetIds, - &(*p)->num_attributeSetIds, 0) || odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->schemas, - &(*p)->num_schemas, 0) || - odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 4) && - (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->recordSyntaxes, - &(*p)->num_recordSyntaxes, 0) || odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 5) && - (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->resourceChallenges, - &(*p)->num_resourceChallenges, 0) || odr_ok(o)) && - odr_implicit(o, z_AccessRestrictions, &(*p)->restrictedAccess, - ODR_CONTEXT, 6, 1) && - odr_implicit(o, z_Costs, &(*p)->costInfo, ODR_CONTEXT, 8, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 9) && - (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->variantSets, - &(*p)->num_variantSets, 0) || odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 10) && - (odr_sequence_of(o, (Odr_fun)z_ElementSetName, &(*p)->elementSetNames, - &(*p)->num_elementSetNames, 0) || odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 11) && - (odr_sequence_of(o, (Odr_fun)z_InternationalString, &(*p)->unitSystems, - &(*p)->num_unitSystems, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_QueryTypeDetails(ODR o, Z_QueryTypeDetails **p, int opt, - const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_QueryTypeDetails_private, - (Odr_fun)z_PrivateCapabilities, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_QueryTypeDetails_rpn, - (Odr_fun)z_RpnCapabilities, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_QueryTypeDetails_iso8777, - (Odr_fun)z_Iso8777Capabilities, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_QueryTypeDetails_z39_58, - (Odr_fun)z_HumanString, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_QueryTypeDetails_erpn, - (Odr_fun)z_RpnCapabilities, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_QueryTypeDetails_rankedList, - (Odr_fun)z_HumanString, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_PrivateCapOperator(ODR o, Z_PrivateCapOperator **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->roperator, - ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 1, 1) && - odr_sequence_end(o); -} - -int z_PrivateCapabilities(ODR o, Z_PrivateCapabilities **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit_settag(o, ODR_CONTEXT, 0) && - (odr_sequence_of(o, (Odr_fun)z_PrivateCapOperator, &(*p)->operators, - &(*p)->num_operators, 0) || odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 1) && - (odr_sequence_of(o, (Odr_fun)z_SearchKey, &(*p)->searchKeys, - &(*p)->num_searchKeys, 0) || odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)z_HumanString, &(*p)->description, - &(*p)->num_description, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_RpnCapabilities(ODR o, Z_RpnCapabilities **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit_settag(o, ODR_CONTEXT, 0) && - (odr_sequence_of(o, (Odr_fun)odr_integer, &(*p)->operators, - &(*p)->num_operators, 0) || odr_ok(o)) && - odr_implicit(o, odr_bool, &(*p)->resultSetAsOperandSupported, - ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_bool, &(*p)->restrictionOperandSupported, - ODR_CONTEXT, 2, 0) && - odr_implicit(o, z_ProximitySupport, &(*p)->proximity, ODR_CONTEXT, - 3, 1) && - odr_sequence_end(o); -} - -int z_Iso8777Capabilities(ODR o, Z_Iso8777Capabilities **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit_settag(o, ODR_CONTEXT, 0) && - odr_sequence_of(o, (Odr_fun)z_SearchKey, &(*p)->searchKeys, - &(*p)->num_searchKeys, 0) && - odr_implicit(o, z_HumanString, &(*p)->restrictions, ODR_CONTEXT, - 1, 1) && - odr_sequence_end(o); -} - -int z_ProxSupportPrivate(ODR o, Z_ProxSupportPrivate **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->unit, ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 1, 1) && - odr_sequence_end(o); -} - -int z_ProxSupportUnit(ODR o, Z_ProxSupportUnit **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ProxSupportUnit_known, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ProxSupportUnit_private, - (Odr_fun)z_ProxSupportPrivate, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_ProximitySupport(ODR o, Z_ProximitySupport **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_bool, &(*p)->anySupport, ODR_CONTEXT, 0, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 1) && - (odr_sequence_of(o, (Odr_fun)z_ProxSupportUnit, &(*p)->unitsSupported, - &(*p)->num_unitsSupported, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_SearchKey(ODR o, Z_SearchKey **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->searchKey, - ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 1, 1) && - odr_sequence_end(o); -} - -int z_AccessRestrictionsUnit(ODR o, Z_AccessRestrictionsUnit **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_explicit(o, odr_integer, &(*p)->accessType, ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_HumanString, &(*p)->accessText, ODR_CONTEXT, 1, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->accessChallenges, - &(*p)->num_accessChallenges, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_AccessRestrictions(ODR o, Z_AccessRestrictions **p, int opt, - const char *name) -{ - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of(o, (Odr_fun)z_AccessRestrictionsUnit, &(*p)->elements, - &(*p)->num, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_CostsOtherCharge(ODR o, Z_CostsOtherCharge **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_HumanString, &(*p)->forWhat, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_Charge, &(*p)->charge, ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); -} - -int z_Costs(ODR o, Z_Costs **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_Charge, &(*p)->connectCharge, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_Charge, &(*p)->connectTime, ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_Charge, &(*p)->displayCharge, ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_Charge, &(*p)->searchCharge, ODR_CONTEXT, 3, 1) && - odr_implicit(o, z_Charge, &(*p)->subscriptCharge, ODR_CONTEXT, 4, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 5) && - (odr_sequence_of(o, (Odr_fun)z_CostsOtherCharge, &(*p)->otherCharges, - &(*p)->num_otherCharges, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_Charge(ODR o, Z_Charge **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_IntUnit, &(*p)->cost, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_Unit, &(*p)->perWhat, ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_HumanString, &(*p)->text, ODR_CONTEXT, 3, 1) && - odr_sequence_end(o); -} - -int z_DatabaseList(ODR o, Z_DatabaseList **p, int opt, const char *name) -{ - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of(o, z_DatabaseName, &(*p)->databases, - &(*p)->num_databases, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_AttributeCombinations(ODR o, Z_AttributeCombinations **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_oid, &(*p)->defaultAttributeSet, - ODR_CONTEXT, 0, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 1) && - odr_sequence_of(o, (Odr_fun)z_AttributeCombination, - &(*p)->legalCombinations, - &(*p)->num_legalCombinations, 0) && - odr_sequence_end(o); -} - -int z_AttributeCombination(ODR o, Z_AttributeCombination **p, int opt, - const char *name) -{ - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of(o, (Odr_fun)z_AttributeOccurrence, &(*p)->occurrences, - &(*p)->num_occurrences, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_AttributeValueList(ODR o, Z_AttributeValueList **p, int opt, - const char *name) -{ - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of(o, (Odr_fun)z_StringOrNumeric, &(*p)->attributes, - &(*p)->num_attributes, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_AttributeOccurrence(ODR o, Z_AttributeOccurrence **p, int opt, - const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_AttributeOcc_any_or_none, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_AttributeOcc_specific, - (Odr_fun)z_AttributeValueList, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_oid, &(*p)->attributeSet, ODR_CONTEXT, 0, 1) && - odr_implicit(o, odr_integer, &(*p)->attributeType, - ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_null, &(*p)->mustBeSupplied, ODR_CONTEXT, 2, 1) && - odr_choice(o, arm, &(*p)->attributeValues, &(*p)->which, 0) && - odr_sequence_end(o); -} - -int z_AttributeValue(ODR o, Z_AttributeValue **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_explicit(o, z_StringOrNumeric, &(*p)->value, ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 1, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)z_StringOrNumeric, &(*p)->subAttributes, - &(*p)->num_subAttributes, 0) || odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, (Odr_fun)z_StringOrNumeric, &(*p)->superAttributes, - &(*p)->num_superAttributes, 0) || odr_ok(o)) && - odr_implicit(o, odr_null, &(*p)->partialSupport, ODR_CONTEXT, 4, 1) && - odr_sequence_end(o); -} - - - -int z_TargetInfo(ODR o, Z_TargetInfo **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, - ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_HumanString, &(*p)->recentNews, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_IconObject, &(*p)->icon, - ODR_CONTEXT, 3, 1) && - odr_implicit(o, odr_bool, &(*p)->namedResultSets, - ODR_CONTEXT, 4, 0) && - odr_implicit(o, odr_bool, &(*p)->multipleDBsearch, - ODR_CONTEXT, 5, 0) && - odr_implicit(o, odr_integer, &(*p)->maxResultSets, - ODR_CONTEXT, 6, 1) && - odr_implicit(o, odr_integer, &(*p)->maxResultSize, - ODR_CONTEXT, 7, 1) && - odr_implicit(o, odr_integer, &(*p)->maxTerms, - ODR_CONTEXT, 8, 1) && - odr_implicit(o, z_IntUnit, &(*p)->timeoutInterval, - ODR_CONTEXT, 9, 1) && - odr_implicit(o, z_HumanString, &(*p)->welcomeMessage, - ODR_CONTEXT, 10, 1) && - odr_implicit(o, z_ContactInfo, &(*p)->contactInfo, - ODR_CONTEXT, 11, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 12, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 13) && - (odr_sequence_of(o, z_InternationalString, &(*p)->nicknames, - &(*p)->num_nicknames, 0) || odr_ok(o)) && - odr_implicit(o, z_HumanString, &(*p)->usageRest, - ODR_CONTEXT, 14, 1) && - odr_implicit(o, z_HumanString, &(*p)->paymentAddr, - ODR_CONTEXT, 15, 1) && - odr_implicit(o, z_HumanString, &(*p)->hours, ODR_CONTEXT, 16, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 17) && - (odr_sequence_of(o, (Odr_fun)z_DatabaseList, &(*p)->dbCombinations, - &(*p)->num_dbCombinations, 0) || odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 18) && - (odr_sequence_of(o, (Odr_fun)z_NetworkAddress, &(*p)->addresses, - &(*p)->num_addresses, 0) || odr_ok(o)) && - odr_implicit_settag (o, ODR_CONTEXT, 101) && - (odr_sequence_of(o, (Odr_fun) z_InternationalString, &(*p)->languages, - &(*p)->num_languages, 0) || odr_ok(o)) && - odr_implicit(o, z_AccessInfo, &(*p)->commonAccessInfo, - ODR_CONTEXT, 19, 1) && - odr_sequence_end(o); -} - -int z_DatabaseInfo(ODR o, Z_DatabaseInfo **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_DatabaseInfo_actualNumber, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_DatabaseInfo_approxNumber, - (Odr_fun)odr_integer, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_DatabaseName, &(*p)->name, ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_null, &(*p)->explainDatabase, ODR_CONTEXT, 2, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, z_DatabaseName, &(*p)->nicknames, - &(*p)->num_nicknames, 0) || odr_ok(o)) && - odr_implicit(o, z_IconObject, &(*p)->icon, ODR_CONTEXT, 4, 1) && - odr_implicit(o, odr_bool, &(*p)->userFee, ODR_CONTEXT, 5, 0) && - odr_implicit(o, odr_bool, &(*p)->available, ODR_CONTEXT, 6, 0) && - odr_implicit(o, z_HumanString, &(*p)->titleString, - ODR_CONTEXT, 7, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 8) && - (odr_sequence_of(o, (Odr_fun)z_HumanString, &(*p)->keywords, - &(*p)->num_keywords, 0) || odr_ok(o)) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 9, 1) && - odr_implicit(o, z_DatabaseList, &(*p)->associatedDbs, - ODR_CONTEXT, 10, 1) && - odr_implicit(o, z_DatabaseList, &(*p)->subDbs, ODR_CONTEXT, 11, 1) && - odr_implicit(o, z_HumanString, &(*p)->disclaimers, - ODR_CONTEXT, 12, 1) && - odr_implicit(o, z_HumanString, &(*p)->news, ODR_CONTEXT, 13, 1) && - ((odr_constructed_begin(o, &(*p)->u.actualNumber, - ODR_CONTEXT, 14, 0) && - odr_choice(o, arm, &(*p)->u.actualNumber, &(*p)->which, 0) && - odr_constructed_end(o)) || odr_ok(o)) && - odr_implicit(o, z_HumanString, &(*p)->defaultOrder, - ODR_CONTEXT, 15, 1) && - odr_implicit(o, odr_integer, &(*p)->avRecordSize, - ODR_CONTEXT, 16, 1) && - odr_implicit(o, odr_integer, &(*p)->maxRecordSize, - ODR_CONTEXT, 17, 1) && - odr_implicit(o, z_HumanString, &(*p)->hours, ODR_CONTEXT, 18, 1) && - odr_implicit(o, z_HumanString, &(*p)->bestTime, ODR_CONTEXT, 19, 1) && - odr_implicit(o, odr_generalizedtime, &(*p)->lastUpdate, - ODR_CONTEXT, 20, 1) && - odr_implicit(o, z_IntUnit, &(*p)->updateInterval, - ODR_CONTEXT, 21, 1) && - odr_implicit(o, z_HumanString, &(*p)->coverage, ODR_CONTEXT, 22, 1) && - odr_implicit(o, odr_bool, &(*p)->proprietary, ODR_CONTEXT, 23, 1) && - odr_implicit(o, z_HumanString, &(*p)->copyrightText, - ODR_CONTEXT, 24, 1) && - odr_implicit(o, z_HumanString, &(*p)->copyrightNotice, - ODR_CONTEXT, 25, 1) && - odr_implicit(o, z_ContactInfo, &(*p)->producerContactInfo, - ODR_CONTEXT, 26, 1) && - odr_implicit(o, z_ContactInfo, &(*p)->supplierContactInfo, - ODR_CONTEXT, 27, 1) && - odr_implicit(o, z_ContactInfo, &(*p)->submissionContactInfo, - ODR_CONTEXT, 28, 1) && - odr_implicit(o, z_AccessInfo, &(*p)->accessInfo, ODR_CONTEXT, 29, 1) && - odr_sequence_end(o); -} - -int z_TagTypeMapping(ODR o, Z_TagTypeMapping **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt; - return - odr_implicit(o, odr_integer, &(*p)->tagType, ODR_CONTEXT, 0, 0) && - odr_implicit(o, odr_oid, &(*p)->tagSet, ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_null, &(*p)->defaultTagType, ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); -} - -int z_SchemaInfo(ODR o, Z_SchemaInfo **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, odr_oid, &(*p)->schema, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->name, ODR_CONTEXT, - 2, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 3, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 4) && - (odr_sequence_of(o, (Odr_fun)z_TagTypeMapping, &(*p)->tagTypeMapping, - &(*p)->num_tagTypeMapping, 0) || odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 5) && - (odr_sequence_of(o, (Odr_fun)z_ElementInfo, &(*p)->recordStructure, - &(*p)->num_recordStructure, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_ElementInfo(ODR o, Z_ElementInfo **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->elementName, - ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_Path, &(*p)->elementTagPath, ODR_CONTEXT, 2, 0) && - odr_explicit(o, z_ElementDataType, &(*p)->dataType, - ODR_CONTEXT, 3, 1) && - odr_implicit(o, odr_bool, &(*p)->required, ODR_CONTEXT, 4, 0) && - odr_implicit(o, odr_bool, &(*p)->repeatable, ODR_CONTEXT, 5, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 6, 1) && - odr_sequence_end(o); -} - -int z_PathUnit(ODR o, Z_PathUnit **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt; - return - odr_implicit(o, odr_integer, &(*p)->tagType, ODR_CONTEXT, 1, 0) && - odr_explicit(o, z_StringOrNumeric, &(*p)->tagValue, - ODR_CONTEXT, 2, 0) && - odr_sequence_end(o); -} - -int z_Path(ODR o, Z_Path **p, int opt, const char *name) -{ - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - odr_implicit_settag(o, ODR_CONTEXT, 201); - if (odr_sequence_of(o, (Odr_fun)z_OtherInformationUnit, &(*p)->list, - &(*p)->num, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_ElementInfoList(ODR o, Z_Path **p, int opt, const char *name) -{ - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - odr_implicit_settag(o, ODR_CONTEXT, 201); - if (odr_sequence_of(o, (Odr_fun)z_OtherInformationUnit, &(*p)->list, - &(*p)->num, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_ElementDataType(ODR o, Z_ElementDataType **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ElementDataType_primitive, - (Odr_fun)odr_integer, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementDataType_structured, - (Odr_fun)z_ElementInfoList, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_TagSetInfoElements(ODR o, Z_TagSetInfoElements **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt; - return - odr_implicit(o, z_InternationalString, &(*p)->elementname, - ODR_CONTEXT, 1, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, z_InternationalString, &(*p)->nicknames, - &(*p)->num_nicknames, 0) || odr_ok(o)) && - odr_explicit(o, z_StringOrNumeric, &(*p)->elementTag, - ODR_CONTEXT, 3, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 4, 1) && - odr_implicit(o, odr_integer, &(*p)->dataType, ODR_CONTEXT, 5, 1) && - z_OtherInformation(o, &(*p)->otherTagInfo, 1, 0) && - odr_sequence_end(o); -} - -int z_TagSetInfo(ODR o, Z_TagSetInfo **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, odr_oid, &(*p)->tagSet, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 2, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 3, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 4) && - (odr_sequence_of(o, (Odr_fun)z_TagSetInfoElements, &(*p)->elements, - &(*p)->num_elements, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_RecordSyntaxInfo(ODR o, Z_RecordSyntaxInfo **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, odr_oid, &(*p)->recordSyntax, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 2, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->transferSyntaxes, - &(*p)->num_transferSyntaxes, 0) || odr_ok(o)) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 4, 1) && - odr_implicit(o, z_InternationalString, &(*p)->asn1Module, - ODR_CONTEXT, 5, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 6) && - (odr_sequence_of(o, (Odr_fun)z_ElementInfo, &(*p)->abstractStructure, - &(*p)->num_abstractStructure, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_AttributeSetInfo(ODR o, Z_AttributeSetInfo **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, odr_oid, &(*p)->attributeSet, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 2, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, (Odr_fun)z_AttributeType, &(*p)->attributes, - &(*p)->num_attributes, 0) || odr_ok(o)) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 4, 1) && - odr_sequence_end(o); -} - -int z_AttributeType(ODR o, Z_AttributeType **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_integer, &(*p)->attributeType, - ODR_CONTEXT, 2, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - odr_sequence_of(o, (Odr_fun)z_AttributeDescription, - &(*p)->attributeValues, - &(*p)->num_attributeValues, 0) && - odr_sequence_end(o); -} - -int z_AttributeDescription(ODR o, Z_AttributeDescription **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 1, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->attributeValue, - ODR_CONTEXT, 2, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, (Odr_fun)z_StringOrNumeric, - &(*p)->equivalentAttributes, - &(*p)->num_equivalentAttributes, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_TermListElement(ODR o, Z_TermListElement **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_HumanString, &(*p)->title, ODR_CONTEXT, 2, 1) && - odr_implicit(o, odr_integer, &(*p)->searchCost, ODR_CONTEXT, 3, 1) && - odr_implicit(o, odr_bool, &(*p)->scanable, ODR_CONTEXT, 4, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 5) && - (odr_sequence_of(o, z_InternationalString, &(*p)->broader, - &(*p)->num_broader, 0) || odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 6) && - (odr_sequence_of(o, z_InternationalString, &(*p)->narrower, - &(*p)->num_narrower, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_TermListInfo(ODR o, Z_TermListInfo **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_DatabaseName, &(*p)->databaseName, - ODR_CONTEXT, 1, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)z_TermListElement, &(*p)->termLists, - &(*p)->num_termLists, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_ExtendedServicesInfo(ODR o, Z_ExtendedServicesInfo **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, odr_oid, &(*p)->type, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, odr_bool, &(*p)->privateType, ODR_CONTEXT, 3, 0) && - odr_implicit(o, odr_bool, &(*p)->restrictionsApply, - ODR_CONTEXT, 5, 0) && - odr_implicit(o, odr_bool, &(*p)->feeApply, ODR_CONTEXT, 6, 0) && - odr_implicit(o, odr_bool, &(*p)->available, ODR_CONTEXT, 7, 0) && - odr_implicit(o, odr_bool, &(*p)->retentionSupported, - ODR_CONTEXT, 8, 0) && - odr_implicit(o, odr_integer, &(*p)->waitAction, ODR_CONTEXT, 9, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 10, 1) && - odr_implicit(o, z_External, &(*p)->specificExplain, - ODR_CONTEXT, 11, 1) && - odr_implicit(o, z_InternationalString, &(*p)->esASN, - ODR_CONTEXT, 12, 1) && - odr_sequence_end(o); -} - -int z_AttributeDetails(ODR o, Z_AttributeDetails **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_DatabaseName, &(*p)->databaseName, - ODR_CONTEXT, 1, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)z_AttributeSetDetails, - &(*p)->attributesBySet, - &(*p)->num_attributesBySet, 0) && odr_ok(o)) && - odr_implicit(o, z_AttributeCombinations, &(*p)->attributeCombinations, - ODR_CONTEXT, 3, 1) && - odr_sequence_end(o); -} - -int z_AttributeSetDetails(ODR o, Z_AttributeSetDetails **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_oid, &(*p)->attributeSet, - ODR_CONTEXT, 0, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 1) && - odr_sequence_of(o, (Odr_fun)z_AttributeTypeDetails, - &(*p)->attributesByType, - &(*p)->num_attributesByType, 0) && - odr_sequence_end(o); -} - -int z_AttributeTypeDetails(ODR o, Z_AttributeTypeDetails **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->attributeType, - ODR_CONTEXT, 0, 0) && - odr_implicit(o, z_OmittedAttributeInterpretation, - &(*p)->defaultIfOmitted, - ODR_CONTEXT, 1, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)z_AttributeValue, &(*p)->attributeValues, - &(*p)->num_attributeValues, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_OmittedAttributeInterpretation(ODR o, - Z_OmittedAttributeInterpretation **p, - int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_explicit(o, z_StringOrNumeric, &(*p)->defaultValue, - ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->defaultDescription, - ODR_CONTEXT, 1, 1) && - odr_sequence_end(o); -} - -int z_EScanInfo(ODR o, Z_EScanInfo **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->maxStepSize, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->collatingSequence, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_bool, &(*p)->increasing, ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); -} - -int z_TermListDetails(ODR o, Z_TermListDetails **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_InternationalString, &(*p)->termListName, - ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_AttributeCombinations, &(*p)->attributes, - ODR_CONTEXT, 3, 1) && - odr_implicit(o, z_EScanInfo, &(*p)->scanInfo, ODR_CONTEXT, 4, 1) && - odr_implicit(o, odr_integer, &(*p)->estNumberTerms, - ODR_CONTEXT, 5, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 6) && - (odr_sequence_of(o, (Odr_fun)z_Term, &(*p)->sampleTerms, - &(*p)->num_sampleTerms, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_ElementSetDetails(ODR o, Z_ElementSetDetails **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_DatabaseName, &(*p)->databaseName, - ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_ElementSetName, &(*p)->elementSetName, - ODR_CONTEXT, 2, 0) && - odr_implicit(o, odr_oid, &(*p)->recordSyntax, ODR_CONTEXT, 3, 0) && - odr_implicit(o, odr_oid, &(*p)->schema, ODR_CONTEXT, 4, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 5, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 6) && - (odr_sequence_of(o, (Odr_fun)z_PerElementDetails, - &(*p)->detailsPerElement, - &(*p)->num_detailsPerElement, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_RetrievalRecordDetails(ODR o, Z_RetrievalRecordDetails **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_DatabaseName, &(*p)->databaseName, - ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_oid, &(*p)->schema, ODR_CONTEXT, 2, 0) && - odr_implicit(o, odr_oid, &(*p)->recordSyntax, ODR_CONTEXT, 3, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 4, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 5) && - (odr_sequence_of(o, (Odr_fun)z_PerElementDetails, - &(*p)->detailsPerElement, - &(*p)->num_detailsPerElement, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_PerElementDetails(ODR o, Z_PerElementDetails **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_RecordTag, &(*p)->recordTag, ODR_CONTEXT, 1, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)z_Path, &(*p)->schemaTags, - &(*p)->num_schemaTags, 0) || - odr_ok(o)) && - odr_implicit(o, odr_integer, &(*p)->maxSize, ODR_CONTEXT, 3, 1) && - odr_implicit(o, odr_integer, &(*p)->minSize, ODR_CONTEXT, 4, 1) && - odr_implicit(o, odr_integer, &(*p)->avgSize, ODR_CONTEXT, 5, 1) && - odr_implicit(o, odr_integer, &(*p)->fixedSize, ODR_CONTEXT, 6, 1) && - odr_implicit(o, odr_bool, &(*p)->repeatable, ODR_CONTEXT, 8, 0) && - odr_implicit(o, odr_bool, &(*p)->required, ODR_CONTEXT, 9, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 12, 1) && - odr_implicit(o, z_HumanString, &(*p)->contents, ODR_CONTEXT, 13, 1) && - odr_implicit(o, z_HumanString, &(*p)->billingInfo, - ODR_CONTEXT, 14, 1) && - odr_implicit(o, z_HumanString, &(*p)->restrictions, - ODR_CONTEXT, 15, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 16) && - (odr_sequence_of(o, z_InternationalString, &(*p)->alternateNames, - &(*p)->num_alternateNames, 0) || odr_ok(o)) && - odr_implicit_settag(o, ODR_CONTEXT, 17) && - (odr_sequence_of(o, z_InternationalString, &(*p)->genericNames, - &(*p)->num_genericNames, 0) || odr_ok(o)) && - odr_implicit(o, z_AttributeCombinations, &(*p)->searchAccess, - ODR_CONTEXT, 18, 1) && - odr_sequence_end(o); -} - -int z_RecordTag(ODR o, Z_RecordTag **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_explicit(o, z_StringOrNumeric, &(*p)->qualifier, - ODR_CONTEXT, 0, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->tagValue, - ODR_CONTEXT, 1, 0) && - odr_sequence_end(o); -} - -int z_SortDetails(ODR o, Z_SortDetails **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_DatabaseName, &(*p)->databaseName, - ODR_CONTEXT, 1, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - (odr_sequence_of(o, (Odr_fun)z_SortKeyDetails, &(*p)->sortKeys, - &(*p)->num_sortKeys, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_SortKeyDetails (ODR o, Z_SortKeyDetails **p, int opt, const char *name) -{ - static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortKeyDetails_character, - (Odr_fun) odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKeyDetails_numeric, - (Odr_fun) odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKeyDetails_structured, - (Odr_fun) z_HumanString, 0}, - {-1, -1, -1, -1, (Odr_fun) 0, 0} - }; - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - odr_implicit (o, z_HumanString, - &(*p)->description, ODR_CONTEXT, 0, 1) && - odr_implicit_settag (o, ODR_CONTEXT, 1) && - (odr_sequence_of(o, (Odr_fun) z_Specification, - &(*p)->elementSpecifications, - &(*p)->num_elementSpecifications, 0) || odr_ok(o)) && - odr_implicit (o, z_AttributeCombinations, - &(*p)->attributeSpecifications, ODR_CONTEXT, 2, 1) && - ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 3, 0) && - odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && - odr_constructed_end (o)) || odr_ok(o)) && - odr_implicit (o, odr_integer, - &(*p)->caseSensitivity, ODR_CONTEXT, 4, 1) && - odr_sequence_end (o); -} - -int z_ProcessingInformation(ODR o, Z_ProcessingInformation **p, int opt, - const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_DatabaseName, &(*p)->databaseName, - ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->processingContext, - ODR_CONTEXT, 2, 0) && - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 3, 0) && - odr_implicit(o, odr_oid, &(*p)->oid, ODR_CONTEXT, 4, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 5, 1) && - odr_implicit(o, z_External, &(*p)->instructions, ODR_CONTEXT, 6, 1) && - odr_sequence_end(o); -} - -int z_VariantSetInfo(ODR o, Z_VariantSetInfo **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, odr_oid, &(*p)->variantSet, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 2, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, (Odr_fun)z_VariantClass, &(*p)->variants, - &(*p)->num_variants, 0) || odr_ok(o)) && - odr_sequence_end(o); -} - -int z_VariantClass(ODR o, Z_VariantClass **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_integer, &(*p)->variantClass, ODR_CONTEXT, 2, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - odr_sequence_of(o, (Odr_fun)z_VariantType, &(*p)->variantTypes, - &(*p)->num_variantTypes, 0) && - odr_sequence_end(o); -} - -int z_VariantType(ODR o, Z_VariantType **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, odr_integer, &(*p)->variantType, - ODR_CONTEXT, 2, 0) && - odr_implicit(o, z_VariantValue, &(*p)->variantValue, - ODR_CONTEXT, 3, 1) && - odr_sequence_end(o); -} - -int z_VariantValue(ODR o, Z_VariantValue **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_explicit(o, odr_integer, &(*p)->dataType, ODR_CONTEXT, 0, 0) && - odr_explicit(o, z_ValueSet, &(*p)->values, ODR_CONTEXT, 1, 1) && - odr_sequence_end(o); -} - -int z_ValueSetEnumerated(ODR o, Z_ValueSetEnumerated **p, int opt, - const char *name) -{ - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_sequence_of(o, (Odr_fun)z_ValueDescription, &(*p)->elements, - &(*p)->num, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_ValueSet(ODR o, Z_ValueSet **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ValueSet_range, - (Odr_fun)z_ValueRange, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ValueSet_enumerated, - (Odr_fun)z_ValueSetEnumerated, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_ValueRange(ODR o, Z_ValueRange **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_explicit(o, z_ValueDescription, &(*p)->lower, ODR_CONTEXT, 0, 1) && - odr_explicit(o, z_ValueDescription, &(*p)->upper, ODR_CONTEXT, 1, 1) && - odr_sequence_end(o); -} - -int z_ValueDescription(ODR o, Z_ValueDescription **p, int opt, - const char *name) -{ - static Odr_arm arm[] = - { - {ODR_NONE, -1, -1, Z_ValueDescription_integer, - (Odr_fun)odr_integer, 0}, - {ODR_NONE, -1, -1, Z_ValueDescription_string, - (Odr_fun)z_InternationalString, 0}, - {ODR_NONE, -1, -1, Z_ValueDescription_octets, - (Odr_fun)odr_octetstring, 0}, - {ODR_NONE, -1, -1, Z_ValueDescription_oid, - (Odr_fun)odr_oid, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ValueDescription_unit, - (Odr_fun)z_Unit, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ValueDescription_valueAndUnit, - (Odr_fun)z_IntUnit, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_UnitInfo(ODR o, Z_UnitInfo **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_InternationalString, &(*p)->unitSystem, - ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 2, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, (Odr_fun)z_UnitType, &(*p)->units, - &(*p)->num_units, 0) || - odr_ok(o)) && - odr_sequence_end(o); -} - -int z_UnitType(ODR o, Z_UnitType **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 1, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->unitType, - ODR_CONTEXT, 2, 0) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - odr_sequence_of(o, (Odr_fun)z_Units, &(*p)->units, - &(*p)->num_units, 0) && - odr_sequence_end(o); -} - -int z_Units(ODR o, Z_Units **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->name, - ODR_CONTEXT, 0, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 1, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->unit, - ODR_CONTEXT, 2, 0) && - odr_sequence_end(o); -} - -int z_CategoryList(ODR o, Z_CategoryList **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_CommonInfo, &(*p)->commonInfo, ODR_CONTEXT, 0, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 1) && - odr_sequence_of(o, (Odr_fun)z_CategoryInfo, &(*p)->categories, - &(*p)->num_categories, 0) && - odr_sequence_end(o); -} - -int z_CategoryInfo(ODR o, Z_CategoryInfo **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_InternationalString, &(*p)->category, - ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->originalCategory, - ODR_CONTEXT, 2, 1) && - odr_implicit(o, z_HumanString, &(*p)->description, - ODR_CONTEXT, 3, 1) && - odr_implicit(o, z_InternationalString, &(*p)->asn1Module, - ODR_CONTEXT, 4, 1) && - odr_sequence_end(o); -} - -int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_Explain_targetInfo, - (Odr_fun)z_TargetInfo, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Explain_databaseInfo, - (Odr_fun)z_DatabaseInfo, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Explain_schemaInfo, - (Odr_fun)z_SchemaInfo, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Explain_tagSetInfo, - (Odr_fun)z_TagSetInfo, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_Explain_recordSyntaxInfo, - (Odr_fun)z_RecordSyntaxInfo, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_Explain_attributeSetInfo, - (Odr_fun)z_AttributeSetInfo, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_Explain_termListInfo, - (Odr_fun)z_TermListInfo, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_Explain_extendedServicesInfo, - (Odr_fun)z_ExtendedServicesInfo, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 8, Z_Explain_attributeDetails, - (Odr_fun)z_AttributeDetails, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 9, Z_Explain_termListDetails, - (Odr_fun)z_TermListDetails, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 10, Z_Explain_elementSetDetails, - (Odr_fun)z_ElementSetDetails, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 11, Z_Explain_retrievalRecordDetails, - (Odr_fun)z_RetrievalRecordDetails, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 12, Z_Explain_sortDetails, - (Odr_fun)z_SortDetails, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 13, Z_Explain_processing, - (Odr_fun)z_ProcessingInformation, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 14, Z_Explain_variants, - (Odr_fun)z_VariantSetInfo, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 15, Z_Explain_units, - (Odr_fun)z_UnitInfo, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 100, Z_Explain_categoryList, - (Odr_fun)z_CategoryList, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_initmember(o, p, sizeof(**p))) - return opt && odr_ok(o); - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} diff --git a/asn/prt-exp.h b/asn/prt-exp.h deleted file mode 100644 index 14240a0..0000000 --- a/asn/prt-exp.h +++ /dev/null @@ -1,1017 +0,0 @@ -/* - * Copyright (c) 1995-1998, Index Data. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of Index Data or the individual authors may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR - * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - */ - -#ifndef PRT_EXP_H -#define PRT_EXP_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct Z_CommonInfo -{ - char *dateAdded; /* OPTIONAL */ - char *dateChanged; /* OPTIONAL */ - char *expiry; /* OPTIONAL */ - char *humanStringLanguage; /* OPTIONAL */ - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_CommonInfo; - -typedef struct Z_HumanStringUnit -{ - char *language; /* OPTIONAL */ - char *text; -} Z_HumanStringUnit; - -typedef struct Z_HumanString -{ - int num_strings; - Z_HumanStringUnit **strings; -} Z_HumanString; - -typedef struct Z_IconObjectUnit -{ - int which; -#define Z_IconObjectUnit_ianaType 0 -#define Z_IconObjectUnit_z3950type 1 -#define Z_IconObjectUnit_otherType 2 - char *bodyType; - Odr_oct *content; -} Z_IconObjectUnit; - -typedef struct Z_IconObject -{ - int num; - Z_IconObjectUnit **elements; -} Z_IconObject; - -typedef struct Z_ContactInfo -{ - char *name; /* OPTIONAL */ - Z_HumanString *description; /* OPTIONAL */ - Z_HumanString *address; /* OPTIONAL */ - char *email; /* OPTIONAL */ - char *phone; /* OPTIONAL */ -} Z_ContactInfo; - -typedef struct Z_NetworkAddressIA -{ - char *hostAddress; - int *port; -} Z_NetworkAddressIA; - -typedef struct Z_NetworkAddressOPA -{ - char *pSel; - char *sSel; /* OPTIONAL */ - char *tSel; /* OPTIONAL */ - char *nSap; -} Z_NetworkAddressOPA; - -typedef struct Z_NetworkAddressOther -{ - char *type; - char *address; -} Z_NetworkAddressOther; - -typedef struct Z_NetworkAddress -{ - int which; -#define Z_NetworkAddress_iA 0 -#define Z_NetworkAddress_oPA 1 -#define Z_NetworkAddress_other 2 - union - { - Z_NetworkAddressIA *internetAddress; - Z_NetworkAddressOPA *osiPresentationAddress; - Z_NetworkAddressOther *other; - } u; -} Z_NetworkAddress; - -typedef struct Z_PrivateCapOperator -{ - char *roperator; - Z_HumanString *description; /* OPTIONAL */ -} Z_PrivateCapOperator; - -typedef struct Z_SearchKey -{ - char *searchKey; - Z_HumanString *description; /* OPTIONAL */ -} Z_SearchKey; - -typedef struct Z_PrivateCapabilities -{ - int num_operators; - Z_PrivateCapOperator **operators; /* OPTIONAL */ - int num_searchKeys; - Z_SearchKey **searchKeys; /* OPTIONAL */ - int num_description; - Z_HumanString **description; /* OPTIONAL */ -} Z_PrivateCapabilities; - -typedef struct Z_ProxSupportPrivate -{ - int *unit; - Z_HumanString *description; /* OPTIONAL */ -} Z_ProxSupportPrivate; - -typedef struct Z_ProxSupportUnit -{ - int which; -#define Z_ProxSupportUnit_known 0 -#define Z_ProxSupportUnit_private 1 - union - { - int *known; - Z_ProxSupportPrivate *zprivate; - } u; -} Z_ProxSupportUnit; - -typedef struct Z_ProximitySupport -{ - bool_t *anySupport; - int num_unitsSupported; - Z_ProxSupportUnit **unitsSupported; /* OPTIONAL */ -} Z_ProximitySupport; - -typedef struct Z_RpnCapabilities -{ - int num_operators; - int **operators; /* OPTIONAL */ - bool_t *resultSetAsOperandSupported; - bool_t *restrictionOperandSupported; - Z_ProximitySupport *proximity; /* OPTIONAL */ -} Z_RpnCapabilities; - -typedef struct Z_Iso8777Capabilities -{ - int num_searchKeys; - Z_SearchKey **searchKeys; - Z_HumanString *restrictions; /* OPTIONAL */ -} Z_Iso8777Capabilities; - -typedef struct Z_QueryTypeDetails -{ - int which; -#define Z_QueryTypeDetails_private 0 -#define Z_QueryTypeDetails_rpn 1 -#define Z_QueryTypeDetails_iso8777 2 -#define Z_QueryTypeDetails_z39_58 3 -#define Z_QueryTypeDetails_erpn 4 -#define Z_QueryTypeDetails_rankedList 5 - union - { - Z_PrivateCapabilities *zprivate; - Z_RpnCapabilities *rpn; - Z_Iso8777Capabilities *iso8777; - Z_HumanString *z3958; - Z_RpnCapabilities *erpn; - Z_HumanString *rankedList; - } u; -} Z_QueryTypeDetails; - -typedef struct Z_AccessRestrictionsUnit -{ - int *accessType; -#define Z_AccessRestrictionsUnit_any 0 -#define Z_AccessRestrictionsUnit_search 1 -#define Z_AccessRestrictionsUnit_present 2 -#define Z_AccessRestrictionsUnit_specific_elements 3 -#define Z_AccessRestrictionsUnit_extended_services 4 -#define Z_AccessRestrictionsUnit_by_database 5 - Z_HumanString *accessText; /* OPTIONAL */ - int num_accessChallenges; - Odr_oid **accessChallenges; /* OPTIONAL */ -} Z_AccessRestrictionsUnit; - -typedef struct Z_AccessRestrictions -{ - int num; - Z_AccessRestrictionsUnit **elements; -} Z_AccessRestrictions; - -typedef struct Z_Charge -{ - Z_IntUnit *cost; - Z_Unit *perWhat; /* OPTIONAL */ - Z_HumanString *text; /* OPTIONAL */ -} Z_Charge; - -typedef struct Z_CostsOtherCharge -{ - Z_HumanString *forWhat; - Z_Charge *charge; -} Z_CostsOtherCharge; - -typedef struct Z_Costs -{ - Z_Charge *connectCharge; /* OPTIONAL */ - Z_Charge *connectTime; /* OPTIONAL */ - Z_Charge *displayCharge; /* OPTIONAL */ - Z_Charge *searchCharge; /* OPTIONAL */ - Z_Charge *subscriptCharge; /* OPTIONAL */ - int num_otherCharges; - Z_CostsOtherCharge **otherCharges; /* OPTIONAL */ -} Z_Costs; - -typedef struct Z_AccessInfo -{ - int num_queryTypesSupported; - Z_QueryTypeDetails **queryTypesSupported; /* OPTIONAL */ - int num_diagnosticsSets; - Odr_oid **diagnosticsSets; /* OPTIONAL */ - int num_attributeSetIds; - Odr_oid **attributeSetIds; /* OPTIONAL */ - int num_schemas; - Odr_oid **schemas; /* OPTIONAL */ - int num_recordSyntaxes; - Odr_oid **recordSyntaxes; /* OPTIONAL */ - int num_resourceChallenges; - Odr_oid **resourceChallenges; /* OPTIONAL */ - Z_AccessRestrictions *restrictedAccess; /* OPTIONAL */ - Z_Costs *costInfo; /* OPTIONAL */ - int num_variantSets; - Odr_oid **variantSets; /* OPTIONAL */ - int num_elementSetNames; - char **elementSetNames; /* OPTIONAL */ - int num_unitSystems; - char **unitSystems; /* OPTIONAL */ -} Z_AccessInfo; - -typedef struct Z_DatabaseList -{ - int num_databases; - Z_DatabaseName **databases; -} Z_DatabaseList; - -typedef struct Z_AttributeValueList -{ - int num_attributes; - Z_StringOrNumeric **attributes; -} Z_AttributeValueList; - -typedef struct Z_AttributeOccurrence -{ - Odr_oid *attributeSet; /* OPTIONAL */ - int *attributeType; - Odr_null *mustBeSupplied; /* OPTIONAL */ - int which; -#define Z_AttributeOcc_any_or_none 0 -#define Z_AttributeOcc_specific 1 - union - { - Odr_null *any_or_none; - Z_AttributeValueList *specific; - } attributeValues; -} Z_AttributeOccurrence; - -typedef struct Z_AttributeCombination -{ - int num_occurrences; - Z_AttributeOccurrence **occurrences; -} Z_AttributeCombination; - -typedef struct Z_AttributeCombinations -{ - Odr_oid *defaultAttributeSet; - int num_legalCombinations; - Z_AttributeCombination **legalCombinations; -} Z_AttributeCombinations; - -typedef struct Z_AttributeValue -{ - Z_StringOrNumeric *value; - Z_HumanString *description; /* OPTIONAL */ - int num_subAttributes; - Z_StringOrNumeric **subAttributes; /* OPTIONAL */ - int num_superAttributes; - Z_StringOrNumeric **superAttributes; /* OPTIONAL */ - Odr_null *partialSupport; /* OPTIONAL */ -} Z_AttributeValue; - -typedef struct Z_TargetInfo -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * key elements - */ - char *name; - /* - * non-key brief elements - */ - Z_HumanString *recentNews; /* OPTIONAL */ - Z_IconObject *icon; /* OPTIONAL */ - bool_t *namedResultSets; - bool_t *multipleDBsearch; - int *maxResultSets; /* OPTIONAL */ - int *maxResultSize; /* OPTIONAL */ - int *maxTerms; /* OPTIONAL */ - Z_IntUnit *timeoutInterval; /* OPTIONAL */ - Z_HumanString *welcomeMessage; /* OPTIONAL */ - /* - * non-brief elements - */ - Z_ContactInfo *contactInfo; /* OPTIONAL */ - Z_HumanString *description; /* OPTIONAL */ - int num_nicknames; - char **nicknames; - Z_HumanString *usageRest; /* OPTIONAL */ - Z_HumanString *paymentAddr; /* OPTIONAL */ - Z_HumanString *hours; /* OPTIONAL */ - int num_dbCombinations; - Z_DatabaseList **dbCombinations; /* OPTIONAL */ - int num_addresses; - Z_NetworkAddress **addresses; /* OPTIONAL */ - int num_languages; - char **languages; /* OPTIONAL */ - - Z_AccessInfo *commonAccessInfo; /* OPTIONAL */ -} Z_TargetInfo; - -typedef struct Z_DatabaseInfo -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key elements - */ - Z_DatabaseName *name; - /* - * Non-key elements. - */ - Odr_null *explainDatabase; /* OPTIONAL */ - int num_nicknames; - Z_DatabaseName **nicknames; /* OPTIONAL */ - Z_IconObject *icon; /* OPTIONAL */ - bool_t *userFee; - bool_t *available; - Z_HumanString *titleString; /* OPTIONAL */ - /* - * Non-brief elements. - */ - int num_keywords; - Z_HumanString **keywords; /* OPTIONAL */ - Z_HumanString *description; /* OPTIONAL */ - Z_DatabaseList *associatedDbs; /* OPTIONAL */ - Z_DatabaseList *subDbs; /* OPTIONAL */ - Z_HumanString *disclaimers; /* OPTIONAL */ - Z_HumanString *news; /* OPTIONAL */ - -#if 1 - int which; - union { - int *actualNumber; - int *approxNumber; -#define Z_DatabaseInfo_actualNumber 1 -#define Z_DatabaseInfo_approxNumber 2 - } u; /* OPT */ - -#else - int recordCount_which; -#define Z_DatabaseInfo_actualNumber 0 -#define Z_DatabaseInfo_approxNumber 1 - int *recordCount; /* OPTIONAL */ -#endif - Z_HumanString *defaultOrder; /* OPTIONAL */ - int *avRecordSize; /* OPTIONAL */ - int *maxRecordSize; /* OPTIONAL */ - Z_HumanString *hours; /* OPTIONAL */ - Z_HumanString *bestTime; /* OPTIONAL */ - char *lastUpdate; /* OPTIONAL */ - Z_IntUnit *updateInterval; /* OPTIONAL */ - Z_HumanString *coverage; /* OPTIONAL */ - bool_t *proprietary; /* OPTIONAL */ - Z_HumanString *copyrightText; /* OPTIONAL */ - Z_HumanString *copyrightNotice; /* OPTIONAL */ - Z_ContactInfo *producerContactInfo; /* OPTIONAL */ - Z_ContactInfo *supplierContactInfo; /* OPTIONAL */ - Z_ContactInfo *submissionContactInfo; /* OPTIONAL */ - Z_AccessInfo *accessInfo; /* OPTIONAL */ -} Z_DatabaseInfo; - -typedef struct Z_TagTypeMapping -{ - int *tagType; - Odr_oid *tagSet; /* OPTIONAL */ - Odr_null *defaultTagType; /* OPTIONAL */ -} Z_TagTypeMapping; - -typedef struct Z_PathUnit -{ - int *tagType; - Z_StringOrNumeric *tagValue; -} Z_PathUnit; - -typedef struct Z_Path -{ - int num; - Z_PathUnit **list; -} Z_Path; - -struct Z_ElementDataType; -typedef struct Z_ElementDataType Z_ElementDataType; - -typedef struct Z_ElementInfo -{ - char *elementName; - Z_Path *elementTagPath; - Z_ElementDataType *dataType; /* OPTIONAL */ - bool_t *required; - bool_t *repeatable; - Z_HumanString *description; /* OPTIONAL */ -} Z_ElementInfo; - -typedef struct Z_ElementInfoList -{ - int num; - Z_ElementInfo **list; -} Z_ElementInfoList; - -struct Z_ElementDataType -{ - int which; -#define Z_ElementDataType_primitive 0 -#define Z_ElementDataType_structured 1 - union - { - int *primitive; -#define Z_PrimitiveDataType_octetString 0 -#define Z_PrimitiveDataType_numeric 1 -#define Z_PrimitiveDataType_date 2 -#define Z_PrimitiveDataType_external 3 -#define Z_PrimitiveDataType_string 4 -#define Z_PrimitiveDataType_trueOrFalse 5 -#define Z_PrimitiveDataType_oid 6 -#define Z_PrimitiveDataType_intUnit 7 -#define Z_PrimitiveDataType_empty 8 -#define Z_PrimitiveDataType_noneOfTheAbove 100 - Z_ElementInfoList *structured; - } u; -}; - -typedef struct Z_TagSetInfoElements -{ - char *elementname; - int num_nicknames; - char **nicknames; /* OPTIONAL */ - Z_StringOrNumeric *elementTag; - Z_HumanString *description; /* OPTIONAL */ - int *dataType; /* OPTIONAL */ - /* (value as in Z_PrimitiveElement) */ - Z_OtherInformation *otherTagInfo; /* OPTIONAL */ -} Z_TagSetInfoElements; - -typedef struct Z_SchemaInfo -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key elements - */ - Odr_oid *schema; - /* - * Non-key elements - */ - char *name; - /* - * Non-brief elements - */ - Z_HumanString *description; /* OPTIONAL */ - int num_tagTypeMapping; - Z_TagTypeMapping **tagTypeMapping; /* OPTIONAL */ - int num_recordStructure; - Z_ElementInfo **recordStructure; /* OPTIONAL */ -} Z_SchemaInfo; - - -typedef struct Z_TagSetInfo -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key elements - */ - Odr_oid *tagSet; - /* - * Non-key elements - */ - char *name; - /* - * Non-brief elements - */ - Z_HumanString *description; /* OPTIONAL */ - int num_elements; - Z_TagSetInfoElements **elements; /* OPTIONAL */ -} Z_TagSetInfo; - -typedef struct Z_RecordSyntaxInfo -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key elements - */ - Odr_oid *recordSyntax; - /* - * Non-key elements - */ - char *name; - /* - * Non-brief elements - */ - int num_transferSyntaxes; - Odr_oid **transferSyntaxes; /* OPTIONAL */ - Z_HumanString *description; /* OPTIONAL */ - char *asn1Module; /* OPTIONAL */ - int num_abstractStructure; - Z_ElementInfo **abstractStructure; /* OPTIONAL */ -} Z_RecordSyntaxInfo; - -typedef struct Z_AttributeDescription -{ - char *name; /* OPTIONAL */ - Z_HumanString *description; /* OPTIONAL */ - Z_StringOrNumeric *attributeValue; - int num_equivalentAttributes; - Z_StringOrNumeric **equivalentAttributes; /* OPTIONAL */ -} Z_AttributeDescription; - -typedef struct Z_AttributeType -{ - char *name; /* OPTIONAL */ - Z_HumanString *description; /* OPTIONAL */ - int *attributeType; - int num_attributeValues; - Z_AttributeDescription **attributeValues; -} Z_AttributeType; - -typedef struct Z_AttributeSetInfo -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key elements - */ - Odr_oid *attributeSet; - /* - * Non-key elements - */ - char *name; - /* - * Non-brief elements - */ - int num_attributes; - Z_AttributeType **attributes; /* OPTIONAL */ - Z_HumanString *description; /* OPTIONAL */ -} Z_AttributeSetInfo; - -typedef struct Z_TermListElement -{ - char *name; - Z_HumanString *title; /* OPTIONAL */ - int *searchCost; /* OPTIONAL */ -#define Z_TermListElement_optimized 0 -#define Z_TermListElement_normal 1 -#define Z_TermListElement_expensive 2 -#define Z_TermListElement_filter 3 - bool_t *scanable; - int num_broader; - char **broader; /* OPTIONAL */ - int num_narrower; - char **narrower; /* OPTIONAL */ -} Z_TermListElement; - -typedef struct Z_TermListInfo -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key elements - */ - Z_DatabaseName *databaseName; - /* - * Non-key elements - */ - int num_termLists; - Z_TermListElement **termLists; -} Z_TermListInfo; - -typedef struct Z_ExtendedServicesInfo -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key elements - */ - Odr_oid *type; - /* - * Non-key elements - */ - char *name; /* OPTIONAL */ - bool_t *privateType; - bool_t *restrictionsApply; - bool_t *feeApply; - bool_t *available; - bool_t *retentionSupported; - int *waitAction; -#define Z_ExtendedServicesInfo_waitSupported 1 -#define Z_ExtendedServicesInfo_waitAlways 2 -#define Z_ExtendedServicesInfo_waitNotSupported 3 -#define Z_ExtendedServicesInfo_depends 4 -#define Z_ExtendedServicesInfo_notSaying 5 - /* - * Non-brief elements - */ - Z_HumanString *description; /* OPTIONAL */ - Z_External *specificExplain; /* OPTIONAL */ - char *esASN; /* OPTIONAL */ -} Z_ExtendedServicesInfo; - -typedef struct Z_OmittedAttributeInterpretation -{ - Z_StringOrNumeric *defaultValue; /* OPTIONAL */ - Z_HumanString *defaultDescription; /* OPTIONAL */ -} Z_OmittedAttributeInterpretation; - -typedef struct Z_AttributeTypeDetails -{ - int *attributeType; - Z_OmittedAttributeInterpretation *defaultIfOmitted; /* OPTIONAL */ - int num_attributeValues; - Z_AttributeValue **attributeValues; /* OPTIONAL */ -} Z_AttributeTypeDetails; - -typedef struct Z_AttributeSetDetails -{ - Odr_oid *attributeSet; - int num_attributesByType; - Z_AttributeTypeDetails **attributesByType; -} Z_AttributeSetDetails; - -typedef struct Z_AttributeDetails -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key details - */ - Z_DatabaseName *databaseName; - /* - * Non-brief elements - */ - int num_attributesBySet; - Z_AttributeSetDetails **attributesBySet; /* OPTIONAL */ - Z_AttributeCombinations *attributeCombinations; /* OPTIONAL */ -} Z_AttributeDetails; - -typedef struct Z_EScanInfo -{ - int *maxStepSize; /* OPTIONAL */ - Z_HumanString *collatingSequence; /* OPTIONAL */ - bool_t *increasing; /* OPTIONAL */ -} Z_EScanInfo; - -typedef struct Z_TermListDetails -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key elements - */ - char *termListName; - /* - * Non-brief elements - */ - Z_HumanString *description; /* OPTIONAL */ - Z_AttributeCombinations *attributes; /* OPTIONAL */ - Z_EScanInfo *scanInfo; /* OPTIONAL */ - int *estNumberTerms; /* OPTIONAL */ - int num_sampleTerms; - Z_Term **sampleTerms; /* OPTIONAL */ -} Z_TermListDetails; - -typedef struct Z_RecordTag -{ - Z_StringOrNumeric *qualifier; /* OPTIONAL */ - Z_StringOrNumeric *tagValue; -} Z_RecordTag; - -typedef struct Z_PerElementDetails -{ - char *name; /* OPTIONAL */ - Z_RecordTag *recordTag; /* OPTIONAL */ - int num_schemaTags; - Z_Path **schemaTags; /* OPTIONAL */ - int *maxSize; /* OPTIONAL */ - int *minSize; /* OPTIONAL */ - int *avgSize; /* OPTIONAL */ - int *fixedSize; /* OPTIONAL */ - bool_t *repeatable; - bool_t *required; - Z_HumanString *description; /* OPTIONAL */ - Z_HumanString *contents; /* OPTIONAL */ - Z_HumanString *billingInfo; /* OPTIONAL */ - Z_HumanString *restrictions; /* OPTIONAL */ - int num_alternateNames; - char **alternateNames; /* OPTIONAL */ - int num_genericNames; - char **genericNames; /* OPTIONAL */ - Z_AttributeCombinations *searchAccess; /* OPTIONAL */ -} Z_PerElementDetails; - -typedef struct Z_ElementSetDetails -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key elements - */ - Z_DatabaseName *databaseName; - char *elementSetName; - Odr_oid *recordSyntax; - /* - * Brief elements - */ - Odr_oid *schema; - /* - * Non-brief elements - */ - Z_HumanString *description; /* OPTIONAL */ - int num_detailsPerElement; - Z_PerElementDetails **detailsPerElement; /* OPTIONAL */ -} Z_ElementSetDetails; - -typedef struct Z_RetrievalRecordDetails -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key elements - */ - Z_DatabaseName *databaseName; - Odr_oid *schema; - Odr_oid *recordSyntax; - /* - * Non-brief elements - */ - Z_HumanString *description; /* OPTIONAL */ - int num_detailsPerElement; - Z_PerElementDetails **detailsPerElement; /* OPTIONAL */ -} Z_RetrievalRecordDetails; - -typedef struct Z_SortKeyDetails -{ - Z_HumanString *description; /* OPTIONAL */ - int num_elementSpecifications; - Z_Specification **elementSpecifications; /* OPTIONAL */ - Z_AttributeCombinations *attributeSpecifications; /* OPTIONAL */ - int which; -#define Z_SortKeyDetails_character 0 -#define Z_SortKeyDetails_numeric 1 -#define Z_SortKeyDetails_structured 2 - union - { - Odr_null *character; - Odr_null *numeric; - Z_HumanString *structured; - } u; - int *caseSensitivity; /* OPTIONAL */ -#define Z_SortKeyDetails_always 0 -#define Z_SortKeyDetails_never 1 -#define Z_SortKeyDetails_default_yes 2 -#define Z_SortKeyDetails_default_no 3 -} Z_SortKeyDetails; - -typedef struct Z_SortDetails -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key elements - */ - Z_DatabaseName *databaseName; - /* - * Non-brief elements - */ - int num_sortKeys; - Z_SortKeyDetails **sortKeys; /* OPTIONAL */ -} Z_SortDetails; - -typedef struct Z_ProcessingInformation -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key elements - */ - Z_DatabaseName *databaseName; - int *processingContext; -#define Z_ProcessingInformation_access 0 -#define Z_ProcessingInformation_search 1 -#define Z_ProcessingInformation_retrieval 2 -#define Z_ProcessingInformation_record_presentation 3 -#define Z_ProcessingInformation_record_handling 4 - char *name; - Odr_oid *oid; - /* - * Non-brief elements - */ - Z_HumanString *description; /* OPTIONAL */ - Z_External *instructions; /* OPTIONAL */ -} Z_ProcessingInformation; - -typedef struct Z_ValueDescription -{ - int which; -#define Z_ValueDescription_integer 0 -#define Z_ValueDescription_string 1 -#define Z_ValueDescription_octets 2 -#define Z_ValueDescription_oid 3 -#define Z_ValueDescription_unit 4 -#define Z_ValueDescription_valueAndUnit 5 - union - { - int *integer; - char *string; - Odr_oct *octets; - Odr_oid *oid; - Z_Unit *unit; - Z_IntUnit *valueAndUnit; - } u; -} Z_ValueDescription; - -typedef struct Z_ValueRange -{ - Z_ValueDescription *lower; /* OPTIONAL */ - Z_ValueDescription *upper; /* OPTIONAL */ -} Z_ValueRange; - -typedef struct Z_ValueSetEnumerated -{ - int num; - Z_ValueDescription **elements; -} Z_ValueSetEnumerated; - -typedef struct Z_ValueSet -{ - int which; -#define Z_ValueSet_range 0 -#define Z_ValueSet_enumerated 1 - union - { - Z_ValueRange *range; - Z_ValueSetEnumerated *enumerated; - } u; -} Z_ValueSet; - -typedef struct Z_VariantValue -{ - int *dataType; - Z_ValueSet *values; /* OPTIONAL */ -} Z_VariantValue; - -typedef struct Z_VariantType -{ - char *name; /* OPTIONAL */ - Z_HumanString *description; /* OPTIONAL */ - int *variantType; - Z_VariantValue *variantValue; /* OPTIONAL */ -} Z_VariantType; - -typedef struct Z_VariantClass -{ - char *name; /* OPTIONAL */ - Z_HumanString *description; /* OPTIONAL */ - int *variantClass; - int num_variantTypes; - Z_VariantType **variantTypes; -} Z_VariantClass; - -typedef struct Z_VariantSetInfo -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key elements - */ - Odr_oid *variantSet; - /* - * Brief elements - */ - char *name; - /* - * Non-brief elements - */ - int num_variants; - Z_VariantClass **variants; /* OPTIONAL */ -} Z_VariantSetInfo; - -typedef struct Z_Units -{ - char *name; /* OPTIONAL */ - Z_HumanString *description; /* OPTIONAL */ - Z_StringOrNumeric *unit; -} Z_Units; - -typedef struct Z_UnitType -{ - char *name; /* OPTIONAL */ - Z_HumanString *description; /* OPTIONAL */ - Z_StringOrNumeric *unitType; - int num_units; - Z_Units **units; -} Z_UnitType; - -typedef struct Z_UnitInfo -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - /* - * Key elements - */ - char *unitSystem; - /* - * Non-brief elements - */ - Z_HumanString *description; /* OPTIONAL */ - int num_units; - Z_UnitType **units; /* OPTIONAL */ -} Z_UnitInfo; - -typedef struct Z_CategoryInfo -{ - char *category; - char *originalCategory; /* OPTIONAL */ - Z_HumanString *description; /* OPTIONAL */ - char *asn1Module; /* OPTIONAL */ -} Z_CategoryInfo; - -typedef struct Z_CategoryList -{ - Z_CommonInfo *commonInfo; /* OPTIONAL */ - int num_categories; - Z_CategoryInfo **categories; -} Z_CategoryList; - -typedef struct Z_ExplainRecord -{ - int which; -#define Z_Explain_targetInfo 0 -#define Z_Explain_databaseInfo 1 -#define Z_Explain_schemaInfo 2 -#define Z_Explain_tagSetInfo 3 -#define Z_Explain_recordSyntaxInfo 4 -#define Z_Explain_attributeSetInfo 5 -#define Z_Explain_termListInfo 6 -#define Z_Explain_extendedServicesInfo 7 -#define Z_Explain_attributeDetails 8 -#define Z_Explain_termListDetails 9 -#define Z_Explain_elementSetDetails 10 -#define Z_Explain_retrievalRecordDetails 11 -#define Z_Explain_sortDetails 12 -#define Z_Explain_processing 13 -#define Z_Explain_variants 14 -#define Z_Explain_units 15 -#define Z_Explain_categoryList 16 - union - { - Z_TargetInfo *targetInfo; - Z_DatabaseInfo *databaseInfo; - Z_SchemaInfo *schemaInfo; - Z_TagSetInfo *tagSetInfo; - Z_RecordSyntaxInfo *recordSyntaxInfo; - Z_AttributeSetInfo *attributeSetInfo; - Z_TermListInfo *termListInfo; - Z_ExtendedServicesInfo *extendedServicesInfo; - Z_AttributeDetails *attributeDetails; - Z_TermListDetails *termListDetails; - Z_ElementSetDetails *elementSetDetails; - Z_RetrievalRecordDetails *retrievalRecordDetails; - Z_SortDetails *sortDetails; - Z_ProcessingInformation *processing; - Z_VariantSetInfo *variants; - Z_UnitInfo *units; - Z_CategoryList *categoryList; - } u; -} Z_ExplainRecord; - -YAZ_EXPORT int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt, - const char *name); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/asn/prt-ext.h b/asn/prt-ext.h deleted file mode 100644 index d3e5bf8..0000000 --- a/asn/prt-ext.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 1995-1999, Index Data. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of Index Data or the individual authors may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR - * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - */ - -/* - * Biased-choice External for Z39.50. - */ - -#ifndef PRT_EXT_H -#define PRT_EXT_H - -#include -#include - - -YAZ_BEGIN_CDECL - -/* - * Used to keep track of known External definitions (a loose approach - * to DEFINED_BY). - */ - -typedef struct Z_ext_typeent -{ - oid_value dref; /* the direct-reference OID value. */ - int what; /* discriminator value for the external CHOICE */ - Odr_fun fun; /* decoder function */ -} Z_ext_typeent; - -struct Z_External -{ - Odr_oid *direct_reference; - int *indirect_reference; - char *descriptor; - int which; -/* Generic types */ -#define Z_External_single 0 -#define Z_External_octet 1 -#define Z_External_arbitrary 2 -/* Specific types */ -#define Z_External_sutrs 3 -#define Z_External_explainRecord 4 -#define Z_External_resourceReport1 5 -#define Z_External_resourceReport2 6 -#define Z_External_promptObject1 7 -#define Z_External_grs1 8 -#define Z_External_extendedService 9 -#define Z_External_itemOrder 10 -#define Z_External_diag1 11 -#define Z_External_espec1 12 -#define Z_External_summary 13 -#define Z_External_OPAC 14 -#define Z_External_searchResult1 15 -#define Z_External_update 16 -#define Z_External_dateTime 17 -#define Z_External_universeReport 18 -#define Z_External_ESAdmin 19 - union - { - /* Generic types */ - Odr_any *single_ASN1_type; - Odr_oct *octet_aligned; - Odr_bitmask *arbitrary; - - /* Specific types */ - Z_SUTRS *sutrs; - Z_ExplainRecord *explainRecord; - Z_ResourceReport1 *resourceReport1; - Z_ResourceReport2 *resourceReport2; - Z_PromptObject1 *promptObject1; - Z_GenericRecord *grs1; - Z_TaskPackage *extendedService; - Z_ItemOrder *itemOrder; - Z_DiagnosticFormat *diag1; - Z_Espec1 *espec1; - Z_BriefBib *summary; - Z_SearchInfoReport *searchResult1; - Z_IUUpdate *update; - Z_DateTime *dateTime; - Z_UniverseReport *universeReport; -#ifdef ASN_COMPILED - Z_Admin *adminService; -#endif - } u; -}; - - -YAZ_EXPORT int z_External(ODR o, Z_External **p, int opt, const char *name); -YAZ_EXPORT Z_ext_typeent *z_ext_getentbyref(oid_value val); -YAZ_EXPORT Z_External *z_ext_record(ODR o, int format, const char *buf, - int len); - -YAZ_END_CDECL - -#endif diff --git a/asn/prt-grs.c b/asn/prt-grs.c deleted file mode 100644 index 9386b76..0000000 --- a/asn/prt-grs.c +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright (c) 1995-1999, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: prt-grs.c,v $ - * Revision 1.9 1999-11-30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.8 1999/04/20 09:56:48 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.7 1998/02/11 11:53:32 adam - * Changed code so that it compiles as C++. - * - * Revision 1.6 1997/05/14 06:53:23 adam - * C++ support. - * - * Revision 1.5 1995/10/18 16:12:20 quinn - * Added a couple of special cases to handle the WAIS server. - * - * Revision 1.4 1995/09/29 17:11:55 quinn - * Smallish - * - * Revision 1.3 1995/09/27 15:02:43 quinn - * Modified function heads & prototypes. - * - * Revision 1.2 1995/08/28 10:58:58 quinn - * Added extra choice-entry to data to catch visiblestring. - * - * Revision 1.1 1995/08/17 12:47:09 quinn - * Added GRS-1. - * - * - */ - -#include - -int z_TaggedElement(ODR o, Z_TaggedElement **p, int opt, const char *name); -int z_ElementData(ODR o, Z_ElementData **p, int opt, const char *name); -int z_ElementMetaData(ODR o, Z_ElementMetaData **p, int opt, const char *name); -int z_TagUnit(ODR o, Z_TagUnit **p, int opt, const char *name); -int z_TagPath(ODR o, Z_TagPath **p, int opt, const char *name); -int z_Order(ODR o, Z_Order **p, int opt, const char *name); -int z_Usage(ODR o, Z_Usage **p, int opt, const char *name); -int z_HitVector(ODR o, Z_HitVector **p, int opt, const char *name); -int z_Triple(ODR o, Z_Triple **p, int opt, const char *name); -int z_Variant(ODR o, Z_Variant **p, int opt, const char *name); - -int z_GenericRecord(ODR o, Z_GenericRecord **p, int opt, const char *name) -{ - if (o->direction == ODR_DECODE) - *p = (Z_GenericRecord *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_sequence_of(o, (Odr_fun)z_TaggedElement, &(*p)->elements, - &(*p)->num_elements, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_TaggedElement(ODR o, Z_TaggedElement **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->tagType, - ODR_CONTEXT, 1, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->tagValue, - ODR_CONTEXT, 2, 0) && - odr_implicit(o, odr_integer, &(*p)->tagOccurrence, - ODR_CONTEXT, 3, 1) && - odr_explicit(o, z_ElementData, &(*p)->content, - ODR_CONTEXT, 4, 0) && - odr_implicit(o, z_ElementMetaData, &(*p)->metaData, - ODR_CONTEXT, 5, 1) && - odr_implicit(o, z_Variant, &(*p)->appliedVariant, ODR_CONTEXT, 6, 1) && - odr_sequence_end(o); -} - -int z_ElementData(ODR o, Z_ElementData **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_NONE, -1, -1, Z_ElementData_octets, - (Odr_fun)odr_octetstring, 0}, - {ODR_NONE, -1, -1, Z_ElementData_numeric, - (Odr_fun)odr_integer, 0}, - {ODR_NONE, -1, -1, Z_ElementData_date, - (Odr_fun)odr_generalizedtime, 0}, - {ODR_NONE, -1, -1, Z_ElementData_ext, - (Odr_fun)z_External, 0}, - {ODR_NONE, -1, -1, Z_ElementData_string, - (Odr_fun)z_InternationalString, 0}, - /* The entry below provides some backwards compatibility */ - {ODR_NONE, -1, -1, Z_ElementData_string, - (Odr_fun)odr_visiblestring, 0}, - {ODR_NONE, -1, -1, Z_ElementData_trueOrFalse, - (Odr_fun)odr_bool, 0}, - {ODR_NONE, -1, -1, Z_ElementData_oid, - (Odr_fun)odr_oid, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementData_intUnit, - (Odr_fun)z_IntUnit, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ElementData_elementNotThere, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ElementData_elementEmpty, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_ElementData_noDataRequested, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_ElementData_diagnostic, - (Odr_fun)z_External, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 6, Z_ElementData_subtree, - (Odr_fun)z_GenericRecord, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (o->direction == ODR_DECODE) - *p = (Z_ElementData *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_ElementMetaData(ODR o, Z_ElementMetaData **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, z_Order, &(*p)->seriesOrder, ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_Usage, &(*p)->usageRight, ODR_CONTEXT, 2, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 3) && - (odr_sequence_of(o, (Odr_fun)z_HitVector, &(*p)->hits, - &(*p)->num_hits, 0) || - odr_ok(o)) && - odr_implicit(o, z_InternationalString, &(*p)->displayName, - ODR_CONTEXT, 4, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 5) && - (odr_sequence_of(o, (Odr_fun)z_Variant, &(*p)->supportedVariants, - &(*p)->num_supportedVariants, 0) || odr_ok(o)) && - odr_implicit(o, z_InternationalString, &(*p)->message, - ODR_CONTEXT, 6, 1) && - odr_implicit(o, odr_octetstring, &(*p)->elementDescriptor, - ODR_CONTEXT, 7, 1) && - odr_implicit(o, z_TagPath, &(*p)->surrogateFor, ODR_CONTEXT, 8, 1) && - odr_implicit(o, z_TagPath, &(*p)->surrogateElement, - ODR_CONTEXT, 9, 1) && - odr_implicit(o, z_External, &(*p)->other, ODR_CONTEXT, 99, 1) && - odr_sequence_end(o); -} - -int z_TagUnit(ODR o, Z_TagUnit **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->tagType, ODR_CONTEXT, 1, 1) && - odr_explicit(o, z_StringOrNumeric, &(*p)->tagValue, - ODR_CONTEXT, 2, 0) && - odr_implicit(o, odr_integer, &(*p)->tagOccurrence, - ODR_CONTEXT, 3, 1) && - odr_sequence_end(o); -} - -int z_TagPath(ODR o, Z_TagPath **p, int opt, const char *name) -{ - if (o->direction == ODR_DECODE) - *p = (Z_TagPath *)odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - if (odr_sequence_of(o, (Odr_fun)z_TagUnit, &(*p)->tags, - &(*p)->num_tags, 0)) - return 1; - *p = 0; - return opt && odr_ok(o); -} - -int z_Order(ODR o, Z_Order **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_bool, &(*p)->ascending, ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->order, ODR_CONTEXT, 2, 0) && - odr_sequence_end(o); -} - -int z_Usage(ODR o, Z_Usage **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->type, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_InternationalString, &(*p)->restriction, ODR_CONTEXT, - 2, 1) && - odr_sequence_end(o); -} - -int z_HitVector(ODR o, Z_HitVector **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - z_Term(o, &(*p)->satisfier, 1, 0) && - odr_implicit(o, z_IntUnit, &(*p)->offsetIntoElement, - ODR_CONTEXT, 1, 1) && - odr_implicit(o, z_IntUnit, &(*p)->length, ODR_CONTEXT, 2, 1) && - odr_implicit(o, odr_integer, &(*p)->hitRank, ODR_CONTEXT, 3, 1) && - odr_implicit(o, odr_octetstring, &(*p)->targetToken, ODR_CONTEXT, - 4, 1) && - odr_sequence_end(o); -} - -int z_Triple(ODR o, Z_Triple **p, int opt, const char *name) -{ - static Odr_arm arm[] = - { - {ODR_NONE, -1, -1, Z_Triple_integer, - (Odr_fun)odr_integer, 0}, - {ODR_NONE, -1, -1, Z_Triple_internationalString, - (Odr_fun)z_InternationalString, 0}, - /* The entry below provides some backwards compatibility */ - {ODR_NONE, -1, -1, Z_Triple_internationalString, - (Odr_fun)odr_visiblestring, 0}, - {ODR_NONE, -1, -1, Z_Triple_octetString, - (Odr_fun)odr_octetstring, 0}, - {ODR_NONE, -1, -1, Z_Triple_oid, - (Odr_fun)odr_oid, 0}, - {ODR_NONE, -1, -1, Z_Triple_boolean, - (Odr_fun)odr_bool, 0}, - {ODR_NONE, -1, -1, Z_Triple_null, - (Odr_fun)odr_null, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Triple_unit, - (Odr_fun)z_Unit, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Triple_valueAndUnit, - (Odr_fun)z_IntUnit, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_oid, &(*p)->variantSetId, ODR_CONTEXT, 0, 1) && - odr_implicit(o, odr_integer, &(*p)->zclass, ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->type, ODR_CONTEXT, 2, 0) && - odr_constructed_begin(o, &(*p)->value, ODR_CONTEXT, 3, 0) && - odr_choice(o, arm, &(*p)->value, &(*p)->which, 0) && - odr_constructed_end(o) && - odr_sequence_end(o); -} - -int z_Variant(ODR o, Z_Variant **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_oid, &(*p)->globalVariantSetId, - ODR_CONTEXT, 1, 1) && - odr_implicit_settag(o, ODR_CONTEXT, 2) && - odr_sequence_of(o, (Odr_fun)z_Triple, &(*p)->triples, - &(*p)->num_triples, 0) && - odr_sequence_end(o); -} diff --git a/asn/prt-grs.h b/asn/prt-grs.h deleted file mode 100644 index c7f5f07..0000000 --- a/asn/prt-grs.h +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (c) 1995-1998, Index Data. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of Index Data or the individual authors may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR - * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - */ - -#ifndef PRT_GRS_H -#define PRT_GRS_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct Z_GenericRecord; -typedef struct Z_GenericRecord Z_GenericRecord; - -typedef struct Z_ElementData -{ - int which; -#define Z_ElementData_octets 0 -#define Z_ElementData_numeric 1 -#define Z_ElementData_date 2 -#define Z_ElementData_ext 3 -#define Z_ElementData_string 4 -#define Z_ElementData_trueOrFalse 5 -#define Z_ElementData_oid 6 -#define Z_ElementData_intUnit 7 -#define Z_ElementData_elementNotThere 8 -#define Z_ElementData_elementEmpty 9 -#define Z_ElementData_noDataRequested 10 -#define Z_ElementData_diagnostic 11 -#define Z_ElementData_subtree 12 - union - { - Odr_oct *octets; - int *numeric; - char *date; - Z_External *ext; - char *string; - bool_t *trueOrFalse; - Odr_oid *oid; - Z_IntUnit *intUnit; - Odr_null *elementNotThere; - Odr_null *elementEmpty; - Odr_null *noDataRequested; - Z_External *diagnostic; - Z_GenericRecord *subtree; - } u; -} Z_ElementData; - -typedef struct Z_Order -{ - bool_t *ascending; - int *order; -} Z_Order; - -typedef struct Z_Usage -{ - int *type; -#define Z_Usage_redistributable 1 -#define Z_Usage_restricted 2 -#define Z_Usage_licensePointer 3 - char *restriction; /* OPTIONAL */ -} Z_Usage; - -typedef struct Z_HitVector -{ - Z_Term *satisfier; /* OPTIONAL */ - Z_IntUnit *offsetIntoElement; /* OPTIONAL */ - Z_IntUnit *length; /* OPTIONAL */ - int *hitRank; /* OPTIONAL */ - Odr_oct *targetToken; /* OPTIONAL */ -} Z_HitVector; - -typedef struct Z_Triple -{ - Odr_oid *variantSetId; /* OPTIONAL */ - int *zclass; - int *type; - int which; -#define Z_Triple_integer 0 -#define Z_Triple_internationalString 1 -#define Z_Triple_octetString 2 -#define Z_Triple_oid 3 -#define Z_Triple_boolean 4 -#define Z_Triple_null 5 -#define Z_Triple_unit 6 -#define Z_Triple_valueAndUnit 7 - union - { - int *integer; - char *internationalString; - Odr_oct *octetString; - Odr_oid *oid; - bool_t *zboolean; - Odr_null *null; - Z_Unit *unit; - Z_IntUnit *valueAndUnit; - } value; -} Z_Triple; - -typedef struct Z_Variant -{ - Odr_oid *globalVariantSetId; /* OPTIONAL */ - int num_triples; - Z_Triple **triples; -} Z_Variant; - -typedef struct Z_TagUnit -{ - int *tagType; /* OPTIONAL */ - Z_StringOrNumeric *tagValue; - int *tagOccurrence; /* OPTIONAL */ -} Z_TagUnit; - -typedef struct Z_TagPath -{ - int num_tags; - Z_TagUnit **tags; -} Z_TagPath; - -typedef struct Z_ElementMetaData -{ - Z_Order *seriesOrder; /* OPTIONAL */ - Z_Usage *usageRight; /* OPTIONAL */ - int num_hits; - Z_HitVector **hits; /* OPTIONAL */ - char *displayName; /* OPTIONAL */ - int num_supportedVariants; - Z_Variant **supportedVariants; /* OPTIONAL */ - char *message; /* OPTIONAL */ - Odr_oct *elementDescriptor; /* OPTIONAL */ - Z_TagPath *surrogateFor; /* OPTIONAL */ - Z_TagPath *surrogateElement; /* OPTIONAL */ - Z_External *other; /* OPTIONAL */ -} Z_ElementMetaData; - -typedef struct Z_TaggedElement -{ - int *tagType; /* OPTIONAL */ - Z_StringOrNumeric *tagValue; - int *tagOccurrence; /* OPTIONAL */ - Z_ElementData *content; - Z_ElementMetaData *metaData; /* OPTIONAL */ - Z_Variant *appliedVariant; /* OPTIONAL */ -} Z_TaggedElement; - -struct Z_GenericRecord -{ - int num_elements; - Z_TaggedElement **elements; -}; - -YAZ_EXPORT int z_GenericRecord(ODR o, Z_GenericRecord **p, int opt, - const char *name); -YAZ_EXPORT int z_Variant(ODR o, Z_Variant **p, int opt, - const char *name); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/asn/prt-proto.h b/asn/prt-proto.h deleted file mode 100644 index 2d5efb6..0000000 --- a/asn/prt-proto.h +++ /dev/null @@ -1,1170 +0,0 @@ -/* - * Copyright (c) 1995-2001, Index Data. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The name of Index Data or the individual authors may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR - * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - * $Id: prt-proto.h,v 1.3 2001-09-24 21:51:55 adam Exp $ - */ - -#ifndef PRT_PROTO_H -#define PRT_PROTO_H - -#include -#include -#include -#include - -YAZ_BEGIN_CDECL - -/* ----------------- GLOBAL AUXILIARY DEFS ----------------*/ - -struct Z_External; -typedef struct Z_External Z_External; - -typedef Odr_oct Z_ReferenceId; -typedef char Z_DatabaseName; -typedef char Z_ResultSetId; -typedef Odr_oct Z_ResultsetId; - -typedef struct Z_InfoCategory -{ - Odr_oid *categoryTypeId; /* OPTIONAL */ - int *categoryValue; -} Z_InfoCategory; - -typedef struct Z_OtherInformationUnit -{ - Z_InfoCategory *category; /* OPTIONAL */ - int which; -#define Z_OtherInfo_characterInfo 0 -#define Z_OtherInfo_binaryInfo 1 -#define Z_OtherInfo_externallyDefinedInfo 2 -#define Z_OtherInfo_oid 3 - union - { - char *characterInfo; - Odr_oct *binaryInfo; - Z_External *externallyDefinedInfo; - Odr_oid *oid; - } information; -} Z_OtherInformationUnit; - -typedef struct Z_OtherInformation -{ - int num_elements; - Z_OtherInformationUnit **list; -} Z_OtherInformation; - -typedef struct Z_StringOrNumeric -{ - int which; -#define Z_StringOrNumeric_string 0 -#define Z_StringOrNumeric_numeric 1 - union - { - char *string; - int *numeric; - } u; -} Z_StringOrNumeric; - -typedef struct Z_Unit -{ - char *unitSystem; /* OPTIONAL */ - Z_StringOrNumeric *unitType; /* OPTIONAL */ - Z_StringOrNumeric *unit; /* OPTIONAL */ - int *scaleFactor; /* OPTIONAL */ -} Z_Unit; - -typedef struct Z_IntUnit -{ - int *value; - Z_Unit *unitUsed; -} Z_IntUnit; - -typedef Odr_oct Z_SUTRS; - -typedef struct Z_StringList -{ - int num_strings; - char **strings; -} Z_StringList; - -/* ----------------- INIT SERVICE ----------------*/ - -typedef struct -{ - char *groupId; /* OPTIONAL */ - char *userId; /* OPTIONAL */ - char *password; /* OPTIONAL */ -} Z_IdPass; - -typedef struct Z_IdAuthentication -{ - int which; -#define Z_IdAuthentication_open 0 -#define Z_IdAuthentication_idPass 1 -#define Z_IdAuthentication_anonymous 2 -#define Z_IdAuthentication_other 3 - union - { - char *open; - Z_IdPass *idPass; - Odr_null *anonymous; - Z_External *other; - } u; -} Z_IdAuthentication; - -#define Z_ProtocolVersion_1 0 -#define Z_ProtocolVersion_2 1 -#define Z_ProtocolVersion_3 2 - -#define Z_Options_search 0 -#define Z_Options_present 1 -#define Z_Options_delSet 2 -#define Z_Options_resourceReport 3 -#define Z_Options_triggerResourceCtrl 4 -#define Z_Options_resourceCtrl 5 -#define Z_Options_accessCtrl 6 -#define Z_Options_scan 7 -#define Z_Options_sort 8 -#define Z_Options_reserved 9 -#define Z_Options_extendedServices 10 -#define Z_Options_level_1Segmentation 11 -#define Z_Options_level_2Segmentation 12 -#define Z_Options_concurrentOperations 13 -#define Z_Options_namedResultSets 14 - -typedef struct Z_InitRequest -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - Odr_bitmask *protocolVersion; - Odr_bitmask *options; - int *preferredMessageSize; - int *maximumRecordSize; - Z_IdAuthentication* idAuthentication; /* OPTIONAL */ - char *implementationId; /* OPTIONAL */ - char *implementationName; /* OPTIONAL */ - char *implementationVersion; /* OPTIONAL */ - Z_External *userInformationField; /* OPTIONAL */ - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_InitRequest; - -typedef struct Z_InitResponse -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - Odr_bitmask *protocolVersion; - Odr_bitmask *options; - int *preferredMessageSize; - int *maximumRecordSize; - bool_t *result; - char *implementationId; /* OPTIONAL */ - char *implementationName; /* OPTIONAL */ - char *implementationVersion; /* OPTIONAL */ - Z_External *userInformationField; /* OPTIONAL */ - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_InitResponse; - -typedef struct Z_NSRAuthentication -{ - char *user; - char *password; - char *account; -} Z_NSRAuthentication; - -int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt, - const char *name); - -int z_StrAuthentication(ODR o, char **p, int opt, const char *name); - -/* ------------------ SEARCH SERVICE ----------------*/ - -typedef struct Z_DatabaseSpecificUnit -{ - char *databaseName; - char *elementSetName; -} Z_DatabaseSpecificUnit; - -typedef struct Z_DatabaseSpecific -{ - int num_elements; - Z_DatabaseSpecificUnit **elements; -} Z_DatabaseSpecific; - -typedef struct Z_ElementSetNames -{ - int which; -#define Z_ElementSetNames_generic 0 -#define Z_ElementSetNames_databaseSpecific 1 - union - { - char *generic; - Z_DatabaseSpecific *databaseSpecific; - } u; -} Z_ElementSetNames; - -/* ---------------------- RPN QUERY --------------------------- */ - -typedef struct Z_ComplexAttribute -{ - int num_list; - Z_StringOrNumeric **list; - int num_semanticAction; - int **semanticAction; /* OPTIONAL */ -} Z_ComplexAttribute; - -typedef struct Z_AttributeElement -{ - Odr_oid *attributeSet; /* OPTIONAL - v3 only */ - int *attributeType; - int which; -#define Z_AttributeValue_numeric 0 -#define Z_AttributeValue_complex 1 - union - { - int *numeric; - Z_ComplexAttribute *complex; - } value; -} Z_AttributeElement; - -typedef struct Z_Term -{ - int which; -#define Z_Term_general 0 -#define Z_Term_numeric 1 -#define Z_Term_characterString 2 -#define Z_Term_oid 3 -#define Z_Term_dateTime 4 -#define Z_Term_external 5 -#define Z_Term_integerAndUnit 6 -#define Z_Term_null 7 - union - { - Odr_oct *general; /* this is required for v2 */ - int *numeric; - char *characterString; - Odr_oid *oid; - char *dateTime; - Z_External *external; - /* Z_IntUnit *integerAndUnit; */ - Odr_null *null; - } u; -} Z_Term; - -typedef struct Z_AttributesPlusTerm -{ - int num_attributes; - Z_AttributeElement **attributeList; - Z_Term *term; -} Z_AttributesPlusTerm; - -typedef struct Z_ResultSetPlusAttributes -{ - char *resultSet; - int num_attributes; - Z_AttributeElement **attributeList; -} Z_ResultSetPlusAttributes; - -typedef struct Z_ProximityOperator -{ - bool_t *exclusion; /* OPTIONAL */ - int *distance; - bool_t *ordered; - int *relationType; -#define Z_Prox_lessThan 1 -#define Z_Prox_lessThanOrEqual 2 -#define Z_Prox_equal 3 -#define Z_Prox_greaterThanOrEqual 4 -#define Z_Prox_greaterThan 5 -#define Z_Prox_notEqual 6 - int which; -#define Z_ProxCode_known 0 -#define Z_ProxCode_private 1 - int *proximityUnitCode; -#define Z_ProxUnit_character 1 -#define Z_ProxUnit_word 2 -#define Z_ProxUnit_sentence 3 -#define Z_ProxUnit_paragraph 4 -#define Z_ProxUnit_section 5 -#define Z_ProxUnit_chapter 6 -#define Z_ProxUnit_document 7 -#define Z_ProxUnit_element 8 -#define Z_ProxUnit_subelement 9 -#define Z_ProxUnit_elementType 10 -#define Z_ProxUnit_byte 11 /* v3 only */ -} Z_ProximityOperator; - -typedef struct Z_Operator -{ - int which; -#define Z_Operator_and 0 -#define Z_Operator_or 1 -#define Z_Operator_and_not 2 -#define Z_Operator_prox 3 - union - { - Odr_null *op_and; /* these guys are nulls. */ - Odr_null *op_or; - Odr_null *op_and_not; - Z_ProximityOperator *prox; - } u; -} Z_Operator; - -typedef struct Z_Operand -{ - int which; -#define Z_Operand_APT 0 -#define Z_Operand_resultSetId 1 -#define Z_Operand_resultAttr /* v3 only */ 2 - union - { - Z_AttributesPlusTerm *attributesPlusTerm; - Z_ResultSetId *resultSetId; - Z_ResultSetPlusAttributes *resultAttr; - } u; -} Z_Operand; - -typedef struct Z_Complex -{ - struct Z_RPNStructure *s1; - struct Z_RPNStructure *s2; - Z_Operator *roperator; -} Z_Complex; - -typedef struct Z_RPNStructure -{ - int which; -#define Z_RPNStructure_simple 0 -#define Z_RPNStructure_complex 1 - union - { - Z_Operand *simple; - Z_Complex *complex; - } u; -} Z_RPNStructure; - -typedef struct Z_RPNQuery -{ - Odr_oid *attributeSetId; - Z_RPNStructure *RPNStructure; -} Z_RPNQuery; - -/* -------------------------- SEARCHREQUEST -------------------------- */ - -typedef struct Z_Query -{ - int which; -#define Z_Query_type_1 1 -#define Z_Query_type_2 2 -#define Z_Query_type_101 3 - union - { - Z_RPNQuery *type_1; - Odr_oct *type_2; - Z_RPNQuery *type_101; - } u; -} Z_Query; - -typedef struct Z_SearchRequest -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int *smallSetUpperBound; - int *largeSetLowerBound; - int *mediumSetPresentNumber; - bool_t *replaceIndicator; - char *resultSetName; - int num_databaseNames; - char **databaseNames; - Z_ElementSetNames *smallSetElementSetNames; /* OPTIONAL */ - Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */ - Odr_oid *preferredRecordSyntax; /* OPTIONAL */ - Z_Query *query; - Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */ - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_SearchRequest; - -/* ------------------------ RECORD -------------------------- */ - -typedef Z_External Z_DatabaseRecord; - -typedef struct Z_DefaultDiagFormat -{ - Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */ - int *condition; - /* until the whole character set issue becomes more definite, - * you can probably ignore this on input. */ - int which; -#define Z_DiagForm_v2AddInfo 0 -#define Z_DiagForm_v3AddInfo 1 - char *addinfo; -} Z_DefaultDiagFormat; - -typedef struct Z_DiagRec -{ - int which; -#define Z_DiagRec_defaultFormat 0 -#define Z_DiagRec_externallyDefined 1 - union - { - Z_DefaultDiagFormat *defaultFormat; - Z_External *externallyDefined; - } u; -} Z_DiagRec; - -typedef struct Z_DiagRecs -{ - int num_diagRecs; - Z_DiagRec **diagRecs; -} Z_DiagRecs; - -typedef struct Z_NamePlusRecord -{ - char *databaseName; /* OPTIONAL */ - int which; -#define Z_NamePlusRecord_databaseRecord 0 -#define Z_NamePlusRecord_surrogateDiagnostic 1 - union - { - Z_DatabaseRecord *databaseRecord; - Z_DiagRec *surrogateDiagnostic; - } u; -} Z_NamePlusRecord; - -typedef struct Z_NamePlusRecordList -{ - int num_records; - Z_NamePlusRecord **records; -} Z_NamePlusRecordList; - -typedef struct Z_Records -{ - int which; -#define Z_Records_DBOSD 0 -#define Z_Records_NSD 1 -#define Z_Records_multipleNSD 2 - union - { - Z_NamePlusRecordList *databaseOrSurDiagnostics; - Z_DiagRec *nonSurrogateDiagnostic; - Z_DiagRecs *multipleNonSurDiagnostics; - } u; -} Z_Records; - -/* ------------------------ SEARCHRESPONSE ------------------ */ - -typedef struct Z_SearchResponse -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int *resultCount; - int *numberOfRecordsReturned; - int *nextResultSetPosition; - bool_t *searchStatus; - int *resultSetStatus; /* OPTIONAL */ -#define Z_RES_SUBSET 1 -#define Z_RES_INTERIM 2 -#define Z_RES_NONE 3 - int *presentStatus; /* OPTIONAL */ -#define Z_PRES_SUCCESS 0 -#define Z_PRES_PARTIAL_1 1 -#define Z_PRES_PARTIAL_2 2 -#define Z_PRES_PARTIAL_3 3 -#define Z_PRES_PARTIAL_4 4 -#define Z_PRES_FAILURE 5 - Z_Records *records; /* OPTIONAL */ - Z_OtherInformation *additionalSearchInfo; - Z_OtherInformation *otherInfo; -} Z_SearchResponse; - -/* ------------------------- PRESENT SERVICE -----------------*/ - -typedef struct Z_ElementSpec -{ - int which; -#define Z_ElementSpec_elementSetName 0 -#define Z_ElementSpec_externalSpec 1 - union - { - char *elementSetName; - Z_External *externalSpec; - } u; -} Z_ElementSpec; - -typedef struct Z_Specification -{ - Odr_oid *schema; /* OPTIONAL */ - Z_ElementSpec *elementSpec; /* OPTIONAL */ -} Z_Specification; - -typedef struct Z_DbSpecific -{ - char *databaseName; - Z_Specification *spec; -} Z_DbSpecific; - -typedef struct Z_CompSpec -{ - bool_t *selectAlternativeSyntax; - Z_Specification *generic; /* OPTIONAL */ - int num_dbSpecific; - Z_DbSpecific **dbSpecific; /* OPTIONAL */ - int num_recordSyntax; - Odr_oid **recordSyntax; /* OPTIONAL */ -} Z_CompSpec; - -typedef struct Z_RecordComposition -{ - int which; -#define Z_RecordComp_simple 0 -#define Z_RecordComp_complex 1 - union - { - Z_ElementSetNames *simple; - Z_CompSpec *complex; - } u; -} Z_RecordComposition; - -typedef struct Z_Range -{ - int *startingPosition; - int *numberOfRecords; -} Z_Range; - -typedef struct Z_PresentRequest -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - Z_ResultSetId *resultSetId; - int *resultSetStartPoint; - int *numberOfRecordsRequested; - int num_ranges; - Z_Range **additionalRanges; /* OPTIONAL */ - Z_RecordComposition *recordComposition; /* OPTIONAL */ - Odr_oid *preferredRecordSyntax; /* OPTIONAL */ - int *maxSegmentCount; /* OPTIONAL */ - int *maxRecordSize; /* OPTIONAL */ - int *maxSegmentSize; /* OPTIONAL */ - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_PresentRequest; - -typedef struct Z_PresentResponse -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int *numberOfRecordsReturned; - int *nextResultSetPosition; - int *presentStatus; - Z_Records *records; - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_PresentResponse; - -/* ------------------ RESOURCE CONTROL ----------------*/ - -typedef struct Z_TriggerResourceControlRequest -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int *requestedAction; -#define Z_TriggerResourceCtrl_resourceReport 1 -#define Z_TriggerResourceCtrl_resourceControl 2 -#define Z_TriggerResourceCtrl_cancel 3 - Odr_oid *prefResourceReportFormat; /* OPTIONAL */ - bool_t *resultSetWanted; /* OPTIONAL */ - Z_OtherInformation *otherInfo; -} Z_TriggerResourceControlRequest; - -typedef struct Z_ResourceControlRequest -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - bool_t *suspendedFlag; /* OPTIONAL */ - Z_External *resourceReport; /* OPTIONAL */ - int *partialResultsAvailable; /* OPTIONAL */ -#define Z_ResourceControlRequest_subset 1 -#define Z_ResourceControlRequest_interim 2 -#define Z_ResourceControlRequest_none 3 - bool_t *responseRequired; - bool_t *triggeredRequestFlag; /* OPTIONAL */ - Z_OtherInformation *otherInfo; -} Z_ResourceControlRequest; - -typedef struct Z_ResourceControlResponse -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - bool_t *continueFlag; - bool_t *resultSetWanted; /* OPTIONAL */ - Z_OtherInformation *otherInfo; -} Z_ResourceControlResponse; - - -/* ------------------ ACCESS CTRL SERVICE ----------------*/ - -typedef struct Z_AccessControlRequest -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int which; -#define Z_AccessRequest_simpleForm 0 -#define Z_AccessRequest_externallyDefined 1 - union - { - Odr_oct *simpleForm; - Z_External *externallyDefined; - } u; - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_AccessControlRequest; - -typedef struct Z_AccessControlResponse -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int which; -#define Z_AccessResponse_simpleForm 0 -#define Z_AccessResponse_externallyDefined 1 - union - { - Odr_oct *simpleForm; - Z_External *externallyDefined; - } u; - Z_DiagRec *diagnostic; /* OPTIONAL */ - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_AccessControlResponse; - -/* ------------------------ SCAN SERVICE -------------------- */ - -typedef struct Z_AttributeList -{ - int num_attributes; - Z_AttributeElement **attributes; -} Z_AttributeList; - -typedef struct Z_AlternativeTerm -{ - int num_terms; - Z_AttributesPlusTerm **terms; -} Z_AlternativeTerm; - -typedef struct Z_ByDatabase -{ - char *db; - int *num; /* OPTIONAL */ - Z_OtherInformation *otherDbInfo; /* OPTIONAL */ -} Z_ByDatabase; - -typedef struct Z_ByDatabaseList -{ - int num_elements; - Z_ByDatabase **elements; -} Z_ByDatabaseList; - -typedef struct Z_ScanOccurrences -{ - int which; -#define Z_ScanOccurrences_global 0 -#define Z_ScanOccurrences_byDatabase 1 - union - { - int *global; - Z_ByDatabaseList *byDatabase; - } u; - -} Z_ScanOccurrences; - -typedef struct Z_OccurrenceByAttributesElem -{ - Z_AttributeList *attributes; - Z_ScanOccurrences *occurrences; /* OPTIONAL */ - Z_OtherInformation *otherOccurInfo; /* OPTIONAL */ -} Z_OccurrenceByAttributesElem; - -typedef struct Z_OccurrenceByAttributes -{ - int num_elements; - Z_OccurrenceByAttributesElem **elements; -} Z_OccurrenceByAttributes; - -typedef struct Z_TermInfo -{ - Z_Term *term; - char *displayTerm; /* OPTIONAL */ - Z_AttributeList *suggestedAttributes; /* OPTIONAL */ - Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */ - int *globalOccurrences; /* OPTIONAL */ - Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */ - Z_OtherInformation *otherTermInfo; /* OPTIONAL */ -} Z_TermInfo; - -typedef struct Z_Entry -{ - int which; -#define Z_Entry_termInfo 0 -#define Z_Entry_surrogateDiagnostic 1 - union - { - Z_TermInfo *termInfo; - Z_DiagRec *surrogateDiagnostic; - } u; -} Z_Entry; - -#ifdef BUGGY_LISTENTRIES - -typedef struct Z_Entries -{ - int num_entries; - Z_Entry **entries; -} Z_Entries; - -typedef struct Z_ListEntries -{ - int which; -#define Z_ListEntries_entries 0 -#define Z_ListEntries_nonSurrogateDiagnostics 1 - union - { - Z_Entries *entries; - Z_DiagRecs *nonSurrogateDiagnostics; - } u; -} Z_ListEntries; - -#endif - -typedef struct Z_ListEntries { - int num_entries; - Z_Entry **entries; /* OPT */ - int num_nonsurrogateDiagnostics; - Z_DiagRec **nonsurrogateDiagnostics; /* OPT */ -} Z_ListEntries; - -typedef struct Z_ScanRequest -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int num_databaseNames; - char **databaseNames; - Odr_oid *attributeSet; /* OPTIONAL */ - Z_AttributesPlusTerm *termListAndStartPoint; - int *stepSize; /* OPTIONAL */ - int *numberOfTermsRequested; - int *preferredPositionInResponse; /* OPTIONAL */ - Z_OtherInformation *otherInfo; -} Z_ScanRequest; - -typedef struct Z_ScanResponse -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int *stepSize; /* OPTIONAL */ - int *scanStatus; -#define Z_Scan_success 0 -#define Z_Scan_partial_1 1 -#define Z_Scan_partial_2 2 -#define Z_Scan_partial_3 3 -#define Z_Scan_partial_4 4 -#define Z_Scan_partial_5 5 -#define Z_Scan_failure 6 - int *numberOfEntriesReturned; - int *positionOfTerm; /* OPTIONAL */ - Z_ListEntries *entries; /* OPTIONAL */ - Odr_oid *attributeSet; /* OPTIONAL */ - Z_OtherInformation *otherInfo; -} Z_ScanResponse; - - -/* ------------------------ DELETE -------------------------- */ - -#define Z_DeleteStatus_success 0 -#define Z_DeleteStatus_resultSetDidNotExist 1 -#define Z_DeleteStatus_previouslyDeletedByTarget 2 -#define Z_DeleteStatus_systemProblemAtTarget 3 -#define Z_DeleteStatus_accessNotAllowed 4 -#define Z_DeleteStatus_resourceControlAtOrigin 5 -#define Z_DeleteStatus_resourceControlAtTarget 6 -#define Z_DeleteStatus_bulkDeleteNotSupported 7 -#define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte 8 -#define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9 -#define Z_DeleteStatus_resultSetInUse 10 - -typedef struct Z_ListStatus -{ - Z_ResultSetId *id; - int *status; -} Z_ListStatus; - -typedef struct Z_DeleteResultSetRequest -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int *deleteFunction; -#define Z_DeleteRequest_list 0 -#define Z_DeleteRequest_all 1 - int num_resultSetList; - Z_ResultSetId **resultSetList; /* OPTIONAL */ - Z_OtherInformation *otherInfo; -} Z_DeleteResultSetRequest; - -typedef struct Z_ListStatuses { - int num; - Z_ListStatus **elements; -} Z_ListStatuses; - -typedef struct Z_DeleteResultSetResponse -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int *deleteOperationStatus; - Z_ListStatuses *deleteListStatuses;/* OPTIONAL */ - int *numberNotDeleted; /* OPTIONAL */ - Z_ListStatuses *bulkStatuses; /* OPTIONAL */ - char *deleteMessage; /* OPTIONAL */ - Z_OtherInformation *otherInfo; -} Z_DeleteResultSetResponse; - -/* ------------------------ CLOSE SERVICE ------------------- */ - -typedef struct Z_Close -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int *closeReason; -#define Z_Close_finished 0 -#define Z_Close_shutdown 1 -#define Z_Close_systemProblem 2 -#define Z_Close_costLimit 3 -#define Z_Close_resources 4 -#define Z_Close_securityViolation 5 -#define Z_Close_protocolError 6 -#define Z_Close_lackOfActivity 7 -#define Z_Close_peerAbort 8 -#define Z_Close_unspecified 9 - char *diagnosticInformation; /* OPTIONAL */ - Odr_oid *resourceReportFormat; /* OPTIONAL */ - Z_External *resourceReport; /* OPTIONAL */ - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_Close; - -/* ------------------------ SEGMENTATION -------------------- */ - -typedef struct Z_Segment -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int *numberOfRecordsReturned; - int num_segmentRecords; - Z_NamePlusRecord **segmentRecords; - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_Segment; - -/* ----------------------- Extended Services ---------------- */ - -typedef struct Z_Permissions -{ - char *userId; - int num_allowableFunctions; - int **allowableFunctions; -#define Z_Permissions_delete 1 -#define Z_Permissions_modifyContents 2 -#define Z_Permissions_modifyPermissions 3 -#define Z_Permissions_present 4 -#define Z_Permissions_invoke 5 -} Z_Permissions; - -typedef struct Z_ExtendedServicesRequest -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int *function; -#define Z_ExtendedServicesRequest_create 1 -#define Z_ExtendedServicesRequest_delete 2 -#define Z_ExtendedServicesRequest_modify 3 - Odr_oid *packageType; - char *packageName; /* OPTIONAL */ - char *userId; /* OPTIONAL */ - Z_IntUnit *retentionTime; /* OPTIONAL */ - Z_Permissions *permissions; /* OPTIONAL */ - char *description; /* OPTIONAL */ - Z_External *taskSpecificParameters; /* OPTIONAL */ - int *waitAction; -#define Z_ExtendedServicesRequest_wait 1 -#define Z_ExtendedServicesRequest_waitIfPossible 2 -#define Z_ExtendedServicesRequest_dontWait 3 -#define Z_ExtendedServicesRequest_dontReturnPackage 4 - char *elements; /* OPTIONAL */ - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_ExtendedServicesRequest; - -typedef struct Z_ExtendedServicesResponse -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int *operationStatus; -#define Z_ExtendedServicesResponse_done 1 -#define Z_ExtendedServicesResponse_accepted 2 -#define Z_ExtendedServicesResponse_failure 3 - int num_diagnostics; - Z_DiagRec **diagnostics; /* OPTIONAL */ - Z_External *taskPackage; /* OPTIONAL */ - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_ExtendedServicesResponse; - -/* ------------------------ Sort --------------------------- */ - -typedef struct Z_SortAttributes -{ - Odr_oid *id; - Z_AttributeList *list; -} Z_SortAttributes; - -typedef struct Z_SortKey -{ - int which; -#define Z_SortKey_sortField 0 -#define Z_SortKey_elementSpec 1 -#define Z_SortKey_sortAttributes 2 - union - { - char *sortField; - Z_Specification *elementSpec; - Z_SortAttributes *sortAttributes; - } u; -} Z_SortKey; - -typedef struct Z_SortDbSpecific -{ - char *databaseName; - Z_SortKey *dbSort; -} Z_SortDbSpecific; - -typedef struct Z_SortDbSpecificList -{ - int num_dbSpecific; - Z_SortDbSpecific **dbSpecific; -} Z_SortDbSpecificList; - -typedef struct Z_SortElement -{ - int which; -#define Z_SortElement_generic 0 -#define Z_SortElement_databaseSpecific 1 - union - { - Z_SortKey *generic; - Z_SortDbSpecificList *databaseSpecific; - } u; -} Z_SortElement; - -typedef struct Z_SortMissingValueAction -{ - int which; -#define Z_SortMissingValAct_abort 0 -#define Z_SortMissingValAct_null 1 -#define Z_SortMissingValAct_valData 2 - union - { - Odr_null *abort; - Odr_null *null; - Odr_oct *valData; - } u; -} Z_SortMissingValueAction; - -typedef struct Z_SortKeySpec -{ - Z_SortElement *sortElement; - int *sortRelation; -#define Z_SortRelation_ascending 0 -#define Z_SortRelation_descending 1 -#define Z_SortRelation_ascendingByFreq 3 -#define Z_SortRelation_descendingByFreq 4 - int *caseSensitivity; -#define Z_SortCase_caseSensitive 0 -#define Z_SortCase_caseInsensitive 1 - Z_SortMissingValueAction *missingValueAction; /* OPTIONAL */ -} Z_SortKeySpec; - -typedef struct Z_SortResponse -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int *sortStatus; -#define Z_SortStatus_success 0 -#define Z_SortStatus_partial_1 1 -#define Z_SortStatus_failure 2 - int *resultSetStatus; /* OPTIONAL */ -#define Z_SortResultSetStatus_empty 1 -#define Z_SortResultSetStatus_interim 2 -#define Z_SortResultSetStatus_unchanged 3 -#define Z_SortResultSetStatus_none 4 - Z_DiagRecs *diagnostics; /* OPTIONAL */ - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_SortResponse; - -typedef struct Z_SortKeySpecList -{ - int num_specs; - Z_SortKeySpec **specs; -} Z_SortKeySpecList; - -typedef struct Z_SortRequest -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - Z_StringList *inputResultSetNames; - char *sortedResultSetName; - Z_SortKeySpecList *sortSequence; - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_SortRequest; - -/* ----------------------- Resource Report ------------------ */ - -typedef struct Z_ResourceReportRequest -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - Z_ReferenceId *opId; /* OPTIONAL */ - Odr_oid *prefResourceReportFormat; /* OPTIONAL */ - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_ResourceReportRequest; - -typedef struct Z_ResourceReportResponse -{ - Z_ReferenceId *referenceId; /* OPTIONAL */ - int *resourceReportStatus; -#define Z_ResourceReportStatus_success 0 -#define Z_ResourceReportStatus_partial 1 -#define Z_ResourceReportStatus_failure_1 2 -#define Z_ResourceReportStatus_failure_2 3 -#define Z_ResourceReportStatus_failure_3 4 -#define Z_ResourceReportStatus_failure_4 5 -#define Z_ResourceReportStatus_failure_5 6 -#define Z_ResourceReportStatus_failure_6 7 - Z_External *resourceReport; /* OPTIONAL */ - Z_OtherInformation *otherInfo; /* OPTIONAL */ -} Z_ResourceReportResponse; - -/* ------------------------ APDU ---------------------------- */ - -typedef struct Z_APDU -{ - int which; -#define Z_APDU_initRequest 0 -#define Z_APDU_initResponse 1 -#define Z_APDU_searchRequest 2 -#define Z_APDU_searchResponse 3 -#define Z_APDU_presentRequest 4 -#define Z_APDU_presentResponse 5 -#define Z_APDU_deleteResultSetRequest 6 -#define Z_APDU_deleteResultSetResponse 7 -#define Z_APDU_resourceControlRequest 8 -#define Z_APDU_resourceControlResponse 9 -#define Z_APDU_triggerResourceControlRequest 10 -#define Z_APDU_scanRequest 11 -#define Z_APDU_scanResponse 12 -#define Z_APDU_segmentRequest 13 -#define Z_APDU_extendedServicesRequest 14 -#define Z_APDU_extendedServicesResponse 15 -#define Z_APDU_close 16 -#define Z_APDU_accessControlRequest 17 -#define Z_APDU_accessControlResponse 18 -#define Z_APDU_sortRequest 20 -#define Z_APDU_sortResponse 21 -#define Z_APDU_resourceReportRequest 22 -#define Z_APDU_resourceReportResponse 23 - union - { - Z_InitRequest *initRequest; - Z_InitResponse *initResponse; - Z_SearchRequest *searchRequest; - Z_SearchResponse *searchResponse; - Z_PresentRequest *presentRequest; - Z_PresentResponse *presentResponse; - Z_DeleteResultSetRequest *deleteResultSetRequest; - Z_DeleteResultSetResponse *deleteResultSetResponse; - Z_AccessControlRequest *accessControlRequest; - Z_AccessControlResponse *accessControlResponse; - Z_ResourceControlRequest *resourceControlRequest; - Z_ResourceControlResponse *resourceControlResponse; - Z_TriggerResourceControlRequest *triggerResourceControlRequest; - Z_ResourceReportRequest *resourceReportRequest; - Z_ResourceReportResponse *resourceReportResponse; - Z_ScanRequest *scanRequest; - Z_ScanResponse *scanResponse; - Z_SortRequest *sortRequest; - Z_SortResponse *sortResponse; - Z_Segment *segmentRequest; - Z_ExtendedServicesRequest *extendedServicesRequest; - Z_ExtendedServicesResponse *extendedServicesResponse; - Z_Close *close; - } u; -} Z_APDU; - -#define z_APDU z_APDU_old - -YAZ_EXPORT int z_APDU(ODR o, Z_APDU **p, int opt, const char *name); -YAZ_EXPORT int z_SUTRS(ODR o, Odr_oct **p, int opt, const char *name); - -YAZ_EXPORT Z_InitRequest *zget_InitRequest(ODR o); -YAZ_EXPORT Z_InitResponse *zget_InitResponse(ODR o); -YAZ_EXPORT Z_SearchRequest *zget_SearchRequest(ODR o); -YAZ_EXPORT Z_SearchResponse *zget_SearchResponse(ODR o); -YAZ_EXPORT Z_PresentRequest *zget_PresentRequest(ODR o); -YAZ_EXPORT Z_PresentResponse *zget_PresentResponse(ODR o); -YAZ_EXPORT Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o); -YAZ_EXPORT Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o); -YAZ_EXPORT Z_ScanRequest *zget_ScanRequest(ODR o); -YAZ_EXPORT Z_ScanResponse *zget_ScanResponse(ODR o); -YAZ_EXPORT Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o); -YAZ_EXPORT Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o); -YAZ_EXPORT Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o); -YAZ_EXPORT Z_Close *zget_Close(ODR o); -YAZ_EXPORT int z_StringList(ODR o, Z_StringList **p, int opt, - const char *name); -YAZ_EXPORT int z_InternationalString(ODR o, char **p, int opt, - const char *name); -YAZ_EXPORT int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt, - const char *naem); -YAZ_EXPORT int z_ElementSetName(ODR o, char **p, int opt, const char *name); -YAZ_EXPORT int z_IntUnit(ODR o, Z_IntUnit **p, int opt, const char *name); -YAZ_EXPORT int z_Unit(ODR o, Z_Unit **p, int opt, const char *name); -YAZ_EXPORT int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt, - const char *name); -YAZ_EXPORT int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt, - const char *name); -YAZ_EXPORT int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, - int opt, const char *name); -YAZ_EXPORT int z_Term(ODR o, Z_Term **p, int opt, const char *name); -YAZ_EXPORT int z_Specification(ODR o, Z_Specification **p, int opt, - const char *name); -YAZ_EXPORT int z_Permissions(ODR o, Z_Permissions **p, int opt, - const char *name); -YAZ_EXPORT int z_DiagRec(ODR o, Z_DiagRec **p, int opt, const char *name); -YAZ_EXPORT int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt, const char *name); -YAZ_EXPORT int z_AttributeList(ODR o, Z_AttributeList **p, int opt, - const char *name); -YAZ_EXPORT int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt, - const char *name); -YAZ_EXPORT Z_APDU *zget_APDU(ODR o, int which); -YAZ_EXPORT int z_Query(ODR o, Z_Query **p, int opt, const char *name); - -YAZ_EXPORT Odr_oid *yaz_oidval_to_z3950oid (ODR o, int oid_class, - int oid_value); -YAZ_EXPORT Odr_oid *yaz_str_to_z3950oid (ODR o, int oid_class, - const char *str); -YAZ_EXPORT const char *yaz_z3950oid_to_str (Odr_oid *oid, int *oid_class); - -YAZ_END_CDECL - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#endif diff --git a/asn/prt-rsc.c b/asn/prt-rsc.c deleted file mode 100644 index db690ee..0000000 --- a/asn/prt-rsc.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 1995-1999, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: prt-rsc.c,v $ - * Revision 1.8 1999-11-30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.7 1999/04/20 09:56:48 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.6 1998/02/11 11:53:32 adam - * Changed code so that it compiles as C++. - * - * Revision 1.5 1995/09/29 17:11:55 quinn - * Smallish - * - * Revision 1.4 1995/09/27 15:02:43 quinn - * Modified function heads & prototypes. - * - * Revision 1.3 1995/06/02 09:49:15 quinn - * Adding access control - * - * Revision 1.2 1995/06/01 14:34:53 quinn - * Work - * - * Revision 1.1 1995/06/01 11:22:17 quinn - * Resource control - * - * - */ - -#include - -/* -------------------- Resource 1 ------------------------- */ - -int z_Estimate1(ODR o, Z_Estimate1 **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit(o, odr_integer, &(*p)->type, ODR_CONTEXT, 1, 0) && - odr_implicit(o, odr_integer, &(*p)->value, ODR_CONTEXT, 2, 0) && - odr_implicit(o, odr_integer, &(*p)->currencyCode, ODR_CONTEXT, 3, 1) && - odr_sequence_end(o); -} - -int z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit_settag(o, ODR_CONTEXT, 1) && - odr_sequence_of(o, (Odr_fun)z_Estimate1, &(*p)->estimates, - &(*p)->num_estimates, 0) && - odr_implicit(o, odr_visiblestring, &(*p)->message, - ODR_CONTEXT, 2, 0) && - odr_sequence_end(o); -} - -/* -------------------- Resource 2 ------------------------- */ - -/* int z_StringOrNumeric(ODR, Z_StringOrNumeric **, int); */ -/* int z_IntUnit(ODR, Z_IntUnit **, int); */ - -int z_Estimate2(ODR o, Z_Estimate2 **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_explicit(o, z_StringOrNumeric, &(*p)->type, ODR_CONTEXT, 1, 0) && - odr_implicit(o, z_IntUnit, &(*p)->value, ODR_CONTEXT, 2, 0) && - odr_sequence_end(o); -} - -int z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt, const char *name) -{ - if (!odr_sequence_begin(o, p, sizeof(**p), 0)) - return opt && odr_ok(o); - return - odr_implicit_settag(o, ODR_CONTEXT, 1) && - (odr_sequence_of(o, (Odr_fun)z_Estimate2, &(*p)->estimates, - &(*p)->num_estimates, 0) || odr_ok(o)) && - odr_implicit(o, odr_visiblestring, &(*p)->message, - ODR_CONTEXT, 2, 1) && - odr_sequence_end(o); -} - - diff --git a/asn/prt-rsc.h b/asn/prt-rsc.h deleted file mode 100644 index a409843..0000000 --- a/asn/prt-rsc.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 1995, Index Data. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The name of Index Data or the individual authors may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR - * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - * $Log: prt-rsc.h,v $ - * Revision 1.1 2000-10-03 12:55:50 adam - * Removed several auto-generated files from CVS. - * - * Revision 1.1 1999/11/30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.7 1999/04/20 09:56:48 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.6 1997/05/14 06:53:50 adam - * C++ support. - * - * Revision 1.5 1995/09/29 17:12:11 quinn - * Smallish - * - * Revision 1.4 1995/09/27 15:02:52 quinn - * Modified function heads & prototypes. - * - * Revision 1.3 1995/08/17 12:45:17 quinn - * Fixed minor problems with GRS-1. Added support in c&s. - * - * Revision 1.2 1995/06/02 09:49:50 quinn - * Add access control - * - * Revision 1.1 1995/06/01 11:24:52 quinn - * Resource Control - * - * - */ - -#ifndef PRT_RSC_H -#define PRT_RSC_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* -------------------- Resource-1 -------------------- */ - -#define Z_EstimateType_currentSearchRecords 1 -#define Z_EstimateType_finalSearchRecords 2 -#define Z_EstimateType_currentPresentRecords 3 -#define Z_EstimateType_finalPresentRecords 4 -#define Z_EstimateType_currentOpTimeProcessing 5 -#define Z_EstimateType_finalOpTimeProcessing 6 -#define Z_EstimateType_currentAssocTime 7 -#define Z_EstimateType_currentOperationCost 8 -#define Z_EstimateType_finalOperationCost 9 -#define Z_EstimateType_currentAssocCost 10 -#define Z_EstimateType_finalOpTimeElapsed 11 -#define Z_EstimateType_percentComplete 12 -#define Z_EstimateType_currentSearchAssCost 13 -#define Z_EstimateType_currentPresentAssCost 14 -#define Z_EstimateType_currentConnectAssCost 15 -#define Z_EstimateType_currentOtherAssCost 16 - -typedef struct Z_Estimate1 -{ - int *type; - int *value; - int *currencyCode; /* OPTIONAL */ -} Z_Estimate1; - -typedef struct Z_ResourceReport1 -{ - int num_estimates; - Z_Estimate1 **estimates; - char *message; -} Z_ResourceReport1; - -int z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt, const char *name); - -/* -------------------- Resource-2 -------------------- */ - -typedef struct Z_Estimate2 -{ - Z_StringOrNumeric *type; /* same as in estimate1, if numeric */ - Z_IntUnit *value; -} Z_Estimate2; - -typedef struct Z_ResourceReport2 -{ - int num_estimates; - Z_Estimate2 **estimates; /* OPTIONAL */ - char *message; /* OPTIONAL */ -} Z_ResourceReport2; - -int z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt, const char *name); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/asn/prt-univ.c b/asn/prt-univ.c deleted file mode 100644 index b61052f..0000000 --- a/asn/prt-univ.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 1998-1999, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: prt-univ.c,v $ - * Revision 1.3 1999-11-30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.2 1999/04/20 09:56:48 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.1 1998/03/20 14:46:06 adam - * Added UNIverse Resource Reports. - * - */ - -#include - -int z_UniverseReportHits (ODR o, Z_UniverseReportHits **p, int opt, - const char *name) -{ - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - z_StringOrNumeric(o, &(*p)->database, 0, 0) && - z_StringOrNumeric(o, &(*p)->hits, 0, 0) && - odr_sequence_end (o); -} - -int z_UniverseReportDuplicate (ODR o, Z_UniverseReportDuplicate **p, int opt, - const char *name) -{ - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - z_StringOrNumeric(o, &(*p)->hitno, 0, 0) && - odr_sequence_end (o); -} - -int z_UniverseReport (ODR o, Z_UniverseReport **p, int opt, const char *name) -{ - static Odr_arm arm[] = { - {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_UniverseReport_databaseHits, - (Odr_fun) z_UniverseReportHits, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_UniverseReport_duplicate, - (Odr_fun) z_UniverseReportDuplicate, 0}, - {-1, -1, -1, -1, (Odr_fun) 0, 0} - }; - if (!odr_sequence_begin (o, p, sizeof(**p), 0)) - return opt && odr_ok (o); - return - odr_integer(o, &(*p)->totalHits, 0, 0) && - odr_choice (o, arm, &(*p)->u, &(*p)->which, 0) && - odr_sequence_end (o); -} - diff --git a/asn/prt-univ.h b/asn/prt-univ.h deleted file mode 100644 index d431f50..0000000 --- a/asn/prt-univ.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 1998 - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of Index Data or the individual authors may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR - * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - */ - -#ifndef PRT_UNIV_H -#define PRT_UNIV_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* YC 0.1: Fri Mar 20 14:28:54 CET 1998 */ -/* Module-H ResourceReport-Format-Universe-1 */ - -typedef struct Z_UniverseReportHits Z_UniverseReportHits; -int z_UniverseReportHits (ODR o, Z_UniverseReportHits **p, int opt, - const char *name); - -typedef struct Z_UniverseReportDuplicate Z_UniverseReportDuplicate; -int z_UniverseReportDuplicate (ODR o, Z_UniverseReportDuplicate **p, int opt, - const char *name); - -typedef struct Z_UniverseReport Z_UniverseReport; -int z_UniverseReport (ODR o, Z_UniverseReport **p, int opt, - const char *name); - -struct Z_UniverseReportHits { - Z_StringOrNumeric *database; - Z_StringOrNumeric *hits; -}; - -struct Z_UniverseReportDuplicate { - Z_StringOrNumeric *hitno; -}; - -struct Z_UniverseReport { - int *totalHits; - int which; - union { - Z_UniverseReportHits *databaseHits; - Z_UniverseReportDuplicate *duplicate; -#define Z_UniverseReport_databaseHits 1 -#define Z_UniverseReport_duplicate 2 - } u; -}; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/asn/test.c b/asn/test.c deleted file mode 100644 index a68304c..0000000 --- a/asn/test.c +++ /dev/null @@ -1,67 +0,0 @@ -#include -#include -#include - -int main() -{ - int i; - unsigned char buf[10000]; - struct odr o; - Z_APDU apdu, *papdu, *papdu2; - Z_SearchRequest sreq; - int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10; - bool_t rep; - static char *names[] = {"Erik", "William", "George", "Bob"}; - Z_Query query; - Z_RPNQuery rpnquery; - Odr_oid att[] = { 1, 2, 3, 4, 5, 6, -1}; - Z_RPNStructure rpnstructure; - Z_Operand operand; - Z_AttributesPlusTerm apt; - Odr_oct term; - - papdu = &apdu; - apdu.which = Z_APDU_searchRequest; - apdu.u.searchRequest = &sreq; - a1 = 1000; sreq.smallSetUpperBound = &a1; - a2 = 2000; sreq.largeSetLowerBound = &a2; - a3 = 100; sreq.mediumSetPresentNumber = &a3; - rep = 1; sreq.replaceIndicator = &rep; - sreq.resultSetName = "FOOBAR"; - sreq.num_databaseNames = 4; - sreq.databaseNames = names; - sreq.smallSetElementSetNames = 0; - sreq.mediumSetElementSetNames = 0; - sreq.preferredRecordSyntax = 0; - query.which = Z_Query_type_1; - query.u.type_1 = &rpnquery; - sreq.query = &query; - rpnquery.attributeSetId = att; - rpnquery.RPNStructure = &rpnstructure; - rpnstructure.which = Z_RPNStructure_simple; - rpnstructure.u.simple = &operand; - operand.which = Z_Operand_APT; - operand.u.attributesPlusTerm = &apt; - apt.num_attributes=0; - apt.attributeList = 0; - apt.term = &term; - term.buf = (unsigned char*) "BARFOO"; - term.len = term.size = strlen((char*)term.buf); - - o.buf = buf; - o.bp=o.buf; - o.left = o.buflen = 10000; - o.direction = ODR_PRINT; - o.print = stdout; - o.indent = 0; - o.t_class = -1; - - printf("status=%d\n", z_APDU(&o, &papdu, 0)); - - return 0; - - o.direction = ODR_DECODE; - o.bp = o.buf; - - z_APDU(&o, &papdu2, 0); -} diff --git a/ccl/.cvsignore b/ccl/.cvsignore deleted file mode 100644 index 3cca9cc..0000000 --- a/ccl/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -cclsh -libccl.la -*.lo diff --git a/ccl/LICENSE b/ccl/LICENSE deleted file mode 100644 index 13c4ac3..0000000 --- a/ccl/LICENSE +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 1995-1996, the EUROPAGATE consortium (see below). - * - * The EUROPAGATE consortium members are: - * - * University College Dublin - * Danmarks Teknologiske Videnscenter - * An Chomhairle Leabharlanna - * Consejo Superior de Investigaciones Cientificas - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of EUROPAGATE or the project partners may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * 3. Users of this software (implementors and gateway operators) agree to - * inform the EUROPAGATE consortium of their use of the software. This - * information will be used to evaluate the EUROPAGATE project and the - * software, and to plan further developments. The consortium may use - * the information in later publications. - * - * 4. Users of this software agree to make their best efforts, when - * documenting their use of the software, to acknowledge the EUROPAGATE - * consortium, and the role played by the software in their work. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE - * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF - * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA - * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND - * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ diff --git a/ccl/Makefile.am b/ccl/Makefile.am deleted file mode 100644 index 13beca9..0000000 --- a/ccl/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -## $Id: Makefile.am,v 1.10 2003-06-23 10:22:21 adam Exp $ - -noinst_LTLIBRARIES = libccl.la - -noinst_PROGRAMS = cclsh - -check_PROGRAMS = tstccl - -TESTS = $(check_PROGRAMS) - -EXTRA_DIST = bib1 - -AM_CPPFLAGS=-I$(top_srcdir)/include - -libccl_la_SOURCES = cclfind.c ccltoken.c cclerrms.c cclqual.c cclptree.c \ - cclqfile.c cclstr.c - -cclsh_SOURCES=cclsh.c -cclsh_LDADD = libccl.la ../util/libutil.la $(READLINE_LIBS) - -tstccl_SOURCES = tstccl.c -tstccl_LDADD = libccl.la ../util/libutil.la - diff --git a/ccl/README b/ccl/README deleted file mode 100644 index 431ded0..0000000 --- a/ccl/README +++ /dev/null @@ -1,15 +0,0 @@ -CCL test module - -This module is required to parse the queries given to the yaz-client -test program. It is *not* a part of the YAZ module, and it is -distributed under a different license. - -Eventually, the products of the EUROPAGATE will be made available to -the general public, free of charge (the exact nature of the license is -unknown at this point). Until then, you should *NOT* distribute copies -of this software to organisations that are not partners in EUROPAGATE. - -If you need to distribute copies of YAZ to organisations which are not -partners in EUROPAGATE, you should remove this module, and, if -necessary, modify client/yaz-client.c to work wihout it. The test program -is not essential to the general working of YAZ. diff --git a/ccl/bib1 b/ccl/bib1 deleted file mode 100644 index 1dc9dca..0000000 --- a/ccl/bib1 +++ /dev/null @@ -1,119 +0,0 @@ -# $Id: bib1,v 1.13 2003-06-23 10:22:21 adam Exp $ -# CCL qualifiers and their mappings -# -# Each line takes the form: -# name [,]=,.. = ... -# Where type is one of: -# u use-attribute -# r relation-attribute ) -# p position-attribute -# s structure-attribute -# t truncation-attribute -# c completeness-attribute -# -# Special value for relation: -# o ordered. Tells the CCL parser to convert a ccl relation -# to a bib-1 relation (1,2,..6). -# Special value for structure: -# pw phrase/word. The CCL parser will decide whether phrase or word -# is needed. Phrase is used if term contain blanks; otherwise -# Word is used. -# al and-list. AND operation is put between each term. -# ol or-list. OR operation is put between each term. -# Special value for truncation: -# l Allow left truncation if ? is at left side of term. -# r Allow right truncation if ? is at left side of term. -# b Allow left&right truncation if ? is at left&right side of term. -# n Set truncation explicitly to "none" if no ? is given. - -# This rule is for CCL tokens where no fields are specified -#term u=1016 t=l,r s=pw,al -term u=1016 t=l,r s=pw,al -# Common short-hand access points. -au u=1 s=pw t=l,r # author -sp u=1 s=pw t=l,r # author -ti u=4 s=pw t=l,r # title -isbn u=7 -issn u=8 -cc u=20 -su u=21 s=pw -date u=30 r=o s=pw -dp u=31 r=o -da u=32 r=o -la u=54 s=pw -ab u=62 s=pw -note u=63 s=pw -af u=1006 s=pw -rel s=9 -cln - -# Relation Attributes -rel:lt r=1 -rel:le r=2 -rel:eq r=3 -rel:ge r=4 -rel:gt r=5 -rel:ne r=6 -rel:phon r=100 -rel:stem r=101 -rel:rele r=102 -rel:alwa r=103 - -# Position Attributes -pos:ff p=1 -pos:fs p=2 -pos:af p=3 - -# Structure Attributes -str:wp s=pw -str:phrase s=1 -str:word s=2 -str:key s=3 -str:year s=4 -str:date s=5 -str:wlist s=6 -str:dateu s=100 -str:daten s=101 -str:nameu s=102 -str:struc s=103 -str:urx s=104 -str:fft s=105 -str:dt s=106 -str:ln s=107 -str:str s=108 -str:num s=109 - -# Truncation Attributes -tru:right t=1 -tru:left t=2 -tru:both t=3 -tru:none t=100 -tru:proh t=101 -tru:re1 t=102 -tru:re2 t=103 - -# Completeness Attributes -com:is c=1 -com:cs c=2 -com:cf c=3 - -exp:category exp1,1=1 - -# These special directives defines names of keywords for parser -@and og * # either 'or' or * -@or eller # either 'eller' or + -@not ikke # and so on.. -@set s set -@case 0 # case insenstive (1 for case sensitive) -@truncation * ? -@field or - -# Aliases -# -# forfatter=x is equivalent to au=x -forfatter au -# tiau=x is equivalent to ti=x or ti=x -tiau ti au -# -# string atributes -dc.title 1=/my/title diff --git a/ccl/cclerrms.c b/ccl/cclerrms.c deleted file mode 100644 index f9a6658..0000000 --- a/ccl/cclerrms.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 1995, the EUROPAGATE consortium (see below). - * - * The EUROPAGATE consortium members are: - * - * University College Dublin - * Danmarks Teknologiske Videnscenter - * An Chomhairle Leabharlanna - * Consejo Superior de Investigaciones Cientificas - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of EUROPAGATE or the project partners may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * 3. Users of this software (implementors and gateway operators) agree to - * inform the EUROPAGATE consortium of their use of the software. This - * information will be used to evaluate the EUROPAGATE project and the - * software, and to plan further developments. The consortium may use - * the information in later publications. - * - * 4. Users of this software agree to make their best efforts, when - * documenting their use of the software, to acknowledge the EUROPAGATE - * consortium, and the role played by the software in their work. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE - * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF - * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA - * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND - * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ -/* - * Europagate, 1995 - * - * $Id: cclerrms.c,v 1.10 2001-11-27 22:38:50 adam Exp $ - * - * Old Europagate Log: - * - * Revision 1.8 1995/05/16 09:39:25 adam - * LICENSE. - * - * Revision 1.7 1995/04/17 09:31:40 adam - * Improved handling of qualifiers. Aliases or reserved words. - * - * Revision 1.6 1995/02/23 08:31:59 adam - * Changed header. - * - * Revision 1.4 1995/02/14 16:20:54 adam - * Qualifiers are read from a file now. - * - * Revision 1.3 1995/02/14 10:25:56 adam - * The constructions 'qualifier rel term ...' implemented. - * - * Revision 1.2 1995/02/13 15:15:06 adam - * Added handling of qualifiers. Not finished yet. - * - * Revision 1.1 1995/02/13 12:35:20 adam - * First version of CCL. Qualifiers aren't handled yet. - * - */ - -#include - -static char *err_msg_array[] = { - "Ok", - "Search word expected", - "')' expected", - "Set name expected", - "Operator expected", - "Unbalanced ')'", - "Unknown qualifier", - "Qualifiers applied twice", - "'=' expected", - "Bad relation", - "Left truncation not supported", - "Both left - and right truncation not supported", - "Right truncation not supported" -}; - -/* - * ccl_err_msg: return name of CCL error - * ccl_errno: Error no. - * return: Name of error. - */ -const char *ccl_err_msg (int ccl_errno) -{ - return err_msg_array[ccl_errno]; -} diff --git a/ccl/cclfind.c b/ccl/cclfind.c deleted file mode 100644 index 9fdcf13..0000000 --- a/ccl/cclfind.c +++ /dev/null @@ -1,1114 +0,0 @@ -/* - * Copyright (c) 1995, the EUROPAGATE consortium (see below). - * - * The EUROPAGATE consortium members are: - * - * University College Dublin - * Danmarks Teknologiske Videnscenter - * An Chomhairle Leabharlanna - * Consejo Superior de Investigaciones Cientificas - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of EUROPAGATE or the project partners may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * 3. Users of this software (implementors and gateway operators) agree to - * inform the EUROPAGATE consortium of their use of the software. This - * information will be used to evaluate the EUROPAGATE project and the - * software, and to plan further developments. The consortium may use - * the information in later publications. - * - * 4. Users of this software agree to make their best efforts, when - * documenting their use of the software, to acknowledge the EUROPAGATE - * consortium, and the role played by the software in their work. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE - * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF - * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA - * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND - * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ -/* CCL find (to rpn conversion) - * Europagate, 1995 - * - * $Id: cclfind.c,v 1.34 2003-06-23 10:22:21 adam Exp $ - * - * Old Europagate log: - * - * Revision 1.16 1996/01/08 08:41:13 adam - * Removed unused function. - * - * Revision 1.15 1995/07/20 08:14:34 adam - * Qualifiers were observed too often. Instead tokens are treated as - * qualifiers only when separated by comma. - * - * Revision 1.14 1995/05/16 09:39:26 adam - * LICENSE. - * - * Revision 1.13 1995/04/17 09:31:42 adam - * Improved handling of qualifiers. Aliases or reserved words. - * - * Revision 1.12 1995/03/20 15:27:43 adam - * Minor changes. - * - * Revision 1.11 1995/02/23 08:31:59 adam - * Changed header. - * - * Revision 1.9 1995/02/16 13:20:06 adam - * Spell fix. - * - * Revision 1.8 1995/02/14 19:59:42 adam - * Removed a syntax error. - * - * Revision 1.7 1995/02/14 19:55:10 adam - * Header files ccl.h/cclp.h are gone! They have been merged an - * moved to ../include/ccl.h. - * Node kind(s) in ccl_rpn_node have changed names. - * - * Revision 1.6 1995/02/14 16:20:55 adam - * Qualifiers are read from a file now. - * - * Revision 1.5 1995/02/14 14:12:41 adam - * Ranges for ordered qualfiers implemented (e.g. pd=1980-1990). - * - * Revision 1.4 1995/02/14 13:16:29 adam - * Left and/or right truncation implemented. - * - * Revision 1.3 1995/02/14 10:25:56 adam - * The constructions 'qualifier rel term ...' implemented. - * - * Revision 1.2 1995/02/13 15:15:07 adam - * Added handling of qualifiers. Not finished yet. - * - * Revision 1.1 1995/02/13 12:35:20 adam - * First version of CCL. Qualifiers aren't handled yet. - * - */ - -#include -#include - -#include - -/* returns type of current lookahead */ -#define KIND (cclp->look_token->kind) - -/* move one token forward */ -#define ADVANCE cclp->look_token = cclp->look_token->next - -/* - * qual_val_type: test for existance of attribute type/value pair. - * qa: Attribute array - * type: Type of attribute to search for - * value: Value of attribute to seach for - * return: 1 if found; 0 otherwise. - */ -static int qual_val_type (struct ccl_rpn_attr **qa, int type, int value, - char **attset) -{ - int i; - struct ccl_rpn_attr *q; - - if (!qa) - return 0; - for (i = 0; (q=qa[i]); i++) - while (q) - { - if (q->type == type && q->kind == CCL_RPN_ATTR_NUMERIC && - q->value.numeric == value) - { - if (attset) - *attset = q->set; - return 1; - } - q = q->next; - } - return 0; -} - -/* - * strxcat: concatenate strings. - * n: Null-terminated Destination string - * src: Source string to be appended (not null-terminated) - * len: Length of source string. - */ -static void strxcat (char *n, const char *src, int len) -{ - while (*n) - n++; - while (--len >= 0) - *n++ = *src++; - *n = '\0'; -} - -/* - * copy_token_name: Return copy of CCL token name - * tp: Pointer to token info. - * return: malloc(3) allocated copy of token name. - */ -static char *copy_token_name (struct ccl_token *tp) -{ - char *str = (char *)xmalloc (tp->len + 1); - ccl_assert (str); - memcpy (str, tp->name, tp->len); - str[tp->len] = '\0'; - return str; -} - -/* - * mk_node: Create RPN node. - * kind: Type of node. - * return: pointer to allocated node. - */ -static struct ccl_rpn_node *mk_node (int kind) -{ - struct ccl_rpn_node *p; - p = (struct ccl_rpn_node *)xmalloc (sizeof(*p)); - ccl_assert (p); - p->kind = kind; - return p; -} - -/* - * ccl_rpn_delete: Delete RPN tree. - * rpn: Pointer to tree. - */ -void ccl_rpn_delete (struct ccl_rpn_node *rpn) -{ - struct ccl_rpn_attr *attr, *attr1; - if (!rpn) - return; - switch (rpn->kind) - { - case CCL_RPN_AND: - case CCL_RPN_OR: - case CCL_RPN_NOT: - ccl_rpn_delete (rpn->u.p[0]); - ccl_rpn_delete (rpn->u.p[1]); - break; - case CCL_RPN_TERM: - xfree (rpn->u.t.term); - for (attr = rpn->u.t.attr_list; attr; attr = attr1) - { - attr1 = attr->next; - if (attr->kind == CCL_RPN_ATTR_STRING) - xfree(attr->value.str); - if (attr->set) - xfree (attr->set); - xfree (attr); - } - break; - case CCL_RPN_SET: - xfree (rpn->u.setname); - break; - case CCL_RPN_PROX: - ccl_rpn_delete (rpn->u.p[0]); - ccl_rpn_delete (rpn->u.p[1]); - break; - } - xfree (rpn); -} - -static struct ccl_rpn_node *find_spec (CCL_parser cclp, - struct ccl_rpn_attr **qa); - -static int is_term_ok (int look, int *list) -{ - for (;*list >= 0; list++) - if (look == *list) - return 1; - return 0; -} - -static struct ccl_rpn_node *search_terms (CCL_parser cclp, - struct ccl_rpn_attr **qa); - -static struct ccl_rpn_attr *add_attr_node (struct ccl_rpn_node *p, - const char *set, int type) -{ - struct ccl_rpn_attr *n; - - n = (struct ccl_rpn_attr *)xmalloc (sizeof(*n)); - ccl_assert (n); - if (set) - { - n->set = (char*) xmalloc (strlen(set)+1); - strcpy (n->set, set); - } - else - n->set = 0; - n->type = type; - n->next = p->u.t.attr_list; - p->u.t.attr_list = n; - - n->kind = CCL_RPN_ATTR_NUMERIC; - n->value.numeric = 0; - return n; -} - -/* - * add_attr_numeric: Add attribute (type/value) to RPN term node. - * p: RPN node of type term. - * type: Type of attribute - * value: Value of attribute - * set: Attribute set name - */ -static void add_attr_numeric (struct ccl_rpn_node *p, const char *set, - int type, int value) -{ - struct ccl_rpn_attr *n; - - n = add_attr_node(p, set, type); - n->kind = CCL_RPN_ATTR_NUMERIC; - n->value.numeric = value; -} - -static void add_attr_string (struct ccl_rpn_node *p, const char *set, - int type, char *value) -{ - struct ccl_rpn_attr *n; - - n = add_attr_node(p, set, type); - n->kind = CCL_RPN_ATTR_STRING; - n->value.str = xstrdup(value); -} - - -/* - * search_term: Parse CCL search term. - * cclp: CCL Parser - * qa: Qualifier attributes already applied. - * term_list: tokens we accept as terms in context - * multi: whether we accept "multiple" tokens - * return: pointer to node(s); NULL on error. - */ -static struct ccl_rpn_node *search_term_x (CCL_parser cclp, - struct ccl_rpn_attr **qa, - int *term_list, int multi) -{ - struct ccl_rpn_node *p_top = 0; - struct ccl_token *lookahead = cclp->look_token; - int and_list = 0; - int or_list = 0; - char *attset; - const char *truncation_aliases; - - truncation_aliases = - ccl_qual_search_special(cclp->bibset, "truncation"); - if (!truncation_aliases) - truncation_aliases = "?"; - - if (qual_val_type (qa, CCL_BIB1_STR, CCL_BIB1_STR_AND_LIST, 0)) - and_list = 1; - if (qual_val_type (qa, CCL_BIB1_STR, CCL_BIB1_STR_OR_LIST, 0)) - or_list = 1; - while (1) - { - struct ccl_rpn_node *p; - size_t no, i; - int no_spaces = 0; - int left_trunc = 0; - int right_trunc = 0; - int mid_trunc = 0; - int relation_value = -1; - int position_value = -1; - int structure_value = -1; - int truncation_value = -1; - int completeness_value = -1; - int len = 0; - size_t max = 200; - if (and_list || or_list || !multi) - max = 1; - - /* ignore commas when dealing with and-lists .. */ - if (and_list && lookahead && lookahead->kind == CCL_TOK_COMMA) - { - lookahead = lookahead->next; - ADVANCE; - continue; - } - /* go through each TERM token. If no truncation attribute is yet - met, then look for left/right truncation markers (?) and - set left_trunc/right_trunc/mid_trunc accordingly */ - for (no = 0; no < max && is_term_ok(lookahead->kind, term_list); no++) - { - for (i = 0; ilen; i++) - if (lookahead->name[i] == ' ') - no_spaces++; - else if (strchr(truncation_aliases, lookahead->name[i])) - { - if (no == 0 && i == 0 && lookahead->len >= 1) - left_trunc = 1; - else if (!is_term_ok(lookahead->next->kind, term_list) && - i == lookahead->len-1 && i >= 1) - right_trunc = 1; - else - mid_trunc = 1; - } - len += 1+lookahead->len; - lookahead = lookahead->next; - } - - if (len == 0) - break; /* no more terms . stop . */ - - - if (p_top) - { - if (or_list) - p = mk_node (CCL_RPN_OR); - else if (and_list) - p = mk_node (CCL_RPN_AND); - else - p = mk_node (CCL_RPN_AND); - p->u.p[0] = p_top; - p_top = p; - } - - /* create the term node, but wait a moment before adding the term */ - p = mk_node (CCL_RPN_TERM); - p->u.t.attr_list = NULL; - p->u.t.term = NULL; - - /* make the top node point to us.. */ - if (p_top) - p_top->u.p[1] = p; - else - p_top = p; - - - /* go through all attributes and add them to the attribute list */ - for (i=0; qa && qa[i]; i++) - { - struct ccl_rpn_attr *attr; - - for (attr = qa[i]; attr; attr = attr->next) - switch(attr->kind) - { - case CCL_RPN_ATTR_STRING: - add_attr_string(p, attr->set, attr->type, - attr->value.str); - break; - case CCL_RPN_ATTR_NUMERIC: - if (attr->value.numeric > 0) - { /* deal only with REAL attributes (positive) */ - switch (attr->type) - { - case CCL_BIB1_REL: - if (relation_value != -1) - continue; - relation_value = attr->value.numeric; - break; - case CCL_BIB1_POS: - if (position_value != -1) - continue; - position_value = attr->value.numeric; - break; - case CCL_BIB1_STR: - if (structure_value != -1) - continue; - structure_value = attr->value.numeric; - break; - case CCL_BIB1_TRU: - if (truncation_value != -1) - continue; - truncation_value = attr->value.numeric; - left_trunc = right_trunc = mid_trunc = 0; - break; - case CCL_BIB1_COM: - if (completeness_value != -1) - continue; - completeness_value = attr->value.numeric; - break; - } - add_attr_numeric(p, attr->set, attr->type, - attr->value.numeric); - } - } - } - /* len now holds the number of characters in the RPN term */ - /* no holds the number of CCL tokens (1 or more) */ - - if (structure_value == -1 && - qual_val_type (qa, CCL_BIB1_STR, CCL_BIB1_STR_WP, &attset)) - { /* no structure attribute met. Apply either structure attribute - WORD or PHRASE depending on number of CCL tokens */ - if (no == 1 && no_spaces == 0) - add_attr_numeric (p, attset, CCL_BIB1_STR, 2); - else - add_attr_numeric (p, attset, CCL_BIB1_STR, 1); - } - - /* make the RPN token */ - p->u.t.term = (char *)xmalloc (len); - ccl_assert (p->u.t.term); - p->u.t.term[0] = '\0'; - for (i = 0; ilook_token->name; - int src_len = cclp->look_token->len; - - if (i == 0 && left_trunc) - { - src_len--; - src_str++; - } - else if (i == no-1 && right_trunc) - src_len--; - if (src_len) - { - int len = strlen(p->u.t.term); - if (len && - !strchr("-+", *src_str) && - !strchr("-+", p->u.t.term[len-1])) - { - strcat (p->u.t.term, " "); - } - } - strxcat (p->u.t.term, src_str, src_len); - ADVANCE; - } - if (left_trunc && right_trunc) - { - if (!qual_val_type (qa, CCL_BIB1_TRU, CCL_BIB1_TRU_CAN_BOTH, - &attset)) - { - cclp->error_code = CCL_ERR_TRUNC_NOT_BOTH; - ccl_rpn_delete (p); - return NULL; - } - add_attr_numeric (p, attset, CCL_BIB1_TRU, 3); - } - else if (right_trunc) - { - if (!qual_val_type (qa, CCL_BIB1_TRU, CCL_BIB1_TRU_CAN_RIGHT, - &attset)) - { - cclp->error_code = CCL_ERR_TRUNC_NOT_RIGHT; - ccl_rpn_delete (p); - return NULL; - } - add_attr_numeric (p, attset, CCL_BIB1_TRU, 1); - } - else if (left_trunc) - { - if (!qual_val_type (qa, CCL_BIB1_TRU, CCL_BIB1_TRU_CAN_LEFT, - &attset)) - { - cclp->error_code = CCL_ERR_TRUNC_NOT_LEFT; - ccl_rpn_delete (p); - return NULL; - } - add_attr_numeric (p, attset, CCL_BIB1_TRU, 2); - } - else - { - if (qual_val_type (qa, CCL_BIB1_TRU, CCL_BIB1_TRU_CAN_NONE, - &attset)) - add_attr_numeric (p, attset, CCL_BIB1_TRU, 100); - } - if (!multi) - break; - } - if (!p_top) - cclp->error_code = CCL_ERR_TERM_EXPECTED; - return p_top; -} - -static struct ccl_rpn_node *search_term (CCL_parser cclp, - struct ccl_rpn_attr **qa) -{ - static int list[] = {CCL_TOK_TERM, CCL_TOK_COMMA, -1}; - return search_term_x(cclp, qa, list, 0); -} - -static struct ccl_rpn_node *qualifiers2 (CCL_parser cclp, - struct ccl_rpn_attr **ap) -{ - char *attset; - int rel; - - if (!qual_val_type(ap, CCL_BIB1_REL, CCL_BIB1_REL_ORDER, &attset)) - { - /* unordered relation */ - struct ccl_rpn_node *p; - if (KIND != CCL_TOK_EQ) - { - cclp->error_code = CCL_ERR_EQ_EXPECTED; - return NULL; - } - ADVANCE; - if (KIND == CCL_TOK_LP) - { - ADVANCE; - if (!(p = find_spec (cclp, ap))) - { - return NULL; - } - if (KIND != CCL_TOK_RP) - { - cclp->error_code = CCL_ERR_RP_EXPECTED; - ccl_rpn_delete (p); - return NULL; - } - ADVANCE; - } - else - p = search_terms (cclp, ap); - return p; - } - /* ordered relation ... */ - rel = 0; - if (cclp->look_token->len == 1) - { - if (cclp->look_token->name[0] == '<') - rel = 1; - else if (cclp->look_token->name[0] == '=') - rel = 3; - else if (cclp->look_token->name[0] == '>') - rel = 5; - } - else if (cclp->look_token->len == 2) - { - if (!memcmp (cclp->look_token->name, "<=", 2)) - rel = 2; - else if (!memcmp (cclp->look_token->name, ">=", 2)) - rel = 4; - else if (!memcmp (cclp->look_token->name, "<>", 2)) - rel = 6; - } - if (!rel) - cclp->error_code = CCL_ERR_BAD_RELATION; - else - { - struct ccl_rpn_node *p; - - ADVANCE; /* skip relation */ - if (KIND == CCL_TOK_TERM && - cclp->look_token->next && cclp->look_token->next->len == 1 && - cclp->look_token->next->name[0] == '-') - { - struct ccl_rpn_node *p1; - if (!(p1 = search_term (cclp, ap))) - return NULL; - ADVANCE; /* skip '-' */ - if (KIND == CCL_TOK_TERM) /* = term - term ? */ - { - struct ccl_rpn_node *p2; - - if (!(p2 = search_term (cclp, ap))) - { - ccl_rpn_delete (p1); - return NULL; - } - p = mk_node (CCL_RPN_AND); - p->u.p[0] = p1; - add_attr_numeric (p1, attset, CCL_BIB1_REL, 4); - p->u.p[1] = p2; - add_attr_numeric (p2, attset, CCL_BIB1_REL, 2); - return p; - } - else /* = term - */ - { - add_attr_numeric (p1, attset, CCL_BIB1_REL, 4); - return p1; - } - } - else if (cclp->look_token->len == 1 && - cclp->look_token->name[0] == '-') /* = - term ? */ - { - ADVANCE; - if (!(p = search_term (cclp, ap))) - return NULL; - add_attr_numeric (p, attset, CCL_BIB1_REL, 2); - return p; - } - else if (KIND == CCL_TOK_LP) - { - ADVANCE; - if (!(p = find_spec (cclp, ap))) - return NULL; - if (KIND != CCL_TOK_RP) - { - cclp->error_code = CCL_ERR_RP_EXPECTED; - ccl_rpn_delete (p); - return NULL; - } - ADVANCE; - return p; - } - else - { - if (!(p = search_terms (cclp, ap))) - return NULL; - add_attr_numeric (p, attset, CCL_BIB1_REL, rel); - return p; - } - cclp->error_code = CCL_ERR_TERM_EXPECTED; - } - return NULL; -} - -/* - * qualifiers1: Parse CCL qualifiers and search terms. - * cclp: CCL Parser - * la: Token pointer to RELATION token. - * qa: Qualifier attributes already applied. - * return: pointer to node(s); NULL on error. - */ -static struct ccl_rpn_node *qualifiers1 (CCL_parser cclp, struct ccl_token *la, - struct ccl_rpn_attr **qa) -{ - struct ccl_token *lookahead = cclp->look_token; - struct ccl_token *look_start = cclp->look_token; - struct ccl_rpn_attr **ap; - struct ccl_rpn_node *node = 0; - const char *field_str; - int no = 0; - int seq = 0; - int i; - int mode_merge = 1; -#if 0 - if (qa) - { - cclp->error_code = CCL_ERR_DOUBLE_QUAL; - return NULL; - } -#endif - for (lookahead = cclp->look_token; lookahead != la; - lookahead=lookahead->next) - no++; - if (qa) - for (i=0; qa[i]; i++) - no++; - ap = (struct ccl_rpn_attr **)xmalloc ((no ? (no+1) : 2) * sizeof(*ap)); - ccl_assert (ap); - - field_str = ccl_qual_search_special(cclp->bibset, "field"); - if (field_str) - { - if (!strcmp (field_str, "or")) - mode_merge = 0; - else if (!strcmp (field_str, "merge")) - mode_merge = 1; - } - if (!mode_merge) - { - /* consider each field separately and OR */ - lookahead = look_start; - while (lookahead != la) - { - ap[1] = 0; - seq = 0; - while ((ap[0] = ccl_qual_search (cclp, lookahead->name, - lookahead->len, seq)) != 0) - { - struct ccl_rpn_node *node_sub; - cclp->look_token = la; - - node_sub = qualifiers2(cclp, ap); - if (!node_sub) - { - ccl_rpn_delete (node); - xfree (ap); - return 0; - } - if (node) - { - struct ccl_rpn_node *node_this = mk_node(CCL_RPN_OR); - node_this->u.p[0] = node; - node_this->u.p[1] = node_sub; - node = node_this; - } - else - node = node_sub; - seq++; - } - if (seq == 0) - { - cclp->look_token = lookahead; - cclp->error_code = CCL_ERR_UNKNOWN_QUAL; - xfree (ap); - return NULL; - } - lookahead = lookahead->next; - if (lookahead->kind == CCL_TOK_COMMA) - lookahead = lookahead->next; - } - } - else - { - /* merge attributes from ALL fields - including inherited ones */ - while (1) - { - struct ccl_rpn_node *node_sub; - int found = 0; - lookahead = look_start; - for (i = 0; lookahead != la; i++) - { - ap[i] = ccl_qual_search (cclp, lookahead->name, - lookahead->len, seq); - if (ap[i]) - found++; - if (!ap[i] && seq > 0) - ap[i] = ccl_qual_search (cclp, lookahead->name, - lookahead->len, 0); - if (!ap[i]) - { - cclp->look_token = lookahead; - cclp->error_code = CCL_ERR_UNKNOWN_QUAL; - xfree (ap); - return NULL; - } - lookahead = lookahead->next; - if (lookahead->kind == CCL_TOK_COMMA) - lookahead = lookahead->next; - } - if (qa) - { - struct ccl_rpn_attr **qa0 = qa; - - while (*qa0) - ap[i++] = *qa0++; - } - ap[i] = NULL; - - if (!found) - break; - - cclp->look_token = lookahead; - - node_sub = qualifiers2(cclp, ap); - if (!node_sub) - { - ccl_rpn_delete (node); - break; - } - if (node) - { - struct ccl_rpn_node *node_this = mk_node(CCL_RPN_OR); - node_this->u.p[0] = node; - node_this->u.p[1] = node_sub; - node = node_this; - } - else - node = node_sub; - seq++; - } - } - xfree (ap); - return node; -} - - -/* - * search_terms: Parse CCL search terms - including proximity. - * cclp: CCL Parser - * qa: Qualifier attributes already applied. - * return: pointer to node(s); NULL on error. - */ -static struct ccl_rpn_node *search_terms (CCL_parser cclp, - struct ccl_rpn_attr **qa) -{ - static int list[] = { - CCL_TOK_TERM, CCL_TOK_COMMA,CCL_TOK_EQ, CCL_TOK_REL, CCL_TOK_SET, -1}; - struct ccl_rpn_node *p1, *p2, *pn; - p1 = search_term_x (cclp, qa, list, 1); - if (!p1) - return NULL; - while (1) - { - if (KIND == CCL_TOK_PROX) - { - struct ccl_rpn_node *p_prox = 0; - /* ! word order specified */ - /* % word order not specified */ - p_prox = mk_node(CCL_RPN_TERM); - p_prox->u.t.term = (char *) xmalloc(cclp->look_token->len); - memcpy(p_prox->u.t.term, cclp->look_token->name, - cclp->look_token->len); - p_prox->u.t.term[cclp->look_token->len] = 0; - p_prox->u.t.attr_list = 0; - - ADVANCE; - p2 = search_term_x (cclp, qa, list, 1); - if (!p2) - { - ccl_rpn_delete (p1); - return NULL; - } - pn = mk_node (CCL_RPN_PROX); - pn->u.p[0] = p1; - pn->u.p[1] = p2; - pn->u.p[2] = p_prox; - p1 = pn; - } - else if (is_term_ok(KIND, list)) - { - p2 = search_term_x (cclp, qa, list, 1); - if (!p2) - { - ccl_rpn_delete (p1); - return NULL; - } - pn = mk_node (CCL_RPN_PROX); - pn->u.p[0] = p1; - pn->u.p[1] = p2; - pn->u.p[2] = 0; - p1 = pn; - } - else - break; - } - return p1; -} - -/* - * search_elements: Parse CCL search elements - * cclp: CCL Parser - * qa: Qualifier attributes already applied. - * return: pointer to node(s); NULL on error. - */ -static struct ccl_rpn_node *search_elements (CCL_parser cclp, - struct ccl_rpn_attr **qa) -{ - struct ccl_rpn_node *p1; - struct ccl_token *lookahead; - if (KIND == CCL_TOK_LP) - { - ADVANCE; - p1 = find_spec (cclp, qa); - if (!p1) - return NULL; - if (KIND != CCL_TOK_RP) - { - cclp->error_code = CCL_ERR_RP_EXPECTED; - ccl_rpn_delete (p1); - return NULL; - } - ADVANCE; - return p1; - } - else if (KIND == CCL_TOK_SET) - { - ADVANCE; - if (KIND == CCL_TOK_EQ) - ADVANCE; - if (KIND != CCL_TOK_TERM) - { - cclp->error_code = CCL_ERR_SETNAME_EXPECTED; - return NULL; - } - p1 = mk_node (CCL_RPN_SET); - p1->u.setname = copy_token_name (cclp->look_token); - ADVANCE; - return p1; - } - lookahead = cclp->look_token; - - while (lookahead->kind==CCL_TOK_TERM) - { - lookahead = lookahead->next; - if (lookahead->kind == CCL_TOK_REL || lookahead->kind == CCL_TOK_EQ) - return qualifiers1 (cclp, lookahead, qa); - if (lookahead->kind != CCL_TOK_COMMA) - break; - lookahead = lookahead->next; - } - if (qa) - return search_terms (cclp, qa); - else - { - struct ccl_rpn_attr *qa[2]; - struct ccl_rpn_node *node = 0; - int seq; - lookahead = cclp->look_token; - - qa[1] = 0; - for(seq = 0; ;seq++) - { - struct ccl_rpn_node *node_sub; - qa[0] = ccl_qual_search(cclp, "term", 4, seq); - if (!qa[0]) - break; - - cclp->look_token = lookahead; - - node_sub = search_terms (cclp, qa); - if (!node_sub) - { - ccl_rpn_delete (node); - return 0; - } - if (node) - { - struct ccl_rpn_node *node_this = mk_node(CCL_RPN_OR); - node_this->u.p[0] = node; - node_this->u.p[1] = node_sub; - node_this->u.p[2] = 0; - node = node_this; - } - else - node = node_sub; - } - if (!node) - node = search_terms (cclp, 0); - return node; - } -} - -/* - * find_spec: Parse CCL find specification - * cclp: CCL Parser - * qa: Qualifier attributes already applied. - * return: pointer to node(s); NULL on error. - */ -static struct ccl_rpn_node *find_spec (CCL_parser cclp, - struct ccl_rpn_attr **qa) -{ - struct ccl_rpn_node *p1, *p2, *pn; - if (!(p1 = search_elements (cclp, qa))) - return NULL; - while (1) - { - switch (KIND) - { - case CCL_TOK_AND: - ADVANCE; - p2 = search_elements (cclp, qa); - if (!p2) - { - ccl_rpn_delete (p1); - return NULL; - } - pn = mk_node (CCL_RPN_AND); - pn->u.p[0] = p1; - pn->u.p[1] = p2; - pn->u.p[2] = 0; - p1 = pn; - continue; - case CCL_TOK_OR: - ADVANCE; - p2 = search_elements (cclp, qa); - if (!p2) - { - ccl_rpn_delete (p1); - return NULL; - } - pn = mk_node (CCL_RPN_OR); - pn->u.p[0] = p1; - pn->u.p[1] = p2; - pn->u.p[2] = 0; - p1 = pn; - continue; - case CCL_TOK_NOT: - ADVANCE; - p2 = search_elements (cclp, qa); - if (!p2) - { - ccl_rpn_delete (p1); - return NULL; - } - pn = mk_node (CCL_RPN_NOT); - pn->u.p[0] = p1; - pn->u.p[1] = p2; - pn->u.p[2] = 0; - p1 = pn; - continue; - } - break; - } - return p1; -} - -struct ccl_rpn_node *ccl_parser_find (CCL_parser cclp, struct ccl_token *list) -{ - struct ccl_rpn_node *p; - - - - cclp->look_token = list; - p = find_spec (cclp, NULL); - if (p && KIND != CCL_TOK_EOL) - { - if (KIND == CCL_TOK_RP) - cclp->error_code = CCL_ERR_BAD_RP; - else - cclp->error_code = CCL_ERR_OP_EXPECTED; - ccl_rpn_delete (p); - p = NULL; - } - cclp->error_pos = cclp->look_token->name; - if (p) - cclp->error_code = CCL_ERR_OK; - else - cclp->error_code = cclp->error_code; - return p; -} - -/* - * ccl_find: Parse CCL find - token representation - * bibset: Bibset to be used for the parsing - * list: List of tokens - * error: Pointer to integer. Holds error no. on completion. - * pos: Pointer to char position. Holds approximate error position. - * return: RPN tree on successful completion; NULL otherwise. - */ -struct ccl_rpn_node *ccl_find (CCL_bibset bibset, struct ccl_token *list, - int *error, const char **pos) -{ - struct ccl_rpn_node *p; - CCL_parser cclp = ccl_parser_create (); - - cclp->bibset = bibset; - - p = ccl_parser_find (cclp, list); - - *error = cclp->error_code; - *pos = cclp->error_pos; - - ccl_parser_destroy (cclp); - - return p; -} - -/* - * ccl_find_str: Parse CCL find - string representation - * bibset: Bibset to be used for the parsing - * str: String to be parsed - * error: Pointer to integer. Holds error no. on completion. - * pos: Pointer to char position. Holds approximate error position. - * return: RPN tree on successful completion; NULL otherwise. - */ -struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str, - int *error, int *pos) -{ - CCL_parser cclp = ccl_parser_create (); - struct ccl_token *list; - struct ccl_rpn_node *p; - - cclp->bibset = bibset; - - list = ccl_parser_tokenize (cclp, str); - p = ccl_parser_find (cclp, list); - - *error = cclp->error_code; - if (*error) - *pos = cclp->error_pos - str; - ccl_parser_destroy (cclp); - ccl_token_del (list); - return p; -} diff --git a/ccl/cclptree.c b/ccl/cclptree.c deleted file mode 100644 index 055a140..0000000 --- a/ccl/cclptree.c +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) 1995, the EUROPAGATE consortium (see below). - * - * The EUROPAGATE consortium members are: - * - * University College Dublin - * Danmarks Teknologiske Videnscenter - * An Chomhairle Leabharlanna - * Consejo Superior de Investigaciones Cientificas - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of EUROPAGATE or the project partners may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * 3. Users of this software (implementors and gateway operators) agree to - * inform the EUROPAGATE consortium of their use of the software. This - * information will be used to evaluate the EUROPAGATE project and the - * software, and to plan further developments. The consortium may use - * the information in later publications. - * - * 4. Users of this software agree to make their best efforts, when - * documenting their use of the software, to acknowledge the EUROPAGATE - * consortium, and the role played by the software in their work. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE - * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF - * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA - * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND - * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ -/* CCL print rpn tree - infix notation - * Europagate, 1995 - * - * $Id: cclptree.c,v 1.15 2003-10-16 10:18:29 adam Exp $ - * - * Old Europagate Log: - * - * Revision 1.6 1995/05/16 09:39:26 adam - * LICENSE. - * - * Revision 1.5 1995/02/23 08:31:59 adam - * Changed header. - * - * Revision 1.3 1995/02/15 17:42:16 adam - * Minor changes of the api of this module. FILE* argument added - * to ccl_pr_tree. - * - * Revision 1.2 1995/02/14 19:55:11 adam - * Header files ccl.h/cclp.h are gone! They have been merged an - * moved to ../include/ccl.h. - * Node kind(s) in ccl_rpn_node have changed names. - * - * Revision 1.1 1995/02/14 10:25:56 adam - * The constructions 'qualifier rel term ...' implemented. - * - */ - -#include -#include -#include - -#include - -void fprintSpaces(int indent,FILE * fd_out) -{ - char buf[100]; - sprintf(buf,"%%%d.s",indent); - fprintf(fd_out,buf," "); -} - -void ccl_pr_tree_as_qrpn(struct ccl_rpn_node *rpn, FILE *fd_out, int indent) -{ - if(indent>0) fprintSpaces(indent,fd_out); - switch (rpn->kind) - { - case CCL_RPN_TERM: - if (rpn->u.t.attr_list) - { - struct ccl_rpn_attr *attr; - for (attr = rpn->u.t.attr_list; attr; attr = attr->next) - { - if (attr->set) - fprintf(fd_out, "@attr %s", attr->set); - else - fprintf(fd_out, "@attr "); - switch(attr->kind) - { - case CCL_RPN_ATTR_NUMERIC: - fprintf (fd_out, "%d=%d ", attr->type, - attr->value.numeric); - break; - case CCL_RPN_ATTR_STRING: - fprintf (fd_out, "%d=%s ", attr->type, - attr->value.str); - } - } - } - fprintf (fd_out, "\"%s\"\n", rpn->u.t.term); - break; - case CCL_RPN_AND: - fprintf (fd_out, "@and \n"); - ccl_pr_tree_as_qrpn (rpn->u.p[0], fd_out,indent+2); - ccl_pr_tree_as_qrpn (rpn->u.p[1], fd_out,indent+2); - break; - case CCL_RPN_OR: - fprintf (fd_out, "@or \n"); - ccl_pr_tree_as_qrpn (rpn->u.p[0], fd_out,indent+2); - ccl_pr_tree_as_qrpn (rpn->u.p[1], fd_out,indent+2); - break; - case CCL_RPN_NOT: - fprintf (fd_out, "@not "); - ccl_pr_tree_as_qrpn (rpn->u.p[0], fd_out,indent+2); - ccl_pr_tree_as_qrpn (rpn->u.p[1], fd_out,indent+2); - break; - case CCL_RPN_SET: - fprintf (fd_out, "set=%s ", rpn->u.setname); - break; - case CCL_RPN_PROX: - if (rpn->u.p[2] && rpn->u.p[2]->kind == CCL_RPN_TERM) - { - const char *cp = rpn->u.p[2]->u.t.term; - /* exlusion distance ordered relation which-code unit-code */ - if (*cp == '!') - { - /* word order specified */ - if (isdigit(cp[1])) - fprintf(fd_out, "@prox 0 %s 1 2 known 2", cp+1); - else - fprintf(fd_out, "@prox 0 1 1 2 known 2"); - } - else if (*cp == '%') - { - /* word order not specified */ - if (isdigit(cp[1])) - fprintf(fd_out, "@prox 0 %s 0 2 known 2", cp+1); - else - fprintf(fd_out, "@prox 0 1 0 2 known 2"); - } - } - ccl_pr_tree_as_qrpn (rpn->u.p[0], fd_out,indent+2); - ccl_pr_tree_as_qrpn (rpn->u.p[1], fd_out,indent+2); - break; - default: - fprintf(stderr,"Internal Error Unknown ccl_rpn node type %d\n",rpn->kind); - } -} - - -void ccl_pr_tree (struct ccl_rpn_node *rpn, FILE *fd_out) -{ - ccl_pr_tree_as_qrpn(rpn,fd_out,0); -} - - -static void ccl_pquery_complex (WRBUF w, struct ccl_rpn_node *p) -{ - switch (p->kind) - { - case CCL_RPN_AND: - wrbuf_puts(w, "@and "); - break; - case CCL_RPN_OR: - wrbuf_puts(w, "@or "); - break; - case CCL_RPN_NOT: - wrbuf_puts(w, "@not "); - break; - case CCL_RPN_PROX: - if (p->u.p[2] && p->u.p[2]->kind == CCL_RPN_TERM) - { - const char *cp = p->u.p[2]->u.t.term; - /* exlusion distance ordered relation which-code unit-code */ - if (*cp == '!') - { - /* word order specified */ - if (isdigit(cp[1])) - wrbuf_printf(w, "@prox 0 %s 1 2 k 2 ", cp+1); - else - wrbuf_printf(w, "@prox 0 1 1 2 k 2 "); - } - else if (*cp == '%') - { - /* word order not specified */ - if (isdigit(cp[1])) - wrbuf_printf(w, "@prox 0 %s 0 2 k 2 ", cp+1); - else - wrbuf_printf(w, "@prox 0 1 0 2 k 2 "); - } - } - else - wrbuf_puts(w, "@prox 0 2 0 1 k 2 "); - break; - default: - wrbuf_puts(w, "@ bad op (unknown) "); - } - ccl_pquery(w, p->u.p[0]); - ccl_pquery(w, p->u.p[1]); -} - -void ccl_pquery (WRBUF w, struct ccl_rpn_node *p) -{ - struct ccl_rpn_attr *att; - const char *cp; - - switch (p->kind) - { - case CCL_RPN_AND: - case CCL_RPN_OR: - case CCL_RPN_NOT: - case CCL_RPN_PROX: - ccl_pquery_complex (w, p); - break; - case CCL_RPN_SET: - wrbuf_puts (w, "@set "); - wrbuf_puts (w, p->u.setname); - wrbuf_puts (w, " "); - break; - case CCL_RPN_TERM: - for (att = p->u.t.attr_list; att; att = att->next) - { - char tmpattr[128]; - wrbuf_puts (w, "@attr "); - if (att->set) - { - wrbuf_puts (w, att->set); - wrbuf_puts (w, " "); - } - switch(att->kind) - { - case CCL_RPN_ATTR_NUMERIC: - sprintf(tmpattr, "%d=%d ", att->type, att->value.numeric); - wrbuf_puts (w, tmpattr); - break; - case CCL_RPN_ATTR_STRING: - sprintf(tmpattr, "%d=", att->type); - wrbuf_puts (w, tmpattr); - wrbuf_puts(w, att->value.str); - wrbuf_puts (w, " "); - break; - } - } - for (cp = p->u.t.term; *cp; cp++) - { - if (*cp == ' ' || *cp == '\\') - wrbuf_putc (w, '\\'); - wrbuf_putc (w, *cp); - } - wrbuf_puts (w, " "); - break; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ccl/cclqfile.c b/ccl/cclqfile.c deleted file mode 100644 index 61cd463..0000000 --- a/ccl/cclqfile.c +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 1995, the EUROPAGATE consortium (see below). - * - * The EUROPAGATE consortium members are: - * - * University College Dublin - * Danmarks Teknologiske Videnscenter - * An Chomhairle Leabharlanna - * Consejo Superior de Investigaciones Cientificas - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of EUROPAGATE or the project partners may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * 3. Users of this software (implementors and gateway operators) agree to - * inform the EUROPAGATE consortium of their use of the software. This - * information will be used to evaluate the EUROPAGATE project and the - * software, and to plan further developments. The consortium may use - * the information in later publications. - * - * 4. Users of this software agree to make their best efforts, when - * documenting their use of the software, to acknowledge the EUROPAGATE - * consortium, and the role played by the software in their work. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE - * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF - * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA - * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND - * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ -/* CCL qualifiers - * Europagate, 1995 - * - * $Id: cclqfile.c,v 1.14 2003-06-23 10:22:21 adam Exp $ - * - * Old Europagate Log: - * - * Revision 1.3 1995/05/16 09:39:26 adam - * LICENSE. - * - * Revision 1.2 1995/05/11 14:03:56 adam - * Changes in the reading of qualifier(s). New function: ccl_qual_fitem. - * New variable ccl_case_sensitive, which controls whether reserved - * words and field names are case sensitive or not. - * - * Revision 1.1 1995/04/17 09:31:45 adam - * Improved handling of qualifiers. Aliases or reserved words. - * - */ - -#include -#include -#include - -#include - -void ccl_qual_field (CCL_bibset bibset, const char *cp, const char *qual_name) -{ - char qual_spec[128]; - int type_ar[128]; - int value_ar[128]; - char *svalue_ar[128]; - char *attsets[128]; - int pair_no = 0; - - while (pair_no < 128) - { - char *qual_value, *qual_type; - char *split, *setp; - int no_scan = 0; - - if (sscanf (cp, "%100s%n", qual_spec, &no_scan) < 1) - break; - - if (!(split = strchr (qual_spec, '='))) - { - /* alias specification .. */ - if (pair_no == 0) - { - ccl_qual_add_combi (bibset, qual_name, cp); - return; - } - break; - } - /* [set,]type=value ... */ - cp += no_scan; - - *split++ = '\0'; - - setp = strchr (qual_spec, ','); - if (setp) - { - /* set,type=value ... */ - *setp++ = '\0'; - qual_type = setp; - } - else - { - /* type=value ... */ - qual_type = qual_spec; - } - while (pair_no < 128) - { - int type, value; - - qual_value = split; - if ((split = strchr (qual_value, ','))) - *split++ = '\0'; - - value = 0; - switch (qual_type[0]) - { - case 'u': - case 'U': - type = CCL_BIB1_USE; - break; - case 'r': - case 'R': - type = CCL_BIB1_REL; - if (!ccl_stricmp (qual_value, "o")) - value = CCL_BIB1_REL_ORDER; - break; - case 'p': - case 'P': - type = CCL_BIB1_POS; - break; - case 's': - case 'S': - type = CCL_BIB1_STR; - if (!ccl_stricmp (qual_value, "pw")) - value = CCL_BIB1_STR_WP; - if (!ccl_stricmp (qual_value, "al")) - value = CCL_BIB1_STR_AND_LIST; - if (!ccl_stricmp (qual_value, "ol")) - value = CCL_BIB1_STR_OR_LIST; - break; - case 't': - case 'T': - type = CCL_BIB1_TRU; - if (!ccl_stricmp (qual_value, "l")) - value = CCL_BIB1_TRU_CAN_LEFT; - else if (!ccl_stricmp (qual_value, "r")) - value = CCL_BIB1_TRU_CAN_RIGHT; - else if (!ccl_stricmp (qual_value, "b")) - value = CCL_BIB1_TRU_CAN_BOTH; - else if (!ccl_stricmp (qual_value, "n")) - value = CCL_BIB1_TRU_CAN_NONE; - break; - case 'c': - case 'C': - type = CCL_BIB1_COM; - break; - default: - type = atoi (qual_type); - } - - type_ar[pair_no] = type; - - if (value) - { - value_ar[pair_no] = value; - svalue_ar[pair_no] = 0; - } - else if (*qual_value >= '0' && *qual_value <= '9') - { - value_ar[pair_no] = atoi (qual_value); - svalue_ar[pair_no] = 0; - } - else - { - size_t len; - if (split) - len = split - qual_value; - else - len = strlen(qual_value); - svalue_ar[pair_no] = xmalloc(len+1); - memcpy(svalue_ar[pair_no], qual_value, len); - svalue_ar[pair_no][len] = '\0'; - } - if (setp) - { - attsets[pair_no] = (char*) xmalloc (strlen(qual_spec)+1); - strcpy (attsets[pair_no], qual_spec); - } - else - attsets[pair_no] = 0; - pair_no++; - if (!split) - break; - } - } - ccl_qual_add_set (bibset, qual_name, pair_no, type_ar, value_ar, svalue_ar, - attsets); -} - -void ccl_qual_fitem (CCL_bibset bibset, const char *cp, const char *qual_name) -{ - if (*qual_name == '@') - ccl_qual_add_special(bibset, qual_name+1, cp); - else - ccl_qual_field(bibset, cp, qual_name); -} - -/* - * ccl_qual_file: Read bibset definition from file. - * bibset: Bibset - * inf: FILE pointer. - * - * Each line format is: - * = = .... - * Where is name of qualifier; - * = is a attribute definition pair where is one of: - * u(use), r(relation), p(position), t(truncation), c(completeness) - * or plain integer. - * is an integer or special pseudo-value. - */ -void ccl_qual_file (CCL_bibset bibset, FILE *inf) -{ - char line[256]; - char *cp, *cp1; - char qual_name[128]; - - while (fgets (line, 255, inf)) - { - int no_scan = 0; - - cp = line; - if (*cp == '#') - continue; /* ignore lines starting with # */ - if (sscanf (cp, "%100s%n", qual_name, &no_scan) < 1) - continue; /* also ignore empty lines */ - cp += no_scan; - cp1 = strchr(cp, '#'); - if (cp1) - *cp1 = '\0'; - ccl_qual_fitem (bibset, cp, qual_name); - } -} - -int ccl_qual_fname (CCL_bibset bibset, const char *fname) -{ - FILE *inf; - inf = fopen (fname, "r"); - if (!inf) - return -1; - ccl_qual_file (bibset, inf); - fclose (inf); - return 0; -} diff --git a/ccl/cclqual.c b/ccl/cclqual.c deleted file mode 100644 index b0ec3f2..0000000 --- a/ccl/cclqual.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Copyright (c) 1995, the EUROPAGATE consortium (see below). - * - * The EUROPAGATE consortium members are: - * - * University College Dublin - * Danmarks Teknologiske Videnscenter - * An Chomhairle Leabharlanna - * Consejo Superior de Investigaciones Cientificas - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of EUROPAGATE or the project partners may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * 3. Users of this software (implementors and gateway operators) agree to - * inform the EUROPAGATE consortium of their use of the software. This - * information will be used to evaluate the EUROPAGATE project and the - * software, and to plan further developments. The consortium may use - * the information in later publications. - * - * 4. Users of this software agree to make their best efforts, when - * documenting their use of the software, to acknowledge the EUROPAGATE - * consortium, and the role played by the software in their work. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE - * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF - * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA - * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND - * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ -/* CCL qualifiers - * Europagate, 1995 - * - * $Id: cclqual.c,v 1.19 2003-06-23 10:22:21 adam Exp $ - * - * Old Europagate Log: - * - * Revision 1.9 1995/05/16 09:39:27 adam - * LICENSE. - * - * Revision 1.8 1995/05/11 14:03:57 adam - * Changes in the reading of qualifier(s). New function: ccl_qual_fitem. - * New variable ccl_case_sensitive, which controls whether reserved - * words and field names are case sensitive or not. - * - * Revision 1.7 1995/04/17 09:31:46 adam - * Improved handling of qualifiers. Aliases or reserved words. - * - * Revision 1.6 1995/02/23 08:32:00 adam - * Changed header. - * - * Revision 1.4 1995/02/14 19:55:12 adam - * Header files ccl.h/cclp.h are gone! They have been merged an - * moved to ../include/ccl.h. - * Node kind(s) in ccl_rpn_node have changed names. - * - * Revision 1.3 1995/02/14 16:20:56 adam - * Qualifiers are read from a file now. - * - * Revision 1.2 1995/02/14 10:25:56 adam - * The constructions 'qualifier rel term ...' implemented. - * - * Revision 1.1 1995/02/13 15:15:07 adam - * Added handling of qualifiers. Not finished yet. - * - */ - -#include -#include -#include - -#include - -/* Definition of CCL_bibset pointer */ -struct ccl_qualifiers { - struct ccl_qualifier *list; - struct ccl_qualifier_special *special; -}; - - -/* CCL Qualifier special */ -struct ccl_qualifier_special { - char *name; - char *value; - struct ccl_qualifier_special *next; -}; - - -static struct ccl_qualifier *ccl_qual_lookup (CCL_bibset b, - const char *n, size_t len) -{ - struct ccl_qualifier *q; - for (q = b->list; q; q = q->next) - if (len == strlen(q->name) && !memcmp (q->name, n, len)) - break; - return q; -} - - -void ccl_qual_add_special (CCL_bibset bibset, const char *n, const char *v) -{ - struct ccl_qualifier_special *p; - const char *pe; - - for (p = bibset->special; p && strcmp(p->name, n); p = p->next) - ; - if (p) - xfree (p->value); - else - { - p = (struct ccl_qualifier_special *) xmalloc (sizeof(*p)); - p->name = ccl_strdup (n); - p->value = 0; - p->next = bibset->special; - bibset->special = p; - } - while (strchr(" \t", *v)) - ++v; - for (pe = v + strlen(v); pe != v; --pe) - if (!strchr(" \n\r\t", pe[-1])) - break; - p->value = (char*) xmalloc (pe - v + 1); - if (pe - v) - memcpy (p->value, v, pe - v); - p->value[pe - v] = '\0'; -} - -static int next_token(const char **cpp, const char **dst) -{ - int len = 0; - const char *cp = *cpp; - while (*cp && strchr(" \r\n\t\f", *cp)) - cp++; - if (dst) - *dst = cp; - len = 0; - while (*cp && !strchr(" \r\n\t\f", *cp)) - { - cp++; - len++; - } - *cpp = cp; - return len; -} - -void ccl_qual_add_combi (CCL_bibset b, const char *n, const char *names) -{ - const char *cp, *cp1; - int i, len; - struct ccl_qualifier *q; - for (q = b->list; q && strcmp(q->name, n); q = q->next) - ; - if (q) - return ; - q = (struct ccl_qualifier *) xmalloc (sizeof(*q)); - q->name = ccl_strdup (n); - q->attr_list = 0; - q->next = b->list; - b->list = q; - - cp = names; - for (i = 0; next_token(&cp, 0); i++) - ; - q->no_sub = i; - q->sub = (struct ccl_qualifier **) xmalloc (sizeof(*q->sub) * - (1+q->no_sub)); - cp = names; - for (i = 0; (len = next_token(&cp, &cp1)); i++) - { - q->sub[i] = ccl_qual_lookup (b, cp1, len); - } -} - -/* - * ccl_qual_add: Add qualifier to Bibset. If qualifier already - * exists, then attributes are appendend to old - * definition. - * name: name of qualifier - * no: No of attribute type/value pairs. - * pairs: Attributes. pairs[0] first type, pair[1] first value, - * ... pair[2*no-2] last type, pair[2*no-1] last value. - */ - -void ccl_qual_add_set (CCL_bibset b, const char *name, int no, - int *type_ar, int *value_ar, char **svalue_ar, - char **attsets) -{ - struct ccl_qualifier *q; - struct ccl_rpn_attr **attrp; - - ccl_assert (b); - for (q = b->list; q; q = q->next) - if (!strcmp (name, q->name)) - break; - if (!q) - { - struct ccl_qualifier *new_qual = - (struct ccl_qualifier *)xmalloc (sizeof(*new_qual)); - ccl_assert (new_qual); - - new_qual->next = b->list; - b->list = new_qual; - - new_qual->name = ccl_strdup (name); - attrp = &new_qual->attr_list; - - new_qual->no_sub = 0; - new_qual->sub = 0; - } - else - { - if (q->sub) /* suspect.. */ - xfree (q->sub); - attrp = &q->attr_list; - while (*attrp) - attrp = &(*attrp)->next; - } - while (--no >= 0) - { - struct ccl_rpn_attr *attr; - - attr = (struct ccl_rpn_attr *)xmalloc (sizeof(*attr)); - ccl_assert (attr); - attr->set = *attsets++; - attr->type = *type_ar++; - if (*svalue_ar) - { - attr->kind = CCL_RPN_ATTR_STRING; - attr->value.str = *svalue_ar; - } - else - { - attr->kind = CCL_RPN_ATTR_NUMERIC; - attr->value.numeric = *value_ar; - } - svalue_ar++; - value_ar++; - *attrp = attr; - attrp = &attr->next; - } - *attrp = NULL; -} - -/* - * ccl_qual_mk: Make new (empty) bibset. - * return: empty bibset. - */ -CCL_bibset ccl_qual_mk (void) -{ - CCL_bibset b = (CCL_bibset)xmalloc (sizeof(*b)); - ccl_assert (b); - b->list = NULL; - b->special = NULL; - return b; -} - -/* - * ccl_qual_rm: Delete bibset. - * b: pointer to bibset - */ -void ccl_qual_rm (CCL_bibset *b) -{ - struct ccl_qualifier *q, *q1; - struct ccl_qualifier_special *sp, *sp1; - - if (!*b) - return; - for (q = (*b)->list; q; q = q1) - { - struct ccl_rpn_attr *attr, *attr1; - - for (attr = q->attr_list; attr; attr = attr1) - { - attr1 = attr->next; - if (attr->set) - xfree(attr->set); - if (attr->kind == CCL_RPN_ATTR_STRING) - xfree(attr->value.str); - xfree (attr); - } - q1 = q->next; - xfree (q->name); - if (q->sub) - xfree (q->sub); - xfree (q); - } - for (sp = (*b)->special; sp; sp = sp1) - { - sp1 = sp->next; - xfree (sp->name); - xfree (sp->value); - xfree (sp); - } - xfree (*b); - *b = NULL; -} - -/* - * ccl_qual_search: Search for qualifier in bibset. - * b: Bibset - * name: Name of qualifier to search for (need no null-termination) - * len: Length of name. - * return: Attribute info. NULL if not found. - */ -struct ccl_rpn_attr *ccl_qual_search (CCL_parser cclp, - const char *name, size_t len, - int seq) -{ - struct ccl_qualifier *q; - const char *aliases; - int case_sensitive = cclp->ccl_case_sensitive; - - ccl_assert (cclp); - if (!cclp->bibset) - return NULL; - - aliases = ccl_qual_search_special(cclp->bibset, "case"); - if (aliases) - case_sensitive = atoi(aliases); - - for (q = cclp->bibset->list; q; q = q->next) - if (strlen(q->name) == len) - { - if (case_sensitive) - { - if (!memcmp (name, q->name, len)) - break; - } - else - { - if (!ccl_memicmp (name, q->name, len)) - break; - } - } - if (q) - { - if (q->attr_list && seq == 0) - return q->attr_list; - if (seq < q->no_sub && q->sub[seq]) - { - return q->sub[seq]->attr_list; - } - } - return 0; -} - -const char *ccl_qual_search_special (CCL_bibset b, - const char *name) -{ - struct ccl_qualifier_special *q; - if (!b) - return 0; - for (q = b->special; q && strcmp(q->name, name); q = q->next) - ; - if (q) - return q->value; - return 0; -} diff --git a/ccl/cclsh.c b/ccl/cclsh.c deleted file mode 100644 index 27b3464..0000000 --- a/ccl/cclsh.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (c) 1995, the EUROPAGATE consortium (see below). - * - * The EUROPAGATE consortium members are: - * - * University College Dublin - * Danmarks Teknologiske Videnscenter - * An Chomhairle Leabharlanna - * Consejo Superior de Investigaciones Cientificas - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of EUROPAGATE or the project partners may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * 3. Users of this software (implementors and gateway operators) agree to - * inform the EUROPAGATE consortium of their use of the software. This - * information will be used to evaluate the EUROPAGATE project and the - * software, and to plan further developments. The consortium may use - * the information in later publications. - * - * 4. Users of this software agree to make their best efforts, when - * documenting their use of the software, to acknowledge the EUROPAGATE - * consortium, and the role played by the software in their work. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE - * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF - * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA - * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND - * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ -/* CCL shell. - * Europagate 1995 - * - * $Id: cclsh.c,v 1.11 2001-11-27 22:38:50 adam Exp $ - * - * Old Europagate Log: - * - * Revision 1.11 1995/05/16 09:39:27 adam - * LICENSE. - * - * Revision 1.10 1995/05/11 14:03:57 adam - * Changes in the reading of qualifier(s). New function: ccl_qual_fitem. - * New variable ccl_case_sensitive, which controls whether reserved - * words and field names are case sensitive or not. - * - * Revision 1.9 1995/02/23 08:32:00 adam - * Changed header. - * - * Revision 1.7 1995/02/15 17:42:16 adam - * Minor changes of the api of this module. FILE* argument added - * to ccl_pr_tree. - * - * Revision 1.6 1995/02/14 19:55:13 adam - * Header files ccl.h/cclp.h are gone! They have been merged an - * moved to ../include/ccl.h. - * Node kind(s) in ccl_rpn_node have changed names. - * - * Revision 1.5 1995/02/14 16:20:57 adam - * Qualifiers are read from a file now. - * - * Revision 1.4 1995/02/14 14:12:42 adam - * Ranges for ordered qualfiers implemented (e.g. pd=1980-1990). - * - * Revision 1.3 1995/02/14 10:25:57 adam - * The constructions 'qualifier rel term ...' implemented. - * - * Revision 1.2 1995/02/13 15:15:07 adam - * Added handling of qualifiers. Not finished yet. - * - * Revision 1.1 1995/02/13 12:35:21 adam - * First version of CCL. Qualifiers aren't handled yet. - */ - -#include -#include - -#include - - -#if HAVE_READLINE_READLINE_H -#include -#endif -#if HAVE_READLINE_HISTORY_H -#include -#endif - - -static int debug = 0; -static char *prog; - -void usage(const char *prog) -{ - fprintf (stderr, "%s: [-d] [-b configfile]\n", prog); - exit (1); -} - -int main (int argc, char **argv) -{ - CCL_bibset bibset; - FILE *bib_inf; - char *bib_fname; - - prog = *argv; - bibset = ccl_qual_mk (); - while (--argc > 0) - { - if (**++argv == '-') - { - switch (argv[0][1]) - { - case 'd': - debug = 1; - break; - case 'b': - if (argv[0][2]) - bib_fname = argv[0]+2; - else if (argc > 0) - { - --argc; - bib_fname = *++argv; - } - else - { - fprintf (stderr, "%s: missing bib filename\n", prog); - exit (1); - } - bib_inf = fopen (bib_fname, "r"); - if (!bib_inf) - { - fprintf (stderr, "%s: cannot open %s\n", prog, - bib_fname); - exit (1); - } - ccl_qual_file (bibset, bib_inf); - fclose (bib_inf); - break; - default: - usage(prog); - } - } - else - { - fprintf (stderr, "%s: no filenames, please\n", prog); - exit (1); - } - } - while (1) - { - char buf[1000]; - int i, error, pos; - struct ccl_rpn_node *rpn; - -#if HAVE_READLINE_READLINE_H - char* line_in; - line_in=readline("CCLSH>"); - if (!line_in) - break; -#if HAVE_READLINE_HISTORY_H - if (*line_in) - add_history(line_in); -#endif - if (strlen(line_in) > 999) { - fprintf(stderr,"Input line to long\n"); - break; - } - strcpy(buf,line_in); - free (line_in); -#else - printf ("CCLSH>"); fflush (stdout); - if (!fgets (buf, 999, stdin)) - break; -#endif - - for (i = 0; i<1; i++) - { - CCL_parser cclp = ccl_parser_create (); - struct ccl_token *list; - - cclp->bibset = bibset; - - list = ccl_parser_tokenize (cclp, buf); - rpn = ccl_parser_find (cclp, list); - - error = cclp->error_code; - if (error) - pos = cclp->error_pos - buf; - - if (error) - { - printf ("%*s^ - ", 6+pos, " "); - printf ("%s\n", ccl_err_msg (error)); - } - else - { - if (rpn && i == 0) - { - ccl_pr_tree (rpn, stdout); - printf ("\n"); - } - } - if (debug) - { - struct ccl_token *lp; - for (lp = list; lp; lp = lp->next) - printf ("%d %.*s\n", lp->kind, (int) (lp->len), lp->name); - } - ccl_token_del (list); - ccl_parser_destroy (cclp); - if (rpn) - ccl_rpn_delete(rpn); - } - } - printf ("\n"); - return 0; -} diff --git a/ccl/cclstr.c b/ccl/cclstr.c deleted file mode 100644 index 12d8d8b..0000000 --- a/ccl/cclstr.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 1995, the EUROPAGATE consortium (see below). - * - * The EUROPAGATE consortium members are: - * - * University College Dublin - * Danmarks Teknologiske Videnscenter - * An Chomhairle Leabharlanna - * Consejo Superior de Investigaciones Cientificas - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of EUROPAGATE or the project partners may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * 3. Users of this software (implementors and gateway operators) agree to - * inform the EUROPAGATE consortium of their use of the software. This - * information will be used to evaluate the EUROPAGATE project and the - * software, and to plan further developments. The consortium may use - * the information in later publications. - * - * 4. Users of this software agree to make their best efforts, when - * documenting their use of the software, to acknowledge the EUROPAGATE - * consortium, and the role played by the software in their work. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE - * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF - * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA - * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND - * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ -/* CCL string compare utilities - * Europagate, 1995 - * - * $Id: cclstr.c,v 1.4 2001-11-27 22:38:50 adam Exp $ - * - * Old Europagate Log: - * - * Revision 1.3 1996/01/24 10:11:19 adam - * Added include of stdlib.h. - * - * Revision 1.2 1995/05/16 09:39:27 adam - * LICENSE. - * - * Revision 1.1 1995/05/11 14:03:57 adam - * Changes in the reading of qualifier(s). New function: ccl_qual_fitem. - * New variable ccl_case_sensitive, which controls whether reserved - * words and field names are case sensitive or not. - * - */ -#include -#include -#include - -#include - -static int ccli_toupper (int c) -{ - return toupper (c); -} - -int (*ccl_toupper)(int c) = NULL; - -int ccl_stricmp (const char *s1, const char *s2) -{ - if (!ccl_toupper) - ccl_toupper = ccli_toupper; - while (*s1 && *s2) - { - int c1, c2; - c1 = (*ccl_toupper)(*s1); - c2 = (*ccl_toupper)(*s2); - if (c1 != c2) - return c1 - c2; - s1++; - s2++; - } - return (*ccl_toupper)(*s1) - (*ccl_toupper)(*s2); -} - -int ccl_memicmp (const char *s1, const char *s2, size_t n) -{ - if (!ccl_toupper) - ccl_toupper = ccli_toupper; - while (1) - { - int c1, c2; - - c1 = (*ccl_toupper)(*s1); - c2 = (*ccl_toupper)(*s2); - if (n <= 1 || c1 != c2) - return c1 - c2; - s1++; - s2++; - --n; - } -} - diff --git a/ccl/ccltoken.c b/ccl/ccltoken.c deleted file mode 100644 index 31a18d8..0000000 --- a/ccl/ccltoken.c +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Copyright (c) 1995, the EUROPAGATE consortium (see below). - * - * The EUROPAGATE consortium members are: - * - * University College Dublin - * Danmarks Teknologiske Videnscenter - * An Chomhairle Leabharlanna - * Consejo Superior de Investigaciones Cientificas - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The names of EUROPAGATE or the project partners may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * 3. Users of this software (implementors and gateway operators) agree to - * inform the EUROPAGATE consortium of their use of the software. This - * information will be used to evaluate the EUROPAGATE project and the - * software, and to plan further developments. The consortium may use - * the information in later publications. - * - * 4. Users of this software agree to make their best efforts, when - * documenting their use of the software, to acknowledge the EUROPAGATE - * consortium, and the role played by the software in their work. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE - * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF - * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA - * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND - * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ -/* CCL - lexical analysis - * Europagate, 1995 - * - * $Id: ccltoken.c,v 1.22 2003-02-14 18:49:23 adam Exp $ - * - * Old Europagate Log: - * - * Revision 1.10 1995/07/11 12:28:31 adam - * New function: ccl_token_simple (split into simple tokens) and - * ccl_token_del (delete tokens). - * - * Revision 1.9 1995/05/16 09:39:28 adam - * LICENSE. - * - * Revision 1.8 1995/05/11 14:03:57 adam - * Changes in the reading of qualifier(s). New function: ccl_qual_fitem. - * New variable ccl_case_sensitive, which controls whether reserved - * words and field names are case sensitive or not. - * - * Revision 1.7 1995/04/19 12:11:24 adam - * Minor change. - * - * Revision 1.6 1995/04/17 09:31:48 adam - * Improved handling of qualifiers. Aliases or reserved words. - * - * Revision 1.5 1995/02/23 08:32:00 adam - * Changed header. - * - * Revision 1.3 1995/02/15 17:42:16 adam - * Minor changes of the api of this module. FILE* argument added - * to ccl_pr_tree. - * - * Revision 1.2 1995/02/14 19:55:13 adam - * Header files ccl.h/cclp.h are gone! They have been merged an - * moved to ../include/ccl.h. - * Node kind(s) in ccl_rpn_node have changed names. - * - * Revision 1.1 1995/02/13 12:35:21 adam - * First version of CCL. Qualifiers aren't handled yet. - * - */ - -#include -#include -#include - -#include - -/* - * token_cmp: Compare token with keyword(s) - * kw: Keyword list. Each keyword is separated by space. - * token: CCL token. - * return: 1 if token string matches one of the keywords in list; - * 0 otherwise. - */ -static int token_cmp (CCL_parser cclp, const char *kw, struct ccl_token *token) -{ - const char *cp1 = kw; - const char *cp2; - const char *aliases; - int case_sensitive = cclp->ccl_case_sensitive; - - aliases = ccl_qual_search_special(cclp->bibset, "case"); - if (aliases) - case_sensitive = atoi(aliases); - if (!kw) - return 0; - while ((cp2 = strchr (cp1, ' '))) - { - if (token->len == (size_t) (cp2-cp1)) - { - if (case_sensitive) - { - if (!memcmp (cp1, token->name, token->len)) - return 1; - } - else - { - if (!ccl_memicmp (cp1, token->name, token->len)) - return 1; - } - } - cp1 = cp2+1; - } - if (case_sensitive) - return token->len == strlen(cp1) - && !memcmp (cp1, token->name, token->len); - return token->len == strlen(cp1) && - !ccl_memicmp (cp1, token->name, token->len); -} - -/* - * ccl_token_simple: tokenize CCL raw tokens - */ -struct ccl_token *ccl_token_simple (const char *command) -{ - const char *cp = command; - struct ccl_token *first = NULL; - struct ccl_token *last = NULL; - - while (1) - { - while (*cp && strchr (" \t\r\n", *cp)) - { - cp++; - continue; - } - if (!first) - { - first = last = (struct ccl_token *)xmalloc (sizeof (*first)); - ccl_assert (first); - last->prev = NULL; - } - else - { - last->next = (struct ccl_token *)xmalloc (sizeof(*first)); - ccl_assert (last->next); - last->next->prev = last; - last = last->next; - } - last->next = NULL; - last->name = cp; - last->len = 1; - switch (*cp++) - { - case '\0': - last->kind = CCL_TOK_EOL; - return first; - case '\"': - last->kind = CCL_TOK_TERM; - last->name = cp; - last->len = 0; - while (*cp && *cp != '\"') - { - cp++; - ++ last->len; - } - if (*cp == '\"') - cp++; - break; - default: - while (*cp && !strchr (" \t\n\r", *cp)) - { - cp++; - ++ last->len; - } - last->kind = CCL_TOK_TERM; - } - } - return first; -} - - -/* - * ccl_tokenize: tokenize CCL command string. - * return: CCL token list. - */ -struct ccl_token *ccl_parser_tokenize (CCL_parser cclp, const char *command) -{ - const char *aliases; - const char *cp = command; - struct ccl_token *first = NULL; - struct ccl_token *last = NULL; - - while (1) - { - while (*cp && strchr (" \t\r\n", *cp)) - { - cp++; - continue; - } - if (!first) - { - first = last = (struct ccl_token *)xmalloc (sizeof (*first)); - ccl_assert (first); - last->prev = NULL; - } - else - { - last->next = (struct ccl_token *)xmalloc (sizeof(*first)); - ccl_assert (last->next); - last->next->prev = last; - last = last->next; - } - last->next = NULL; - last->name = cp; - last->len = 1; - switch (*cp++) - { - case '\0': - last->kind = CCL_TOK_EOL; - return first; - case '(': - last->kind = CCL_TOK_LP; - break; - case ')': - last->kind = CCL_TOK_RP; - break; - case ',': - last->kind = CCL_TOK_COMMA; - break; - case '%': - case '!': - last->kind = CCL_TOK_PROX; - while (isdigit(*cp)) - { - ++ last->len; - cp++; - } - break; - case '>': - case '<': - case '=': - if (*cp == '=' || *cp == '<' || *cp == '>') - { - cp++; - last->kind = CCL_TOK_REL; - ++ last->len; - } - else if (cp[-1] == '=') - last->kind = CCL_TOK_EQ; - else - last->kind = CCL_TOK_REL; - break; - case '\"': - last->kind = CCL_TOK_TERM; - last->name = cp; - last->len = 0; - while (*cp && *cp != '\"') - { - cp++; - ++ last->len; - } - if (*cp == '\"') - cp++; - break; - default: - if (!strchr ("(),%!><= \t\n\r", cp[-1])) - { - while (*cp && !strchr ("(),%!><= \t\n\r", *cp)) - { - cp++; - ++ last->len; - } - } - last->kind = CCL_TOK_TERM; - - aliases = ccl_qual_search_special(cclp->bibset, "and"); - if (!aliases) - aliases = cclp->ccl_token_and; - if (token_cmp (cclp, aliases, last)) - last->kind = CCL_TOK_AND; - - aliases = ccl_qual_search_special(cclp->bibset, "or"); - if (!aliases) - aliases = cclp->ccl_token_or; - if (token_cmp (cclp, aliases, last)) - last->kind = CCL_TOK_OR; - - aliases = ccl_qual_search_special(cclp->bibset, "not"); - if (!aliases) - aliases = cclp->ccl_token_not; - if (token_cmp (cclp, aliases, last)) - last->kind = CCL_TOK_NOT; - - aliases = ccl_qual_search_special(cclp->bibset, "set"); - if (!aliases) - aliases = cclp->ccl_token_set; - - if (token_cmp (cclp, aliases, last)) - last->kind = CCL_TOK_SET; - } - } - return first; -} - -struct ccl_token *ccl_tokenize (const char *command) -{ - CCL_parser cclp = ccl_parser_create (); - struct ccl_token *list; - - list = ccl_parser_tokenize (cclp, command); - - ccl_parser_destroy (cclp); - return list; -} - -/* - * ccl_token_del: delete CCL tokens - */ -void ccl_token_del (struct ccl_token *list) -{ - struct ccl_token *list1; - - while (list) - { - list1 = list->next; - xfree (list); - list = list1; - } -} - -char *ccl_strdup (const char *str) -{ - int len = strlen(str); - char *p = (char*) xmalloc (len+1); - strcpy (p, str); - return p; -} - -CCL_parser ccl_parser_create (void) -{ - CCL_parser p = (CCL_parser)xmalloc (sizeof(*p)); - if (!p) - return p; - p->look_token = NULL; - p->error_code = 0; - p->error_pos = NULL; - p->bibset = NULL; - - p->ccl_token_and = ccl_strdup("and"); - p->ccl_token_or = ccl_strdup("or"); - p->ccl_token_not = ccl_strdup("not andnot"); - p->ccl_token_set = ccl_strdup("set"); - p->ccl_case_sensitive = 1; - - return p; -} - -void ccl_parser_destroy (CCL_parser p) -{ - if (!p) - return; - xfree (p->ccl_token_and); - xfree (p->ccl_token_or); - xfree (p->ccl_token_not); - xfree (p->ccl_token_set); - xfree (p); -} - -void ccl_parser_set_op_and (CCL_parser p, const char *op) -{ - if (p && op) - { - if (p->ccl_token_and) - xfree (p->ccl_token_and); - p->ccl_token_and = ccl_strdup (op); - } -} - -void ccl_parser_set_op_or (CCL_parser p, const char *op) -{ - if (p && op) - { - if (p->ccl_token_or) - xfree (p->ccl_token_or); - p->ccl_token_or = ccl_strdup (op); - } -} -void ccl_parser_set_op_not (CCL_parser p, const char *op) -{ - if (p && op) - { - if (p->ccl_token_not) - xfree (p->ccl_token_not); - p->ccl_token_not = ccl_strdup (op); - } -} -void ccl_parser_set_op_set (CCL_parser p, const char *op) -{ - if (p && op) - { - if (p->ccl_token_set) - xfree (p->ccl_token_set); - p->ccl_token_set = ccl_strdup (op); - } -} - -void ccl_parser_set_case (CCL_parser p, int case_sensitivity_flag) -{ - if (p) - p->ccl_case_sensitive = case_sensitivity_flag; -} diff --git a/ccl/tstccl.c b/ccl/tstccl.c deleted file mode 100644 index 6ae30a4..0000000 --- a/ccl/tstccl.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2002-2003, Index Data - * See the file LICENSE for details. - * - * $Id: tstccl.c,v 1.2 2003-06-24 23:03:04 adam Exp $ - */ - -/* CCL test */ - -#include - -struct ccl_tst { - char *query; - char *result; -}; - -static struct ccl_tst query_str[] = { - { "x1", "@attr 4=2 @attr 1=1016 x1 "}, - { "(((((x1)))))", "@attr 4=2 @attr 1=1016 x1 "}, - {"x1 and x2", "@and @attr 4=2 @attr 1=1016 x1 @attr 4=2 @attr 1=1016 x2 "}, - { "ti=x3", "@attr 4=2 @attr 1=4 x3 "}, - { "dc.title=x4", "@attr 1=/my/title x4 "}, - { "x1 and", 0}, - { "tix=x5", 0}, - {0, 0} -}; - -void tst1(void) -{ - CCL_parser parser = ccl_parser_create (); - CCL_bibset bibset = ccl_qual_mk(); - int i; - - ccl_qual_fitem(bibset, "u=4 s=pw t=l,r", "ti"); - ccl_qual_fitem(bibset, "1=1016 s=al,pw", "term"); - ccl_qual_fitem(bibset, "1=/my/title", "dc.title"); - - parser->bibset = bibset; - - for (i = 0; query_str[i].query; i++) - { - struct ccl_token *token_list = - ccl_parser_tokenize(parser, query_str[i].query); - struct ccl_rpn_node *rpn = ccl_parser_find(parser, token_list); - ccl_token_del (token_list); - if (rpn) - { - WRBUF wrbuf = wrbuf_alloc(); - ccl_pquery(wrbuf, rpn); - - if (!query_str[i].result) - { - printf ("Failed %s\n", query_str[i].query); - printf (" got:%s:\n", wrbuf_buf(wrbuf)); - printf (" expected failure\n"); - exit(3); - } - else if (strcmp(wrbuf_buf(wrbuf), query_str[i].result)) - { - printf ("Failed %s\n", query_str[i].query); - printf (" got:%s:\n", wrbuf_buf(wrbuf)); - printf (" expected:%s:\n", query_str[i].result); - exit(2); - } - ccl_rpn_delete(rpn); - wrbuf_free(wrbuf, 1); - } - else if (query_str[i].result) - { - printf ("Failed %s\n", query_str[i].query); - printf (" got failure\n"); - printf (" expected:%s:\n", query_str[i].result); - exit(4); - } - } - ccl_parser_destroy (parser); - ccl_qual_rm(&bibset); -} - -int main(int argc, char **argv) -{ - tst1(); - exit(0); -} diff --git a/client/Makefile.am b/client/Makefile.am index 1a26fd3..d7b9526 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -1,6 +1,6 @@ ## Copyright (C) 1995-2003, Index Data ## All rights reserved. -## $Id: Makefile.am,v 1.19 2003-03-11 11:07:47 adam Exp $ +## $Id: Makefile.am,v 1.20 2003-10-27 12:21:23 adam Exp $ if ISSSL extra=yaz-client-ssl @@ -14,9 +14,9 @@ EXTRA_DIST = default.bib yaz_client_SOURCES=client.c admin.c admin.h tabcomplete.c tabcomplete.h yaz_client_ssl_SOURCES=$(yaz_client_SOURCES) -yaz_client_LDADD = ../lib/libyaz.la $(READLINE_LIBS) -yaz_client_ssl_LDADD = ../lib/libyazssl.la ../lib/libyaz.la $(READLINE_LIBS) $(SSL_LIBS) -bertorture_LDADD = ../lib/libyaz.la +yaz_client_LDADD = ../src/libyaz.la $(READLINE_LIBS) +yaz_client_ssl_LDADD = ../src/libyazssl.la ../src/libyaz.la $(READLINE_LIBS) $(SSL_LIBS) +bertorture_LDADD = ../src/libyaz.la bertorture_SOURCES=bertorture.c diff --git a/comstack/.cvsignore b/comstack/.cvsignore deleted file mode 100644 index fbc256e..0000000 --- a/comstack/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -libcomstack.la -*.lo diff --git a/comstack/Makefile.am b/comstack/Makefile.am deleted file mode 100644 index 0f65fe9..0000000 --- a/comstack/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## $Id: Makefile.am,v 1.7 2002-09-11 21:25:57 adam Exp $ - -noinst_LTLIBRARIES=libcomstack.la - -AM_CPPFLAGS=-I$(top_srcdir)/include - -libcomstack_la_SOURCES=comstack.c tcpip.c waislen.c unix.c - diff --git a/comstack/comstack.c b/comstack/comstack.c deleted file mode 100644 index 1488704..0000000 --- a/comstack/comstack.c +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * - * $Id: comstack.c,v 1.16 2003-10-20 18:21:45 adam Exp $ - */ - -#include -#include - -#include -#include -#include -#include - -static const char *cs_errlist[] = -{ - "No error or unspecified error", - "System (lower-layer) error", - "Operation out of state", - "No data (operation would block)", - "New data while half of old buffer is on the line (flow control)", - "Permission denied", - "SSL error" -}; - -const char *cs_errmsg(int n) -{ - if (n < 0 || n > 6) - n = 0; - return cs_errlist[n]; -} - -const char *cs_strerror(COMSTACK h) -{ - return cs_errmsg(h->cerrno); -} - -void cs_get_host_args(const char *type_and_host, const char **args) -{ - - *args = ""; - if (*type_and_host && strncmp(type_and_host, "unix:", 5)) - { - const char *cp; - cp = strstr(type_and_host, "://"); - if (cp) - cp = cp+3; - else - cp = type_and_host; - cp = strchr(cp, '/'); - if (cp) - *args = cp+1; - } -} - -COMSTACK cs_create_host(const char *type_and_host, int blocking, void **vp) -{ - enum oid_proto proto = PROTO_Z3950; - const char *host = 0; - COMSTACK cs; - CS_TYPE t; - - if (strncmp (type_and_host, "tcp:", 4) == 0) - { - t = tcpip_type; - host = type_and_host + 4; - } - else if (strncmp (type_and_host, "ssl:", 4) == 0) - { -#if HAVE_OPENSSL_SSL_H - t = ssl_type; - host = type_and_host + 4; -#else - return 0; -#endif - } - else if (strncmp (type_and_host, "unix:", 5) == 0) - { -#ifndef WIN32 - t = unix_type; - host = type_and_host + 5; -#else - return 0; -#endif - } - else if (strncmp(type_and_host, "http:", 5) == 0) - { - t = tcpip_type; - host = type_and_host + 5; - if (host[0] == '/' && host[1] == '/') - host = host + 2; - proto = PROTO_HTTP; - } - else if (strncmp(type_and_host, "https:", 6) == 0) - { -#if HAVE_OPENSSL_SSL_H - t = ssl_type; - host = type_and_host + 6; - if (host[0] == '/' && host[1] == '/') - host = host + 2; - proto = PROTO_HTTP; -#else - return 0; -#endif - } - else - { - t = tcpip_type; - host = type_and_host; - - } - cs = cs_create (t, blocking, proto); - if (!cs) - return 0; - - if (!(*vp = cs_straddr(cs, host))) - { - cs_close (cs); - return 0; - } - return cs; -} - -int cs_look (COMSTACK cs) -{ - return cs->event; -} - -int cs_complete_auto(const unsigned char *buf, int len) -{ - if (len > 5 && buf[0] >= 0x20 && buf[0] < 0x7f - && buf[1] >= 0x20 && buf[1] < 0x7f - && buf[2] >= 0x20 && buf[2] < 0x7f) - { - /* deal with HTTP request/response */ - int i = 2, content_len = 0, chunked = 0; - - while (i <= len-4) - { - if (i > 8192) - return i; /* do not allow more than 8K HTTP header */ - if (buf[i] == '\r' && buf[i+1] == '\n') - { - i += 2; - if (buf[i] == '\r' && buf[i+1] == '\n') - { - if (chunked) - { - while(1) - { - int chunk_len = 0; - i += 2; -#if 0 -/* debugging */ - if (i >>"); - for (j = i; j <= i+4; j++) - printf ("%c", buf[j]); - printf ("<<<\n"); - } -#endif - while (1) - if (i >= len-2) { -#if 0 -/* debugging */ - printf ("XXXXXXXX not there yet 1\n"); - printf ("i=%d len=%d\n", i, len); -#endif - return 0; - } else if (isdigit(buf[i])) - chunk_len = chunk_len * 16 + - (buf[i++] - '0'); - else if (isupper(buf[i])) - chunk_len = chunk_len * 16 + - (buf[i++] - ('A'-10)); - else if (islower(buf[i])) - chunk_len = chunk_len * 16 + - (buf[i++] - ('a'-10)); - else - break; - if (buf[i] != '\r' || buf[i+1] != '\n' || - chunk_len < 0) - return i+2; /* bad. stop now */ - if (chunk_len == 0) - { - /* consider trailing headers .. */ - while(i <= len-4) - { - if (buf[i] == '\r' && buf[i+1] == '\n' && - buf[i+2] == '\r' && buf[i+3] == '\n') - if (len >= i+4) - return i+4; - i++; - } -#if 0 -/* debugging */ - printf ("XXXXXXXXX not there yet 2\n"); - printf ("i=%d len=%d\n", i, len); -#endif - return 0; - } - i += chunk_len+2; - } - } - else - { /* not chunked ; inside body */ - /* i += 2 seems not to work with GCC -O2 .. - so i+2 is used instead .. */ - if (len >= (i+2)+ content_len) - return (i+2)+ content_len; - } - break; - } - else if (i < len - 21 && - !memcmp(buf+i, "Transfer-Encoding: ", 18)) - { - i+=18; - if (buf[i] == ' ') - i++; - if (i < len - 8) - if (!memcmp(buf+i, "chunked", 7)) - chunked = 1; - } - else if (i < len - 18 && - !memcmp(buf+i, "Content-Length: ", 15)) - { - i+= 15; - if (buf[i] == ' ') - i++; - content_len = 0; - while (i <= len-4 && isdigit(buf[i])) - content_len = content_len*10 + (buf[i++] - '0'); - if (content_len < 0) /* prevent negative offsets */ - content_len = 0; - } - else - i++; - } - else - i++; - } - return 0; - } - return completeBER(buf, len); -} diff --git a/comstack/tcpip.c b/comstack/tcpip.c deleted file mode 100644 index ab08873..0000000 --- a/comstack/tcpip.c +++ /dev/null @@ -1,1100 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * - * $Id: tcpip.c,v 1.59 2003-10-08 21:47:15 adam Exp $ - */ - -#include -#include -#include - -#ifdef WIN32 -#else -#include -#endif - -#include -#include -#include -#if HAVE_OPENSSL_SSL_H -#include -#include -#endif - -#include -#include -#include -#include - -#ifdef WIN32 -#else -#include -#endif - -static int tcpip_close(COMSTACK h); -static int tcpip_put(COMSTACK h, char *buf, int size); -static int tcpip_get(COMSTACK h, char **buf, int *bufsize); -static int tcpip_connect(COMSTACK h, void *address); -static int tcpip_more(COMSTACK h); -static int tcpip_rcvconnect(COMSTACK h); -static int tcpip_bind(COMSTACK h, void *address, int mode); -static int tcpip_listen(COMSTACK h, char *raddr, int *addrlen, - int (*check_ip)(void *cd, const char *a, int len, int type), - void *cd); -static int tcpip_set_blocking(COMSTACK p, int blocking); - -#if HAVE_OPENSSL_SSL_H -static int ssl_get(COMSTACK h, char **buf, int *bufsize); -static int ssl_put(COMSTACK h, char *buf, int size); -#endif - -static COMSTACK tcpip_accept(COMSTACK h); -static char *tcpip_addrstr(COMSTACK h); -static void *tcpip_straddr(COMSTACK h, const char *str); - -#if 0 -#define TRC(x) x -#else -#define TRC(X) -#endif - -#ifndef YAZ_SOCKLEN_T -#define YAZ_SOCKLEN_T int -#endif - -/* this state is used for both SSL and straight TCP/IP */ -typedef struct tcpip_state -{ - char *altbuf; /* alternate buffer for surplus data */ - int altsize; /* size as xmalloced */ - int altlen; /* length of data or 0 if none */ - - int written; /* -1 if we aren't writing */ - int towrite; /* to verify against user input */ - int (*complete)(const unsigned char *buf, int len); /* length/comple. */ - struct sockaddr_in addr; /* returned by cs_straddr */ - char buf[128]; /* returned by cs_addrstr */ -#if HAVE_OPENSSL_SSL_H - SSL_CTX *ctx; - SSL_CTX *ctx_alloc; - SSL *ssl; -#endif -} tcpip_state; - -#ifdef WIN32 -static int tcpip_init (void) -{ - static int initialized = 0; - if (!initialized) - { - WORD requested; - WSADATA wd; - - requested = MAKEWORD(1, 1); - if (WSAStartup(requested, &wd)) - return 0; - initialized = 1; - } - return 1; -} -#else -static int tcpip_init (void) -{ - return 1; -} -#endif - -/* - * This function is always called through the cs_create() macro. - * s >= 0: socket has already been established for us. - */ -COMSTACK tcpip_type(int s, int blocking, int protocol, void *vp) -{ - COMSTACK p; - tcpip_state *state; - int new_socket; -#ifdef WIN32 - unsigned long tru = 1; -#endif - - if (!tcpip_init ()) - return 0; - if (s < 0) - { - if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) - return 0; - new_socket = 1; - } - else - new_socket = 0; - if (!(p = (struct comstack *)xmalloc(sizeof(struct comstack)))) - return 0; - if (!(state = (struct tcpip_state *)(p->cprivate = - xmalloc(sizeof(tcpip_state))))) - return 0; - - if (!((p->blocking = blocking)&1)) - { -#ifdef WIN32 - if (ioctlsocket(s, FIONBIO, &tru) < 0) - return 0; -#else - if (fcntl(s, F_SETFL, O_NONBLOCK) < 0) - return 0; -#ifndef MSG_NOSIGNAL - signal (SIGPIPE, SIG_IGN); -#endif -#endif - } - - p->io_pending = 0; - p->iofile = s; - p->type = tcpip_type; - p->protocol = (enum oid_proto) protocol; - - p->f_connect = tcpip_connect; - p->f_rcvconnect = tcpip_rcvconnect; - p->f_get = tcpip_get; - p->f_put = tcpip_put; - p->f_close = tcpip_close; - p->f_more = tcpip_more; - p->f_bind = tcpip_bind; - p->f_listen = tcpip_listen; - p->f_accept = tcpip_accept; - p->f_addrstr = tcpip_addrstr; - p->f_straddr = tcpip_straddr; - p->f_set_blocking = tcpip_set_blocking; - - p->state = new_socket ? CS_ST_UNBND : CS_ST_IDLE; /* state of line */ - p->event = CS_NONE; - p->cerrno = 0; - p->stackerr = 0; - -#if HAVE_OPENSSL_SSL_H - state->ctx = state->ctx_alloc = 0; - state->ssl = 0; -#endif - - state->altbuf = 0; - state->altsize = state->altlen = 0; - state->towrite = state->written = -1; - if (protocol == PROTO_WAIS) - state->complete = completeWAIS; - else - state->complete = cs_complete_auto; - - p->timeout = COMSTACK_DEFAULT_TIMEOUT; - TRC(fprintf(stderr, "Created new TCPIP comstack\n")); - - return p; -} - -#if HAVE_OPENSSL_SSL_H - -COMSTACK ssl_type(int s, int blocking, int protocol, void *vp) -{ - tcpip_state *state; - COMSTACK p; - yaz_log(LOG_LOG, "ssl_type begin"); - - p = tcpip_type (s, blocking, protocol, 0); - if (!p) - return 0; - p->f_get = ssl_get; - p->f_put = ssl_put; - p->type = ssl_type; - state = (tcpip_state *) p->cprivate; - if (vp) - state->ctx = vp; - else - { - SSL_load_error_strings(); - SSLeay_add_all_algorithms(); - - state->ctx = state->ctx_alloc = SSL_CTX_new (SSLv23_method()); - if (!state->ctx) - { - tcpip_close(p); - return 0; - } - } - /* note: we don't handle already opened socket in SSL mode - yet */ - yaz_log(LOG_LOG, "ssl_type end"); - return p; -} -#endif - -int tcpip_strtoaddr_ex(const char *str, struct sockaddr_in *add, - int default_port) -{ - struct hostent *hp; - char *p, buf[512]; - short int port = default_port; - unsigned tmpadd; - - if (!tcpip_init ()) - return 0; - TRC(fprintf(stderr, "tcpip_strtoaddress: %s\n", str ? str : "NULL")); - add->sin_family = AF_INET; - strncpy(buf, str, 511); - buf[511] = 0; - if ((p = strchr(buf, '/'))) - *p = 0; - if ((p = strchr(buf, ':'))) - { - *p = 0; - port = atoi(p + 1); - } - add->sin_port = htons(port); - if (!strcmp("@", buf)) - add->sin_addr.s_addr = INADDR_ANY; - else if ((hp = gethostbyname(buf))) - memcpy(&add->sin_addr.s_addr, *hp->h_addr_list, - sizeof(struct in_addr)); - else if ((tmpadd = (unsigned) inet_addr(buf)) != 0) - memcpy(&add->sin_addr.s_addr, &tmpadd, sizeof(struct in_addr)); - else - return 0; - return 1; -} - -void *tcpip_straddr(COMSTACK h, const char *str) -{ - tcpip_state *sp = (tcpip_state *)h->cprivate; - int port = 210; - - if (h->protocol == PROTO_HTTP) - port = 80; - - if (!tcpip_strtoaddr_ex (str, &sp->addr, port)) - return 0; - return &sp->addr; -} - -struct sockaddr_in *tcpip_strtoaddr(const char *str) -{ - static struct sockaddr_in add; - - if (!tcpip_strtoaddr_ex (str, &add, 210)) - return 0; - return &add; -} - -int tcpip_more(COMSTACK h) -{ - tcpip_state *sp = (tcpip_state *)h->cprivate; - - return sp->altlen && (*sp->complete)((unsigned char *) sp->altbuf, - sp->altlen); -} - -/* - * connect(2) will block (sometimes) - nothing we can do short of doing - * weird things like spawning subprocesses or threading or some weird junk - * like that. - */ -int tcpip_connect(COMSTACK h, void *address) -{ - struct sockaddr_in *add = (struct sockaddr_in *)address; -#if HAVE_OPENSSL_SSL_H - tcpip_state *sp = (tcpip_state *)h->cprivate; -#endif - int r; -#ifdef __sun__ - int recbuflen; - YAZ_SOCKLEN_T rbufsize = sizeof(recbuflen); -#endif - TRC(fprintf(stderr, "tcpip_connect\n")); - h->io_pending = 0; - if (h->state != CS_ST_UNBND) - { - h->cerrno = CSOUTSTATE; - return -1; - } -#ifdef __sun__ - /* On Suns, you must set a bigger Receive Buffer BEFORE a call to connect - * This gives the connect a chance to negotiate with the other side - * (see 'man tcp') - */ - if ( getsockopt(h->iofile, SOL_SOCKET, SO_RCVBUF, (void *)&recbuflen, &rbufsize ) < 0 ) - { - h->cerrno = CSYSERR; - return -1; - } - TRC(fprintf( stderr, "Current Size of TCP Receive Buffer= %d\n", - recbuflen )); - recbuflen *= 10; /* lets be optimistic */ - if ( setsockopt(h->iofile, SOL_SOCKET, SO_RCVBUF, (void *)&recbuflen, rbufsize ) < 0 ) - { - h->cerrno = CSYSERR; - return -1; - } - if ( getsockopt(h->iofile, SOL_SOCKET, SO_RCVBUF, (void *)&recbuflen, &rbufsize ) ) - { - h->cerrno = CSYSERR; - return -1; - } - TRC(fprintf( stderr, "New Size of TCP Receive Buffer = %d\n", - recbuflen )); -#endif - r = connect(h->iofile, (struct sockaddr *) add, sizeof(*add)); - if (r < 0) - { -#ifdef WIN32 - if (WSAGetLastError() == WSAEWOULDBLOCK) - { - h->event = CS_CONNECT; - h->state = CS_ST_CONNECTING; - h->io_pending = CS_WANT_WRITE; - return 1; - } -#else - if (yaz_errno() == EINPROGRESS) - { - h->event = CS_CONNECT; - h->state = CS_ST_CONNECTING; - h->io_pending = CS_WANT_WRITE|CS_WANT_READ; - return 1; - } -#endif - h->cerrno = CSYSERR; - return -1; - } - h->event = CS_CONNECT; - h->state = CS_ST_CONNECTING; - - return tcpip_rcvconnect (h); -} - -/* - * nop - */ -int tcpip_rcvconnect(COMSTACK h) -{ -#if HAVE_OPENSSL_SSL_H - tcpip_state *sp = (tcpip_state *)h->cprivate; -#endif - TRC(fprintf(stderr, "tcpip_rcvconnect\n")); - - if (h->state == CS_ST_DATAXFER) - return 0; - if (h->state != CS_ST_CONNECTING) - { - h->cerrno = CSOUTSTATE; - return -1; - } -#if HAVE_OPENSSL_SSL_H - if (sp->ctx) - { - int res; - - if (!sp->ssl) - { - sp->ssl = SSL_new (sp->ctx); - SSL_set_fd (sp->ssl, h->iofile); - } - res = SSL_connect (sp->ssl); - if (res <= 0) - { - int err = SSL_get_error(sp->ssl, res); - if (err == SSL_ERROR_WANT_READ) - { - h->io_pending = CS_WANT_READ; - return 1; - } - if (err == SSL_ERROR_WANT_WRITE) - { - h->io_pending = CS_WANT_WRITE; - return 1; - } - h->cerrno = CSERRORSSL; - return -1; - } - } -#endif - h->event = CS_DATA; - h->state = CS_ST_DATAXFER; - return 0; -} - -#define CERTF "ztest.pem" -#define KEYF "ztest.pem" - -static void tcpip_setsockopt (int fd) -{ -#if 0 - int len = 4096; - int set = 1; - - if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int))) - { - yaz_log(LOG_WARN|LOG_ERRNO, "setsockopt TCP_NODELAY"); - } - if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int))) - { - yaz_log(LOG_WARN|LOG_ERRNO, "setsockopt SNDBUF"); - } - if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int))) - { - yaz_log(LOG_WARN|LOG_ERRNO, "setsockopt RCVBUF"); - } -#endif -} - -static int tcpip_bind(COMSTACK h, void *address, int mode) -{ - struct sockaddr *addr = (struct sockaddr *)address; -#ifdef WIN32 - BOOL one = 1; -#else - unsigned long one = 1; -#endif - -#if HAVE_OPENSSL_SSL_H - tcpip_state *sp = (tcpip_state *)h->cprivate; - if (sp->ctx) - { - if (sp->ctx_alloc) - { - int res; - res = SSL_CTX_use_certificate_file (sp->ctx, CERTF, - SSL_FILETYPE_PEM); - if (res <= 0) - { - ERR_print_errors_fp(stderr); - exit (2); - } - res = SSL_CTX_use_PrivateKey_file (sp->ctx, KEYF, - SSL_FILETYPE_PEM); - if (res <= 0) - { - ERR_print_errors_fp(stderr); - exit (3); - } - res = SSL_CTX_check_private_key (sp->ctx); - if (res <= 0) - { - ERR_print_errors_fp(stderr); - exit(5); - } - } - TRC (fprintf (stderr, "ssl_bind\n")); - } - else - { - TRC (fprintf (stderr, "tcpip_bind\n")); - } -#else - TRC (fprintf (stderr, "tcpip_bind\n")); -#endif -#ifndef WIN32 - if (setsockopt(h->iofile, SOL_SOCKET, SO_REUSEADDR, (char*) - &one, sizeof(one)) < 0) - { - h->cerrno = CSYSERR; - return -1; - } -#endif - tcpip_setsockopt(h->iofile); - if (bind(h->iofile, addr, sizeof(struct sockaddr_in))) - { - h->cerrno = CSYSERR; - return -1; - } - if (mode == CS_SERVER && listen(h->iofile, 3) < 0) - { - h->cerrno = CSYSERR; - return -1; - } - h->state = CS_ST_IDLE; - h->event = CS_LISTEN; - return 0; -} - -int tcpip_listen(COMSTACK h, char *raddr, int *addrlen, - int (*check_ip)(void *cd, const char *a, int len, int t), - void *cd) -{ - struct sockaddr_in addr; - YAZ_SOCKLEN_T len = sizeof(addr); - - TRC(fprintf(stderr, "tcpip_listen pid=%d\n", getpid())); - if (h->state != CS_ST_IDLE) - { - h->cerrno = CSOUTSTATE; - return -1; - } - h->newfd = accept(h->iofile, (struct sockaddr*)&addr, &len); - if (h->newfd < 0) - { - if ( -#ifdef WIN32 - WSAGetLastError() == WSAEWOULDBLOCK -#else - yaz_errno() == EWOULDBLOCK -#ifdef EAGAIN -#if EAGAIN != EWOULDBLOCK - || yaz_errno() == EAGAIN -#endif -#endif -#endif - ) - h->cerrno = CSNODATA; - else - h->cerrno = CSYSERR; - return -1; - } - if (addrlen && (size_t) (*addrlen) >= sizeof(struct sockaddr_in)) - memcpy(raddr, &addr, *addrlen = sizeof(struct sockaddr_in)); - else if (addrlen) - *addrlen = 0; - if (check_ip && (*check_ip)(cd, (const char *) &addr, - sizeof(addr), AF_INET)) - { - h->cerrno = CSDENY; -#ifdef WIN32 - closesocket(h->newfd); -#else - close(h->newfd); -#endif - h->newfd = -1; - return -1; - } - h->state = CS_ST_INCON; - tcpip_setsockopt (h->newfd); - return 0; -} - -COMSTACK tcpip_accept(COMSTACK h) -{ - COMSTACK cnew; - tcpip_state *state, *st = (tcpip_state *)h->cprivate; -#ifdef WIN32 - unsigned long tru = 1; -#endif - - TRC(fprintf(stderr, "tcpip_accept\n")); - if (h->state == CS_ST_INCON) - { - if (!(cnew = (COMSTACK)xmalloc(sizeof(*cnew)))) - { - h->cerrno = CSYSERR; -#ifdef WIN32 - closesocket(h->newfd); -#else - close(h->newfd); -#endif - h->newfd = -1; - return 0; - } - memcpy(cnew, h, sizeof(*h)); - cnew->iofile = h->newfd; - cnew->io_pending = 0; - if (!(state = (tcpip_state *) - (cnew->cprivate = xmalloc(sizeof(tcpip_state))))) - { - h->cerrno = CSYSERR; - if (h->newfd != -1) - { -#ifdef WIN32 - closesocket(h->newfd); -#else - close(h->newfd); -#endif - h->newfd = -1; - } - return 0; - } - if (!(cnew->blocking&1) && -#ifdef WIN32 - (ioctlsocket(cnew->iofile, FIONBIO, &tru) < 0) -#else - (fcntl(cnew->iofile, F_SETFL, O_NONBLOCK) < 0) -#endif - ) - { - h->cerrno = CSYSERR; - if (h->newfd != -1) - { -#ifdef WIN32 - closesocket(h->newfd); -#else - close(h->newfd); -#endif - h->newfd = -1; - } - xfree (cnew); - xfree (state); - return 0; - } - h->newfd = -1; - state->altbuf = 0; - state->altsize = state->altlen = 0; - state->towrite = state->written = -1; - state->complete = st->complete; - cnew->state = CS_ST_ACCEPT; - h->state = CS_ST_IDLE; - -#if HAVE_OPENSSL_SSL_H - state->ctx = st->ctx; - state->ctx_alloc = 0; - state->ssl = st->ssl; - if (state->ctx) - { - state->ssl = SSL_new (state->ctx); - SSL_set_fd (state->ssl, cnew->iofile); - } -#endif - h = cnew; - } - if (h->state == CS_ST_ACCEPT) - { -#if HAVE_OPENSSL_SSL_H - tcpip_state *state = (tcpip_state *)h->cprivate; - if (state->ctx) - { - int res = SSL_accept (state->ssl); - TRC(fprintf(stderr, "SSL_accept\n")); - if (res <= 0) - { - int err = SSL_get_error(state->ssl, res); - if (err == SSL_ERROR_WANT_READ) - { - h->io_pending = CS_WANT_READ; - return h; - } - if (err == SSL_ERROR_WANT_WRITE) - { - h->io_pending = CS_WANT_WRITE; - return h; - } - cs_close (h); - return 0; - } - } -#endif - } - else - { - h->cerrno = CSOUTSTATE; - return 0; - } - h->io_pending = 0; - h->state = CS_ST_DATAXFER; - h->event = CS_DATA; - return h; -} - -#define CS_TCPIP_BUFCHUNK 4096 - -/* - * Return: -1 error, >1 good, len of buffer, ==1 incomplete buffer, - * 0=connection closed. - */ -int tcpip_get(COMSTACK h, char **buf, int *bufsize) -{ - tcpip_state *sp = (tcpip_state *)h->cprivate; - char *tmpc; - int tmpi, berlen, rest, req, tomove; - int hasread = 0, res; - - TRC(fprintf(stderr, "tcpip_get: bufsize=%d\n", *bufsize)); - if (sp->altlen) /* switch buffers */ - { - TRC(fprintf(stderr, " %d bytes in altbuf (0x%x)\n", sp->altlen, - (unsigned) sp->altbuf)); - tmpc = *buf; - tmpi = *bufsize; - *buf = sp->altbuf; - *bufsize = sp->altsize; - hasread = sp->altlen; - sp->altlen = 0; - sp->altbuf = tmpc; - sp->altsize = tmpi; - } - h->io_pending = 0; - while (!(berlen = (*sp->complete)((unsigned char *)*buf, hasread))) - { - if (!*bufsize) - { - if (!(*buf = (char *)xmalloc(*bufsize = CS_TCPIP_BUFCHUNK))) - return -1; - } - else if (*bufsize - hasread < CS_TCPIP_BUFCHUNK) - if (!(*buf =(char *)xrealloc(*buf, *bufsize *= 2))) - return -1; -#ifdef __sun__ - yaz_set_errno( 0 ); - /* unfortunatly, sun sometimes forgets to set errno in recv - when EWOULDBLOCK etc. would be required (res = -1) */ -#endif - res = recv(h->iofile, *buf + hasread, CS_TCPIP_BUFCHUNK, 0); - TRC(fprintf(stderr, " recv res=%d, hasread=%d\n", res, hasread)); - if (res < 0) - { - TRC(fprintf(stderr, " recv errno=%d, (%s)\n", yaz_errno(), - strerror(yaz_errno()))); -#ifdef WIN32 - if (WSAGetLastError() == WSAEWOULDBLOCK) - { - h->io_pending = CS_WANT_READ; - break; - } - else - return -1; -#else - if (yaz_errno() == EWOULDBLOCK -#ifdef EAGAIN -#if EAGAIN != EWOULDBLOCK - || yaz_errno() == EAGAIN -#endif -#endif - || yaz_errno() == EINPROGRESS -#ifdef __sun__ - || yaz_errno() == ENOENT /* Sun's sometimes set errno to this */ -#endif - ) - { - h->io_pending = CS_WANT_READ; - break; - } - else if (yaz_errno() == 0) - continue; - else - return -1; -#endif - } - else if (!res) - return 0; - hasread += res; - } - TRC (fprintf (stderr, " Out of read loop with hasread=%d, berlen=%d\n", - hasread, berlen)); - /* move surplus buffer (or everything if we didn't get a BER rec.) */ - if (hasread > berlen) - { - tomove = req = hasread - berlen; - rest = tomove % CS_TCPIP_BUFCHUNK; - if (rest) - req += CS_TCPIP_BUFCHUNK - rest; - if (!sp->altbuf) - { - if (!(sp->altbuf = (char *)xmalloc(sp->altsize = req))) - return -1; - } else if (sp->altsize < req) - if (!(sp->altbuf =(char *)xrealloc(sp->altbuf, sp->altsize = req))) - return -1; - TRC(fprintf(stderr, " Moving %d bytes to altbuf(0x%x)\n", tomove, - (unsigned) sp->altbuf)); - memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove); - } - if (berlen < CS_TCPIP_BUFCHUNK - 1) - *(*buf + berlen) = '\0'; - return berlen ? berlen : 1; -} - - -#if HAVE_OPENSSL_SSL_H -/* - * Return: -1 error, >1 good, len of buffer, ==1 incomplete buffer, - * 0=connection closed. - */ -int ssl_get(COMSTACK h, char **buf, int *bufsize) -{ - tcpip_state *sp = (tcpip_state *)h->cprivate; - char *tmpc; - int tmpi, berlen, rest, req, tomove; - int hasread = 0, res; - - TRC(fprintf(stderr, "ssl_get: bufsize=%d\n", *bufsize)); - if (sp->altlen) /* switch buffers */ - { - TRC(fprintf(stderr, " %d bytes in altbuf (0x%x)\n", sp->altlen, - (unsigned) sp->altbuf)); - tmpc = *buf; - tmpi = *bufsize; - *buf = sp->altbuf; - *bufsize = sp->altsize; - hasread = sp->altlen; - sp->altlen = 0; - sp->altbuf = tmpc; - sp->altsize = tmpi; - } - h->io_pending = 0; - while (!(berlen = (*sp->complete)((unsigned char *)*buf, hasread))) - { - if (!*bufsize) - { - if (!(*buf = (char *)xmalloc(*bufsize = CS_TCPIP_BUFCHUNK))) - return -1; - } - else if (*bufsize - hasread < CS_TCPIP_BUFCHUNK) - if (!(*buf =(char *)xrealloc(*buf, *bufsize *= 2))) - return -1; - res = SSL_read (sp->ssl, *buf + hasread, CS_TCPIP_BUFCHUNK); - TRC(fprintf(stderr, " SSL_read res=%d, hasread=%d\n", res, hasread)); - if (res <= 0) - { - int ssl_err = SSL_get_error(sp->ssl, res); - if (ssl_err == SSL_ERROR_WANT_READ) - { - h->io_pending = CS_WANT_READ; - break; - } - if (ssl_err == SSL_ERROR_WANT_WRITE) - { - h->io_pending = CS_WANT_WRITE; - break; - } - if (res == 0) - return 0; - h->cerrno = CSERRORSSL; - return -1; - } - hasread += res; - } - TRC (fprintf (stderr, " Out of read loop with hasread=%d, berlen=%d\n", - hasread, berlen)); - /* move surplus buffer (or everything if we didn't get a BER rec.) */ - if (hasread > berlen) - { - tomove = req = hasread - berlen; - rest = tomove % CS_TCPIP_BUFCHUNK; - if (rest) - req += CS_TCPIP_BUFCHUNK - rest; - if (!sp->altbuf) - { - if (!(sp->altbuf = (char *)xmalloc(sp->altsize = req))) - return -1; - } else if (sp->altsize < req) - if (!(sp->altbuf =(char *)xrealloc(sp->altbuf, sp->altsize = req))) - return -1; - TRC(fprintf(stderr, " Moving %d bytes to altbuf(0x%x)\n", tomove, - (unsigned) sp->altbuf)); - memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove); - } - if (berlen < CS_TCPIP_BUFCHUNK - 1) - *(*buf + berlen) = '\0'; - return berlen ? berlen : 1; -} -#endif - -/* - * Returns 1, 0 or -1 - * In nonblocking mode, you must call again with same buffer while - * return value is 1. - */ -int tcpip_put(COMSTACK h, char *buf, int size) -{ - int res; - struct tcpip_state *state = (struct tcpip_state *)h->cprivate; - - TRC(fprintf(stderr, "tcpip_put: size=%d\n", size)); - h->io_pending = 0; - h->event = CS_DATA; - if (state->towrite < 0) - { - state->towrite = size; - state->written = 0; - } - else if (state->towrite != size) - { - h->cerrno = CSWRONGBUF; - return -1; - } - while (state->towrite > state->written) - { - if ((res = - send(h->iofile, buf + state->written, size - - state->written, -#ifdef MSG_NOSIGNAL - MSG_NOSIGNAL -#else - 0 -#endif - )) < 0) - { - if ( -#ifdef WIN32 - WSAGetLastError() == WSAEWOULDBLOCK -#else - yaz_errno() == EWOULDBLOCK -#ifdef EAGAIN -#if EAGAIN != EWOULDBLOCK - || yaz_errno() == EAGAIN -#endif -#endif -#ifdef __sun__ - || yaz_errno() == ENOENT /* Sun's sometimes set errno to this value! */ -#endif - || yaz_errno() == EINPROGRESS -#endif - ) - { - TRC(fprintf(stderr, " Flow control stop\n")); - h->io_pending = CS_WANT_WRITE; - return 1; - } - h->cerrno = CSYSERR; - return -1; - } - state->written += res; - TRC(fprintf(stderr, " Wrote %d, written=%d, nbytes=%d\n", - res, state->written, size)); - } - state->towrite = state->written = -1; - TRC(fprintf(stderr, " Ok\n")); - return 0; -} - - -#if HAVE_OPENSSL_SSL_H -/* - * Returns 1, 0 or -1 - * In nonblocking mode, you must call again with same buffer while - * return value is 1. - */ -int ssl_put(COMSTACK h, char *buf, int size) -{ - int res; - struct tcpip_state *state = (struct tcpip_state *)h->cprivate; - - TRC(fprintf(stderr, "ssl_put: size=%d\n", size)); - h->io_pending = 0; - h->event = CS_DATA; - if (state->towrite < 0) - { - state->towrite = size; - state->written = 0; - } - else if (state->towrite != size) - { - h->cerrno = CSWRONGBUF; - return -1; - } - while (state->towrite > state->written) - { - res = SSL_write (state->ssl, buf + state->written, - size - state->written); - if (res <= 0) - { - int ssl_err = SSL_get_error(state->ssl, res); - if (ssl_err == SSL_ERROR_WANT_READ) - { - h->io_pending = CS_WANT_READ; - return 1; - } - if (ssl_err == SSL_ERROR_WANT_WRITE) - { - h->io_pending = CS_WANT_WRITE; - return 1; - } - h->cerrno = CSERRORSSL; - return -1; - } - state->written += res; - TRC(fprintf(stderr, " Wrote %d, written=%d, nbytes=%d\n", - res, state->written, size)); - } - state->towrite = state->written = -1; - TRC(fprintf(stderr, " Ok\n")); - return 0; -} -#endif - -int tcpip_close(COMSTACK h) -{ - tcpip_state *sp = (struct tcpip_state *)h->cprivate; - - TRC(fprintf(stderr, "tcpip_close\n")); - if (h->iofile != -1) - { -#if HAVE_OPENSSL_SSL_H - if (sp->ssl) - { - SSL_shutdown (sp->ssl); - } -#endif -#ifdef WIN32 - closesocket(h->iofile); -#else - close(h->iofile); -#endif - } - if (sp->altbuf) - xfree(sp->altbuf); -#if HAVE_OPENSSL_SSL_H - if (sp->ssl) - { - TRC (fprintf(stderr, "SSL_free\n")); - SSL_free (sp->ssl); - } - sp->ssl = 0; - if (sp->ctx_alloc) - SSL_CTX_free (sp->ctx_alloc); -#endif - xfree(sp); - xfree(h); - return 0; -} - -char *tcpip_addrstr(COMSTACK h) -{ - struct sockaddr_in addr; - tcpip_state *sp = (struct tcpip_state *)h->cprivate; - char *r = 0, *buf = sp->buf; - YAZ_SOCKLEN_T len; - struct hostent *host; - - len = sizeof(addr); - if (getpeername(h->iofile, (struct sockaddr*) &addr, &len) < 0) - { - h->cerrno = CSYSERR; - return 0; - } - if (!(h->blocking&2)) { - if ((host = gethostbyaddr((char*)&addr.sin_addr, sizeof(addr.sin_addr), - AF_INET))) - r = (char*) host->h_name; - } - if (!r) - r = inet_ntoa(addr.sin_addr); - if (h->protocol == PROTO_HTTP) - sprintf(buf, "http:%s", r); - else - sprintf(buf, "tcp:%s", r); -#if HAVE_OPENSSL_SSL_H - if (sp->ctx) - { - if (h->protocol == PROTO_HTTP) - sprintf(buf, "https:%s", r); - else - sprintf(buf, "ssl:%s", r); - } -#endif - return buf; -} - -int static tcpip_set_blocking(COMSTACK p, int blocking) -{ - unsigned long flag; - - if (p->blocking == blocking) - return 1; -#ifdef WIN32 - flag = 1; - if (ioctlsocket(p->iofile, FIONBIO, &flag) < 0) - return 0; -#else - flag = fcntl(p->iofile, F_GETFL, 0); - if(!(blocking&1)) - flag = flag & ~O_NONBLOCK; - else - flag = flag | O_NONBLOCK; - if (fcntl(p->iofile, F_SETFL, flag) < 0) - return 0; -#endif - p->blocking = blocking; - return 1; -} diff --git a/comstack/unix.c b/comstack/unix.c deleted file mode 100644 index 4efed27..0000000 --- a/comstack/unix.c +++ /dev/null @@ -1,601 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * - * $Id: unix.c,v 1.14 2003-10-08 21:47:15 adam Exp $ - * UNIX socket COMSTACK. By Morten Bøgeskov. - */ -#ifndef WIN32 - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - -#ifndef YAZ_SOCKLEN_T -#define YAZ_SOCKLEN_T int -#endif - -static int unix_close(COMSTACK h); -static int unix_put(COMSTACK h, char *buf, int size); -static int unix_get(COMSTACK h, char **buf, int *bufsize); -static int unix_connect(COMSTACK h, void *address); -static int unix_more(COMSTACK h); -static int unix_rcvconnect(COMSTACK h); -static int unix_bind(COMSTACK h, void *address, int mode); -static int unix_listen(COMSTACK h, char *raddr, int *addrlen, - int (*check_ip)(void *cd, const char *a, int len, int type), - void *cd); -static int unix_set_blocking(COMSTACK p, int blocking); - -static COMSTACK unix_accept(COMSTACK h); -static char *unix_addrstr(COMSTACK h); -static void *unix_straddr(COMSTACK h, const char *str); - -#ifndef SUN_LEN -#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ - + strlen ((ptr)->sun_path)) -#endif -#if 0 -#define TRC(x) x -#else -#define TRC(X) -#endif - -/* this state is used for both SSL and straight TCP/IP */ -typedef struct unix_state -{ - char *altbuf; /* alternate buffer for surplus data */ - int altsize; /* size as xmalloced */ - int altlen; /* length of data or 0 if none */ - - int written; /* -1 if we aren't writing */ - int towrite; /* to verify against user input */ - int (*complete)(const unsigned char *buf, int len); /* length/comple. */ - struct sockaddr_un addr; /* returned by cs_straddr */ - char buf[128]; /* returned by cs_addrstr */ -} unix_state; - -static int unix_init (void) -{ - return 1; -} - -/* - * This function is always called through the cs_create() macro. - * s >= 0: socket has already been established for us. - */ -COMSTACK unix_type(int s, int blocking, int protocol, void *vp) -{ - COMSTACK p; - unix_state *state; - int new_socket; - - if (!unix_init ()) - return 0; - if (s < 0) - { - if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) - return 0; - new_socket = 1; - } - else - new_socket = 0; - if (!(p = (struct comstack *)xmalloc(sizeof(struct comstack)))) - return 0; - if (!(state = (struct unix_state *)(p->cprivate = - xmalloc(sizeof(unix_state))))) - return 0; - - if (!((p->blocking = blocking)&1)) - { - if (fcntl(s, F_SETFL, O_NONBLOCK) < 0) - return 0; -#ifndef MSG_NOSIGNAL - signal (SIGPIPE, SIG_IGN); -#endif - } - - p->io_pending = 0; - p->iofile = s; - p->type = unix_type; - p->protocol = (enum oid_proto) protocol; - - p->f_connect = unix_connect; - p->f_rcvconnect = unix_rcvconnect; - p->f_get = unix_get; - p->f_put = unix_put; - p->f_close = unix_close; - p->f_more = unix_more; - p->f_bind = unix_bind; - p->f_listen = unix_listen; - p->f_accept = unix_accept; - p->f_addrstr = unix_addrstr; - p->f_straddr = unix_straddr; - p->f_set_blocking = unix_set_blocking; - - p->state = new_socket ? CS_ST_UNBND : CS_ST_IDLE; /* state of line */ - p->event = CS_NONE; - p->cerrno = 0; - p->stackerr = 0; - - state->altbuf = 0; - state->altsize = state->altlen = 0; - state->towrite = state->written = -1; - if (protocol == PROTO_WAIS) - state->complete = completeWAIS; - else - state->complete = cs_complete_auto; - - p->timeout = COMSTACK_DEFAULT_TIMEOUT; - TRC(fprintf(stderr, "Created new UNIX comstack\n")); - - return p; -} - - -static int unix_strtoaddr_ex(const char *str, struct sockaddr_un *add) -{ - char *cp; - if (!unix_init ()) - return 0; - TRC(fprintf(stderr, "unix_strtoaddress: %s\n", str ? str : "NULL")); - add->sun_family = AF_UNIX; - strncpy(add->sun_path, str, sizeof(add->sun_path)); - cp = strchr (add->sun_path, ':'); - if (cp) - *cp = '\0'; - return 1; -} - -static void *unix_straddr(COMSTACK h, const char *str) -{ - unix_state *sp = (unix_state *)h->cprivate; - - TRC(fprintf(stderr, "unix_straddr: %s\n", str ? str : "NULL")); - - if (!unix_strtoaddr_ex (str, &sp->addr)) - return 0; - return &sp->addr; -} - -struct sockaddr_un *unix_strtoaddr(const char *str) -{ - static struct sockaddr_un add; - - TRC(fprintf(stderr, "unix_strtoaddr: %s\n", str ? str : "NULL")); - - if (!unix_strtoaddr_ex (str, &add)) - return 0; - return &add; -} - -static int unix_more(COMSTACK h) -{ - unix_state *sp = (unix_state *)h->cprivate; - - return sp->altlen && (*sp->complete)((unsigned char *) sp->altbuf, - sp->altlen); -} - -/* - * connect(2) will block (sometimes) - nothing we can do short of doing - * weird things like spawning subprocesses or threading or some weird junk - * like that. - */ -static int unix_connect(COMSTACK h, void *address) -{ - struct sockaddr_un *add = (struct sockaddr_un *)address; - int r; - - TRC(fprintf(stderr, "unix_connect\n")); - h->io_pending = 0; - if (h->state != CS_ST_UNBND) - { - h->cerrno = CSOUTSTATE; - return -1; - } - r = connect(h->iofile, (struct sockaddr *) add, SUN_LEN(add)); - if (r < 0) - { - if (yaz_errno() == EINPROGRESS) - { - h->event = CS_CONNECT; - h->state = CS_ST_CONNECTING; - h->io_pending = CS_WANT_WRITE|CS_WANT_READ; - return 1; - } - h->cerrno = CSYSERR; - return -1; - } - h->event = CS_CONNECT; - h->state = CS_ST_CONNECTING; - - return unix_rcvconnect (h); -} - -/* - * nop - */ -static int unix_rcvconnect(COMSTACK h) -{ - TRC(fprintf(stderr, "unix_rcvconnect\n")); - - if (h->state == CS_ST_DATAXFER) - return 0; - if (h->state != CS_ST_CONNECTING) - { - h->cerrno = CSOUTSTATE; - return -1; - } - h->event = CS_DATA; - h->state = CS_ST_DATAXFER; - return 0; -} - -#define CERTF "ztest.pem" -#define KEYF "ztest.pem" - -static int unix_bind(COMSTACK h, void *address, int mode) -{ - struct sockaddr *addr = (struct sockaddr *)address; - const char * path = ((struct sockaddr_un *)addr)->sun_path; - struct stat stat_buf; - - TRC (fprintf (stderr, "unix_bind\n")); - - if(stat(path, &stat_buf) != -1) { - struct sockaddr_un socket_unix; - int socket_out = -1; - if(! S_ISSOCK(stat_buf.st_mode)) { - h->cerrno = CSYSERR; - yaz_set_errno(EEXIST); /* Not a socket (File exists) */ - return -1; - } - if((socket_out = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { - h->cerrno = CSYSERR; - return -1; - } - socket_unix.sun_family = AF_UNIX; - strncpy(socket_unix.sun_path, path, sizeof(socket_unix.sun_path)); - if(connect(socket_out, (struct sockaddr *) &socket_unix, SUN_LEN(&socket_unix)) < 0) { - if(yaz_errno() == ECONNREFUSED) { - TRC (fprintf (stderr, "Socket exists but nobody is listening\n")); - } else { - h->cerrno = CSYSERR; - return -1; - } - } else { - close(socket_out); - h->cerrno = CSYSERR; - yaz_set_errno(EADDRINUSE); - return -1; - } - unlink(path); - } - - if (bind(h->iofile, (struct sockaddr *) addr, SUN_LEN((struct sockaddr_un *)addr))) - { - h->cerrno = CSYSERR; - return -1; - } - chmod(path, 0777); - if (mode == CS_SERVER && listen(h->iofile, 3) < 0) - { - h->cerrno = CSYSERR; - return -1; - } - h->state = CS_ST_IDLE; - h->event = CS_LISTEN; - return 0; -} - -static int unix_listen(COMSTACK h, char *raddr, int *addrlen, - int (*check_ip)(void *cd, const char *a, int len, int t), - void *cd) -{ - struct sockaddr_un addr; - YAZ_SOCKLEN_T len = sizeof(addr); - - TRC(fprintf(stderr, "unix_listen pid=%d\n", getpid())); - if (h->state != CS_ST_IDLE) - { - h->cerrno = CSOUTSTATE; - return -1; - } - h->newfd = accept(h->iofile, (struct sockaddr*)&addr, &len); - if (h->newfd < 0) - { - if ( - yaz_errno() == EWOULDBLOCK -#ifdef EAGAIN -#if EAGAIN != EWOULDBLOCK - || yaz_errno() == EAGAIN -#endif -#endif - ) - h->cerrno = CSNODATA; - else - h->cerrno = CSYSERR; - return -1; - } - if (addrlen && (size_t) (*addrlen) >= sizeof(struct sockaddr_un)) - memcpy(raddr, &addr, *addrlen = sizeof(struct sockaddr_un)); - else if (addrlen) - *addrlen = 0; - h->state = CS_ST_INCON; - return 0; -} - -static COMSTACK unix_accept(COMSTACK h) -{ - COMSTACK cnew; - unix_state *state, *st = (unix_state *)h->cprivate; - - TRC(fprintf(stderr, "unix_accept\n")); - if (h->state == CS_ST_INCON) - { - if (!(cnew = (COMSTACK)xmalloc(sizeof(*cnew)))) - { - h->cerrno = CSYSERR; - close(h->newfd); - h->newfd = -1; - return 0; - } - memcpy(cnew, h, sizeof(*h)); - cnew->iofile = h->newfd; - cnew->io_pending = 0; - if (!(state = (unix_state *) - (cnew->cprivate = xmalloc(sizeof(unix_state))))) - { - h->cerrno = CSYSERR; - if (h->newfd != -1) - { - close(h->newfd); - h->newfd = -1; - } - return 0; - } - if (!(cnew->blocking&1) && - (fcntl(cnew->iofile, F_SETFL, O_NONBLOCK) < 0) - ) - { - h->cerrno = CSYSERR; - if (h->newfd != -1) - { - close(h->newfd); - h->newfd = -1; - } - xfree (cnew); - xfree (state); - return 0; - } - h->newfd = -1; - state->altbuf = 0; - state->altsize = state->altlen = 0; - state->towrite = state->written = -1; - state->complete = st->complete; - memcpy(&state->addr, &st->addr, sizeof(state->addr)); - cnew->state = CS_ST_ACCEPT; - cnew->event = CS_NONE; - h->state = CS_ST_IDLE; - - h = cnew; - } - if (h->state == CS_ST_ACCEPT) - { - } - else - { - h->cerrno = CSOUTSTATE; - return 0; - } - h->io_pending = 0; - h->state = CS_ST_DATAXFER; - h->event = CS_DATA; - return h; -} - -#define CS_UNIX_BUFCHUNK 4096 - -/* - * Return: -1 error, >1 good, len of buffer, ==1 incomplete buffer, - * 0=connection closed. - */ -static int unix_get(COMSTACK h, char **buf, int *bufsize) -{ - unix_state *sp = (unix_state *)h->cprivate; - char *tmpc; - int tmpi, berlen, rest, req, tomove; - int hasread = 0, res; - - TRC(fprintf(stderr, "unix_get: bufsize=%d\n", *bufsize)); - if (sp->altlen) /* switch buffers */ - { - TRC(fprintf(stderr, " %d bytes in altbuf (0x%x)\n", sp->altlen, - (unsigned) sp->altbuf)); - tmpc = *buf; - tmpi = *bufsize; - *buf = sp->altbuf; - *bufsize = sp->altsize; - hasread = sp->altlen; - sp->altlen = 0; - sp->altbuf = tmpc; - sp->altsize = tmpi; - } - h->io_pending = 0; - while (!(berlen = (*sp->complete)((unsigned char *)*buf, hasread))) - { - if (!*bufsize) - { - if (!(*buf = (char *)xmalloc(*bufsize = CS_UNIX_BUFCHUNK))) - return -1; - } - else if (*bufsize - hasread < CS_UNIX_BUFCHUNK) - if (!(*buf =(char *)xrealloc(*buf, *bufsize *= 2))) - return -1; - res = recv(h->iofile, *buf + hasread, CS_UNIX_BUFCHUNK, 0); - TRC(fprintf(stderr, " recv res=%d, hasread=%d\n", res, hasread)); - if (res < 0) - { - if (yaz_errno() == EWOULDBLOCK -#ifdef EAGAIN -#if EAGAIN != EWOULDBLOCK - || yaz_errno() == EAGAIN -#endif -#endif - || yaz_errno() == EINPROGRESS - ) - { - h->io_pending = CS_WANT_READ; - break; - } - else if (yaz_errno() == 0) - continue; - else - return -1; - } - else if (!res) - return 0; - hasread += res; - } - TRC (fprintf (stderr, " Out of read loop with hasread=%d, berlen=%d\n", - hasread, berlen)); - /* move surplus buffer (or everything if we didn't get a BER rec.) */ - if (hasread > berlen) - { - tomove = req = hasread - berlen; - rest = tomove % CS_UNIX_BUFCHUNK; - if (rest) - req += CS_UNIX_BUFCHUNK - rest; - if (!sp->altbuf) - { - if (!(sp->altbuf = (char *)xmalloc(sp->altsize = req))) - return -1; - } else if (sp->altsize < req) - if (!(sp->altbuf =(char *)xrealloc(sp->altbuf, sp->altsize = req))) - return -1; - TRC(fprintf(stderr, " Moving %d bytes to altbuf(0x%x)\n", tomove, - (unsigned) sp->altbuf)); - memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove); - } - if (berlen < CS_UNIX_BUFCHUNK - 1) - *(*buf + berlen) = '\0'; - return berlen ? berlen : 1; -} - - - -/* - * Returns 1, 0 or -1 - * In nonblocking mode, you must call again with same buffer while - * return value is 1. - */ -static int unix_put(COMSTACK h, char *buf, int size) -{ - int res; - struct unix_state *state = (struct unix_state *)h->cprivate; - - TRC(fprintf(stderr, "unix_put: size=%d\n", size)); - h->io_pending = 0; - h->event = CS_DATA; - if (state->towrite < 0) - { - state->towrite = size; - state->written = 0; - } - else if (state->towrite != size) - { - h->cerrno = CSWRONGBUF; - return -1; - } - while (state->towrite > state->written) - { - if ((res = - send(h->iofile, buf + state->written, size - - state->written, -#ifdef MSG_NOSIGNAL - MSG_NOSIGNAL -#else - 0 -#endif - )) < 0) - { - if ( - yaz_errno() == EWOULDBLOCK -#ifdef EAGAIN -#if EAGAIN != EWOULDBLOCK - || yaz_errno() == EAGAIN -#endif -#endif - ) - { - TRC(fprintf(stderr, " Flow control stop\n")); - h->io_pending = CS_WANT_WRITE; - return 1; - } - h->cerrno = CSYSERR; - return -1; - } - state->written += res; - TRC(fprintf(stderr, " Wrote %d, written=%d, nbytes=%d\n", - res, state->written, size)); - } - state->towrite = state->written = -1; - TRC(fprintf(stderr, " Ok\n")); - return 0; -} - -static int unix_close(COMSTACK h) -{ - unix_state *sp = (struct unix_state *)h->cprivate; - - TRC(fprintf(stderr, "unix_close\n")); - if (h->iofile != -1) - { - close(h->iofile); - } - if (sp->altbuf) - xfree(sp->altbuf); - xfree(sp); - xfree(h); - return 0; -} - -static char *unix_addrstr(COMSTACK h) -{ - unix_state *sp = (struct unix_state *)h->cprivate; - char *buf = sp->buf; - sprintf(buf, "unix:%s", sp->addr.sun_path); - return buf; -} - -static int unix_set_blocking(COMSTACK p, int blocking) -{ - unsigned long flag; - - if (p->blocking == blocking) - return 1; - flag = fcntl(p->iofile, F_GETFL, 0); - if(!blocking) - flag = flag & ~O_NONBLOCK; - else - flag = flag | O_NONBLOCK; - if (fcntl(p->iofile, F_SETFL, flag) < 0) - return 0; - p->blocking = blocking; - return 1; -} -#endif diff --git a/comstack/waislen.c b/comstack/waislen.c deleted file mode 100644 index 0bf2ef6..0000000 --- a/comstack/waislen.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1995-1999, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: waislen.c,v $ - * Revision 1.5 1999-11-30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.4 1999/01/08 11:23:15 adam - * Added const modifier to some of the BER/ODR encoding routines. - * - * Revision 1.3 1996/02/29 14:23:13 adam - * Bug fix. - * - * Revision 1.2 1996/02/26 18:34:44 adam - * Bug fix. - * - * Revision 1.1 1996/02/20 13:02:58 quinn - * Wais length. - * - * - */ - -#include -#include -#include -/* - * Return length of WAIS package or 0 - */ -int completeWAIS(const unsigned char *buf, int len) -{ - int i, lval = 0; - - if (len < 25) - return 0; - if (*buf != '0') - return 0; - /* calculate length */ - for (i = 0; i < 10; i++) - lval = lval * 10 + (buf[i] - '0'); - lval += 25; - if (len >= lval) - return lval; - return 0; -} diff --git a/comstack/xmosi.c b/comstack/xmosi.c deleted file mode 100644 index 4e56b12..0000000 --- a/comstack/xmosi.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * Copyright (c) 1995, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: xmosi.c,v $ - * Revision 1.17 1999-06-16 11:55:24 adam - * Added APDU log to client. - * - * Revision 1.16 1997/09/17 12:10:30 adam - * YAZ version 1.4. - * - * Revision 1.15 1997/05/14 06:53:34 adam - * C++ support. - * - * Revision 1.14 1996/07/26 12:34:07 quinn - * Porting. - * - * Revision 1.13 1996/07/06 19:58:30 quinn - * System headerfiles gathered in yconfig - * - * Revision 1.12 1996/05/22 08:34:44 adam - * Added ifdef USE_XTIMOSI; so that 'make depend' works. - * - * Revision 1.11 1996/02/23 10:00:41 quinn - * WAIS Work - * - * Revision 1.10 1996/02/10 12:23:13 quinn - * Enablie inetd operations fro TCP/IP stack - * - * Revision 1.9 1996/01/02 08:57:28 quinn - * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass - * - * Revision 1.8 1995/11/01 13:54:29 quinn - * Minor adjustments - * - * Revision 1.7 1995/10/30 12:41:17 quinn - * Added hostname lookup for server. - * - * Revision 1.6 1995/09/29 17:12:00 quinn - * Smallish - * - * Revision 1.5 1995/09/28 10:24:32 quinn - * Windows changes - * - * Revision 1.4 1995/09/27 15:02:45 quinn - * Modified function heads & prototypes. - * - * Revision 1.3 1995/06/16 10:30:38 quinn - * Added REUSEADDR. - * - * Revision 1.2 1995/06/15 12:30:07 quinn - * Added @ as hostname alias for INADDR ANY. - * - * Revision 1.1 1995/06/14 09:58:20 quinn - * Renamed yazlib to comstack. - * - * Revision 1.15 1995/05/29 08:12:33 quinn - * Updates to aynch. operations. - * - * Revision 1.14 1995/05/16 09:37:31 quinn - * Fixed bug - * - * Revision 1.13 1995/05/16 08:51:19 quinn - * License, documentation, and memory fixes - * - * Revision 1.12 1995/05/02 08:53:24 quinn - * Trying in vain to fix comm with ISODE - * - * Revision 1.11 1995/04/21 16:32:08 quinn - * *** empty log message *** - * - * Revision 1.10 1995/03/27 08:36:14 quinn - * Some work on nonblocking operation in xmosi.c and rfct.c. - * Added protocol parameter to cs_create() - * - * Revision 1.9 1995/03/20 09:47:23 quinn - * Added server-side support to xmosi.c - * Fixed possible problems in rfct - * Other little mods - * - * Revision 1.8 1995/03/16 13:29:30 quinn - * Beginning to add server-side functions - * - * Revision 1.7 1995/03/14 10:28:47 quinn - * Adding server-side support to tcpip.c and fixing bugs in nonblocking I/O - * - * Revision 1.6 1995/03/09 15:22:43 quinn - * Fixed two bugs in get/rcv - * - * Revision 1.5 1995/03/07 16:29:47 quinn - * Various fixes. - * - * Revision 1.4 1995/03/07 10:26:56 quinn - * Initialized type field in the comstacks. - * - * Revision 1.3 1995/03/06 16:48:03 quinn - * Smallish changes. - * - * Revision 1.2 1995/03/06 10:54:41 quinn - * Server-side functions (t_bind/t_listen/t_accept) seem to work ok, now. - * Nonblocking mode needs work (and testing!) - * Added makensap to replace function in mosiutil.c. - * - * Revision 1.1 1995/03/01 08:40:33 quinn - * First working version of rfct. Addressing needs work. - * - */ - -#ifdef USE_XTIMOSI -/* - * Glue layer for Peter Furniss' xtimosi package. - */ - -#include -#include -#include -#include - -#define YNETINCLUDE -#include - -#include -#include - -#include - -int mosi_connect(COMSTACK h, void *address); -int mosi_get(COMSTACK h, char **buf, int *bufsize); -int mosi_put(COMSTACK h, char *buf, int size); -int mosi_more(COMSTACK h) { return 0; } /* not correct */ -int mosi_close(COMSTACK h); -int mosi_rcvconnect(COMSTACK h); -int mosi_bind(COMSTACK h, void *address, int mode); -int mosi_listen(COMSTACK h, char *addrp, int *addrlen); -COMSTACK mosi_accept(COMSTACK h); -char *mosi_addrstr(COMSTACK h); -void *mosi_straddr(COMSTACK h, const char *str); - -typedef struct mosi_state -{ - struct t_info info; /* data returned by t_open */ - struct t_call *call; - int hasread; /* how many bytes read of current PDU */ - int haswrit; /* how many bytes have we written */ - struct netbuf netbuf; -} mosi_state; - -static char *oidtostr(int *o) -{ - static char buf[512]; - - buf[0] = '\0'; - while (*o >= 0) - { - sprintf(buf + strlen(buf), "%d", *o); - if (*(++o) >= 0) - strcat(buf, " "); - } - return buf; -} - -static int addopt(struct netbuf *optbuf, unsigned long level, unsigned long - name, enum oid_proto proto, enum oid_class class, enum oid_value value) -{ - int *oid; - oident ent; - char *str; - - ent.proto = proto; - ent.oclass = class; - ent.value = value; - if (!(oid = oid_getoidbyent(&ent))) - return -1; - str = oidtostr(oid); - if (addoidoption(optbuf, level, name, str) < 0) - return -1; - return 0; -} - -COMSTACK mosi_type(int s, int blocking, int protocol) -{ - COMSTACK r; - mosi_state *state; - int flags = O_RDWR; - - if (s >= 0) - return 0; - - if (!(r = xmalloc(sizeof(*r)))) - return 0; - if (!(state = r->cprivate = xmalloc(sizeof(*state)))) - return 0; - - state->call = 0; - state->hasread = 0; - state->haswrit = 0; - r->protocol = protocol; - r->state = CS_UNBND; - r->type = mosi_type; - r->blocking = blocking; - r->f_connect = mosi_connect; - r->f_put = mosi_put; - r->f_get = mosi_get; - r->f_close = mosi_close; - r->f_more = mosi_more; - r->f_rcvconnect = mosi_rcvconnect; - r->f_bind = mosi_bind; - r->f_listen = mosi_listen; - r->f_accept = mosi_accept; - r->f_addrstr = mosi_addrstr; - r->r_straddr = mosi_straddr; - - if (!blocking) - flags |= O_NONBLOCK; - if ((r->iofile = u_open(CO_MOSI_NAME, flags, &state->info)) < 0) - return 0; - - r->timeout = COMSTACK_DEFAULT_TIMEOUT; - - return r; -} - -int hex2oct(char *hex, char *oct) -{ - int len = 0; - unsigned val; - - while (sscanf(hex, "%2x", &val) == 1) - { - if (strlen(hex) < 2) - return -1; - *((unsigned char*) oct++) = (unsigned char) val; - len++; - hex += 2; - } - return len; -} - -/* - * addressing specific to our hack of OSI transport. A sockaddr_in wrapped - * up in a t_mosiaddr in a netbuf (on a stick). - */ - -int *mosi_strtoaddr_ex(const char *str, struct netbuf *ret) -{ - struct sockaddr_in *add = xmalloc(sizeof(struct sockaddr_in)); - struct t_mosiaddr *mosiaddr = xmalloc(sizeof(struct t_mosiaddr)); - struct hostent *hp; - char *p, *b, buf[512], *nsap; - short int port = 102; - unsigned long tmpadd; - int ll = 0; - - assert(ret && add && mosiaddr); -#if 0 - mosiaddr->osi_ap_inv_id = NO_INVOKEID; - mosiaddr->osi_ae_inv_id = NO_INVOKEID; -#endif - mosiaddr->osi_apt_len = 0; - mosiaddr->osi_aeq_len = 0; - p = (char*)MOSI_PADDR(mosiaddr); - *(p++) = 0; /* No presentation selector */ - ll++; - *(p++) = 0; /* no session selector */ - ll++; - /* do we have a transport selector? */ - strcpy(buf, str); - if ((nsap = strchr(buf, '/'))) - { - *(nsap++) = '\0'; - if ((*p = hex2oct(buf, p + 1)) < 0) - return 0; - ll += *p + 1; - p += *p + 1; - } - else - { - nsap = buf; - *(p++) = 0; - ll++; - } - if (nsap && *nsap) - { - add->sin_family = AF_INET; - strcpy(buf, nsap); - if ((b = strchr(buf, ':'))) - { - *b = 0; - port = atoi(b + 1); - } - add->sin_port = htons(port); - if (!strcmp("@", buf)) - add->sin_addr.s_addr = INADDR_ANY; - else if ((hp = gethostbyname(buf))) - memcpy(&add->sin_addr.s_addr, *hp->h_addr_list, sizeof(struct in_addr)); - else if ((tmpadd = inet_addr(buf)) != 0) - memcpy(&add->sin_addr.s_addr, &tmpadd, sizeof(struct in_addr)); - else - return 0; - *(p++) = (char) sizeof(*add); - ll++; - memcpy(p, add, sizeof(*add)); - ll += sizeof(*add); - } - else - { - *(p++) = 0; - ll++; - } - mosiaddr->osi_paddr_len = ll; - ret->buf = (char*)mosiaddr; - ret->len = ret->maxlen = 100 /* sizeof(*mosiaddr) */ ; - - return 1; -} - -struct netbuf *mosi_strtoaddr(const char *str) -{ - struct netbuf *ret = xmalloc(sizeof(struct netbuf)); - - if (!mosi_strtoaddr_ex (str, ret)) - { - xfree (ret); - return 0; - } - return ret; -} - -struct netbuf *mosi_straddr(COMSTACK h, const char *str) -{ - mosi_state *st = h->cprivate; - struct netbuf *ret = &st->netbuf; - - if (!mosi_strtoaddr_ex (str, ret)) - { - xfree (ret); - return 0; - } - return ret; -} - -int mosi_connect(COMSTACK h, void *address) -{ - struct netbuf *addr = address, *local; - struct t_call *snd, *rcv; - struct t_bind bnd; - - if (!(snd = (struct t_call *) u_alloc(h->iofile, T_CALL, T_ALL))) - return -1; - if (!(rcv = (struct t_call *) u_alloc(h->iofile, T_CALL, T_ALL))) - return -1; - - snd->udata.len = 0; - if (addopt(&snd->opt, ISO_APCO, AP_CNTX_NAME, h->protocol, CLASS_APPCTX, - VAL_BASIC_CTX) < 0) - return -1; - if (addopt(&snd->opt, ISO_APCO, AP_ABS_SYN, h->protocol, CLASS_ABSYN, - VAL_APDU) < 0) - return -1; - /* - * We don't specify record formats yet. - * - * Xtimosi adds the oid for BER as transfer syntax automatically. - */ - - bnd.qlen = 0; - - if (h->state == CS_UNBND) - { - local = mosi_strtoaddr(""); /* not good in long run */ - memcpy(&bnd.addr, local, sizeof(*local)); - if (u_bind(h->iofile, &bnd, 0) < 0) - return -1; - } - - memcpy(&snd->addr, addr, sizeof(*addr)); - if (u_connect(h->iofile, snd, rcv) < 0) - { - if (t_errno == TNODATA) - return 1; - return -1; - } - return 0; -} - -int mosi_rcvconnect(COMSTACK h) -{ - if (u_rcvconnect(h->iofile, 0) < 0) - { - if (t_errno == TNODATA) - return 1; - return -1; - } - return 0; -} - -int mosi_bind(COMSTACK h, void *address, int mode) -{ - int res; - struct t_bind bnd; - int one = 1; - - if (setsockopt(h->iofile, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0) - { - h->cerrno = CSYSERR; - return -1; - } - if (mode == CS_SERVER) - bnd.qlen = 3; - else - bnd.qlen = 0; - memcpy(&bnd.addr, address, sizeof(struct netbuf)); - if ((res = u_bind(h->iofile, &bnd, 0)) < 0) - return -1; - h->state = CS_IDLE; - return 0; -} - -int mosi_listen(COMSTACK h, char *addp, int *addrlen) -{ - int res; - mosi_state *st = h->cprivate; - - if (!(st->call = (struct t_call*) t_alloc(h->iofile, T_CALL_STR, - T_ALL))) - return -1; - if ((res = u_listen(h->iofile, st->call)) < 0) - { - if (t_errno == TNODATA) - return 1; - return -1; - } - h->state = CS_INCON; - return 0; -} - -COMSTACK mosi_accept(COMSTACK h) -{ - COMSTACK new; - void *local; - struct mosi_state *st = h->cprivate, *ns; - int flags = O_RDWR; - - if (h->state != CS_INCON) - { - h->cerrno = CSOUTSTATE; - return 0; - } - if (!(new = xmalloc(sizeof(*new)))) - return 0; - *new = *h; - if (!(new->cprivate = ns = xmalloc(sizeof(*ns)))) - return 0; - *ns = *st; - if (!h->blocking) - flags |= O_NONBLOCK; - if ((new->iofile = u_open_r(CO_MOSI_NAME, flags, &st->info, st->call)) < 0) - return 0; - if (!(local = mosi_strtoaddr(""))) - return 0; - if (mosi_bind(new, local, CS_CLIENT) < 0) /* CS_CLIENT: qlen == 0 */ - return 0; - memcpy(&st->call->addr, local, sizeof(st->call->addr)); - if (u_accept(h->iofile, new->iofile, st->call) < 0) - { - mosi_close(new); - return 0; - } - return new; -} - -#define CS_MOSI_BUFCHUNK 4096 - -int mosi_get(COMSTACK h, char **buf, int *bufsize) -{ - int flags = 0, res; - mosi_state *ct = h->cprivate; - int got; - - do - { - if (!*bufsize) - { - if (!(*buf = xmalloc(*bufsize = CS_MOSI_BUFCHUNK))) - return -1; - } - else if (*bufsize - ct->hasread < CS_MOSI_BUFCHUNK) - if (!(*buf =xrealloc(*buf, *bufsize *= 2))) - return -1; - - if ((res = u_rcv(h->iofile, *buf + ct->hasread, CS_MOSI_BUFCHUNK, - &flags)) <= 0) - { - if (t_errno == TNODATA) - return 1; - return -1; - } - ct->hasread += res; - } - while (flags & T_MORE); - - /* all done. Reset hasread */ - got = ct->hasread; - ct->hasread = 0; - return got; -} - -int mosi_put(COMSTACK h, char *buf, int size) -{ - mosi_state *ct = h->cprivate; - int res = u_snd(h->iofile, buf + ct->haswrit, size - ct->haswrit, 0); - - if (res == size - ct->haswrit) - { - ct->haswrit = 0; - return 0; - } - else if (res < 0) - { - if (t_errno == TFLOW) - return 1; - return -1; - } - ct->haswrit += res; - return 1; -} - -int mosi_close(COMSTACK h) -{ - xfree(h->cprivate); - if (h->iofile >= 0) - u_close(h->iofile); - xfree(h); - return 0; -} - -char *mosi_addrstr(COMSTACK h) -{ - return "osi:[UNIMPLEMENTED]"; -} - -#endif diff --git a/configure.in b/configure.in index ac5bdc5..9dda795 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl YAZ Toolkit, Index Data 1994-2003 dnl See the file LICENSE for details. -dnl $Id: configure.in,v 1.116 2003-10-09 15:51:36 adam Exp $ +dnl $Id: configure.in,v 1.117 2003-10-27 12:21:21 adam Exp $ AC_INIT(include/yaz/yaz-version.h) AM_INIT_AUTOMAKE(yaz, 2.0.5) AM_MAINTAINER_MODE @@ -395,18 +395,11 @@ dnl AC_OUTPUT([ Makefile yaz.spec +src/Makefile +test/Makefile util/Makefile -odr/Makefile -z39.50/Makefile -ill/Makefile -zutil/Makefile -comstack/Makefile -ccl/Makefile -cql/Makefile -server/Makefile include/Makefile include/yaz/Makefile -lib/Makefile client/Makefile ztest/Makefile zoom/Makefile @@ -419,4 +412,4 @@ doc/tkl.xsl doc/yazhtml.xsl etc/Makefile yaz-config -],[sed s%yaz_echo_source=yes%yaz_echo_source=no%g < yaz-config > lib/yaz-config && chmod +x yaz-config lib/yaz-config]) +],[sed s%yaz_echo_source=yes%yaz_echo_source=no%g < yaz-config > util/yaz-config && chmod +x yaz-config util/yaz-config]) diff --git a/cql/.cvsignore b/cql/.cvsignore deleted file mode 100644 index 89af58a..0000000 --- a/cql/.cvsignore +++ /dev/null @@ -1,9 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.lo -*.la -cql.c -cql2pqf -cql2xcql diff --git a/cql/Makefile.am b/cql/Makefile.am deleted file mode 100644 index 62bf6aa..0000000 --- a/cql/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -# $Id: Makefile.am,v 1.4 2003-05-27 09:47:15 mike Exp $ -AM_YFLAGS=-p cql_ - -AM_CPPFLAGS=-I$(top_srcdir)/include - -noinst_LTLIBRARIES = libcql.la -noinst_PROGRAMS = cql2pqf cql2xcql - -EXTRA_DIST=lexer.c - -libcql_la_SOURCES=cql.y cqlstdio.c cqltransform.c \ - cqlutil.c xcqlutil.c cqlstring.c cqlstrer.c - -cql2pqf_SOURCES = cql2pqf.c -cql2xcql_SOURCES = cql2xcql.c - -LDADD=libcql.la ../util/libutil.la diff --git a/cql/cql.y b/cql/cql.y deleted file mode 100644 index 026dd36..0000000 --- a/cql/cql.y +++ /dev/null @@ -1,275 +0,0 @@ -/* $Id: cql.y,v 1.6 2003-09-04 18:13:39 adam Exp $ - Copyright (C) 2002-2003 - Index Data Aps - -This file is part of the YAZ toolkit. - -See the file LICENSE. - - bison parser for CQL grammar. -*/ -%{ -#include -#include -#include -#include -#include -#include - - typedef struct { - struct cql_node *rel; - struct cql_node *cql; - char *buf; - size_t len; - size_t size; - } token; - - struct cql_parser { - int (*getbyte)(void *client_data); - void (*ungetbyte)(int b, void *client_data); - void *client_data; - int last_error; - int last_pos; - struct cql_node *top; - NMEM nmem; - }; - -#define YYSTYPE token - -#define YYPARSE_PARAM parm -#define YYLEX_PARAM parm - - int yylex(YYSTYPE *lval, void *vp); - int yyerror(char *s); -%} - -%pure_parser -%token TERM AND OR NOT PROX GE LE NE -%expect 8 - -%% - -top: { - $$.rel = cql_node_mk_sc("srw.serverChoice", "scr", 0); - ((CQL_parser) parm)->top = 0; -} cqlQuery1 { - cql_node_destroy($$.rel); - ((CQL_parser) parm)->top = $2.cql; -} -; - -cqlQuery1: cqlQuery -| cqlQuery error { - cql_node_destroy($1.cql); - $$.cql = 0; -} -; - -cqlQuery: - searchClause -| - cqlQuery boolean { - $$.rel = $0.rel; - } searchClause { - struct cql_node *cn = cql_node_mk_boolean($2.buf); - - cn->u.boolean.modifiers = $2.rel; - cn->u.boolean.left = $1.cql; - cn->u.boolean.right = $4.cql; - - $$.cql = cn; - } -; - -searchClause: - '(' { - $$.rel = $0.rel; - - } cqlQuery ')' { - $$.cql = $3.cql; - } -| - searchTerm { - struct cql_node *st = cql_node_dup ($0.rel); - st->u.st.term = strdup($1.buf); - $$.cql = st; - } -| - index relation { - $$.rel = $2.rel; - $$.rel->u.st.index = strdup($1.buf); - } searchClause { - $$.cql = $4.cql; - cql_node_destroy($2.rel); - } -| '>' searchTerm '=' searchTerm { - $$.rel = $0.rel; - } cqlQuery { - $$.cql = cql_node_prefix($6.cql, $2.buf, $4.buf); - } -| '>' searchTerm { - $$.rel = $0.rel; - } cqlQuery { - $$.cql = cql_node_prefix($4.cql, 0, $2.buf); - } -; - -/* unary NOT search TERM here .. */ - -boolean: - AND | OR | NOT | PROX proxqualifiers { - $$ = $1; - $$.rel = $2.rel; - } - ; - -proxqualifiers: - Prelation { - $$.rel = cql_node_mk_proxargs ($1.buf, 0, 0, 0); - } -| - PrelationO Pdistance { - $$.rel = cql_node_mk_proxargs ($1.buf, $2.buf, 0, 0); - } -| - PrelationO PdistanceO Punit { - $$.rel = cql_node_mk_proxargs ($1.buf, $2.buf, $3.buf, 0); - } -| - PrelationO PdistanceO PunitO Pordering { - $$.rel = cql_node_mk_proxargs ($1.buf, $2.buf, $3.buf, $4.buf); - } -| -{ $$.rel = 0; } -; - -Punit: '/' searchTerm { - $$ = $2; - } -; - -PunitO: '/' searchTerm { - $$ = $2; - } -| -'/' { $$.buf[0] = 0; } -; -Prelation: '/' baseRelation { - $$ = $2; -} -; -PrelationO: '/' baseRelation { - $$ = $2; -} -| '/' { $$.buf[0] = 0; } -; -Pdistance: '/' searchTerm { - $$ = $2; -} -; - -PdistanceO: '/' searchTerm { - $$ = $2; -} -| '/' { $$.buf[0] = 0; } -; -Pordering: '/' searchTerm { - $$ = $2; -} -; - -relation: baseRelation modifiers { - struct cql_node *st = cql_node_mk_sc(/* index */ 0, - /* relation */ $1.buf, - /* term */ 0); - - st->u.st.modifiers = $2.cql; - $$.rel = st; -} -; - -modifiers: '/' searchTerm modifiers -{ - struct cql_node *mod = cql_node_mk_mod(0, $2.buf); - - mod->u.mod.next = $3.cql; - $$.cql = mod; -} -| -{ - $$.cql = 0; -} -; - -baseRelation: - '=' -| '>' -| '<' -| GE -| LE -| NE -| TERM -; - -index: - searchTerm; - -searchTerm: - TERM -| AND -| OR -| NOT -| PROX -; - -%% - -int yyerror(char *s) -{ - return 0; -} - -#include "lexer.c" - - -int cql_parser_stream(CQL_parser cp, - int (*getbyte)(void *client_data), - void (*ungetbyte)(int b, void *client_data), - void *client_data) -{ - cp->getbyte = getbyte; - cp->ungetbyte = ungetbyte; - cp->client_data = client_data; - if (cp->top) - cql_node_destroy(cp->top); - cql_parse(cp); - if (cp->top) - return 0; - return -1; -} - -CQL_parser cql_parser_create(void) -{ - CQL_parser cp = (CQL_parser) malloc (sizeof(*cp)); - - cp->top = 0; - cp->getbyte = 0; - cp->ungetbyte = 0; - cp->client_data = 0; - cp->last_error = 0; - cp->last_pos = 0; - cp->nmem = nmem_create(); - return cp; -} - -void cql_parser_destroy(CQL_parser cp) -{ - cql_node_destroy(cp->top); - nmem_destroy(cp->nmem); - free (cp); -} - -struct cql_node *cql_parser_result(CQL_parser cp) -{ - return cp->top; -} diff --git a/cql/cql2pqf.c b/cql/cql2pqf.c deleted file mode 100644 index 84d8948..0000000 --- a/cql/cql2pqf.c +++ /dev/null @@ -1,60 +0,0 @@ -/* $Id: cql2pqf.c,v 1.2 2003-06-04 09:45:00 adam Exp $ - Copyright (C) 2002-2003 - Index Data Aps - -This file is part of the YAZ toolkit. - -See the file LICENSE. -*/ - -#include -#include - -#include - -int main(int argc, char **argv) -{ - cql_transform_t ct; - int r; - int i, it = 1; - CQL_parser cp = cql_parser_create(); - - if (argc < 2) - { - fprintf (stderr, "usage\n cqltransform [] [interations]\n"); - exit (1); - } - ct = cql_transform_open_fname(argv[1]); - if (!ct) - { - fprintf (stderr, "failed to read properties %s\n", argv[1]); - exit (1); - } - if (argc >= 4) - it = atoi(argv[3]); - - for (i = 0; i= 3) - r = cql_parser_string(cp, argv[2]); - else - r = cql_parser_stdio(cp, stdin); - - if (r) - fprintf (stderr, "Syntax error\n"); - else - { - r = cql_transform_FILE(ct, cql_parser_result(cp), stdout); - printf("\n"); - if (r) - { - const char *addinfo; - cql_transform_error(ct, &addinfo); - printf ("Transform error %d %s\n", r, addinfo ? addinfo : ""); - } - } - } - cql_transform_close(ct); - cql_parser_destroy(cp); - return 0; -} diff --git a/cql/cql2xcql.c b/cql/cql2xcql.c deleted file mode 100644 index b2db2e5..0000000 --- a/cql/cql2xcql.c +++ /dev/null @@ -1,28 +0,0 @@ -/* $Id: cql2xcql.c,v 1.1 2003-01-06 08:20:27 adam Exp $ - Copyright (C) 2002-2003 - Index Data Aps - -This file is part of the YAZ toolkit. - -See the file LICENSE. -*/ - -#include - -#include - -int main(int argc, char **argv) -{ - int r; - CQL_parser cp = cql_parser_create(); - if (argc == 2) - r = cql_parser_string(cp, argv[1]); - else - r = cql_parser_stdio(cp, stdin); - if (r) - fprintf (stderr, "Syntax error\n"); - else - cql_to_xml_stdio(cql_parser_result(cp), stdout); - cql_parser_destroy(cp); - return 0; -} diff --git a/cql/cqlstdio.c b/cql/cqlstdio.c deleted file mode 100644 index 7846f0d..0000000 --- a/cql/cqlstdio.c +++ /dev/null @@ -1,36 +0,0 @@ -/* $Id: cqlstdio.c,v 1.1 2003-01-06 08:20:27 adam Exp $ - Copyright (C) 2002-2003 - Index Data Aps - -This file is part of the YAZ toolkit. - -See the file LICENSE. -*/ - -#include - -int getbyte_stream(void *client_data) -{ - FILE *f = (FILE*) client_data; - - int c = fgetc(f); - if (c == EOF) - return 0; - return c; -} - -void ungetbyte_stream (int c, void *client_data) -{ - FILE *f = (FILE*) client_data; - - if (c == 0) - c = EOF; - ungetc(c, f); -} - -int cql_parser_stdio(CQL_parser cp, FILE *f) -{ - return cql_parser_stream(cp, getbyte_stream, ungetbyte_stream, f); -} - - diff --git a/cql/cqlstrer.c b/cql/cqlstrer.c deleted file mode 100644 index 05a1862..0000000 --- a/cql/cqlstrer.c +++ /dev/null @@ -1,61 +0,0 @@ -/* $Id: cqlstrer.c,v 1.1 2003-05-27 09:47:15 mike Exp $ - Copyright (C) 2002-2003 - Index Data Aps - -This file is part of the YAZ toolkit. - -See the file LICENSE. -*/ - -#include - -/* - * The error-messages associated with these codes are taken from - * the SRW diagnostic specifications at - * http://www.loc.gov/srw/diagnostic-list.html - */ -const char *cql_strerror(int code) { - static char buf[80]; - switch (code) { - case 10: return "Illegal query"; - case 11: return "Unsupported query type (XCQL vs CQL)"; - case 12: return "Too many characters in query"; - case 13: return "Unbalanced or illegal use of parentheses"; - case 14: return "Unbalanced or illegal use of quotes"; - case 15: return "Illegal or unsupported index set"; - case 16: return "Illegal or unsupported index"; - case 17: return "Illegal or unsupported combination of index and index set"; - case 18: return "Illegal or unsupported combination of indexes"; - case 19: return "Illegal or unsupported relation"; - case 20: return "Illegal or unsupported relation modifier"; - case 21: return "Illegal or unsupported combination of relation modifers"; - case 22: return "Illegal or unsupported combination of relation and index"; - case 23: return "Too many characters in term"; - case 24: return "Illegal combination of relation and term"; - case 25: return "Special characters not quoted in term"; - case 26: return "Non special character escaped in term"; - case 27: return "Empty term unsupported"; - case 28: return "Masking character not supported"; - case 29: return "Masked words too short"; - case 30: return "Too many masking characters in term"; - case 31: return "Anchoring character not supported"; - case 32: return "Anchoring character in illegal or unsupported position"; - case 33: return "Combination of proximity/adjacency and masking characters not supported"; - case 34: return "Combination of proximity/adjacency and anchoring characters not supported"; - case 35: return "Terms only exclusion (stop) words"; - case 36: return "Term in invalid format for index or relation"; - case 37: return "Illegal or unsupported boolean operator"; - case 38: return "Too many boolean operators in query"; - case 39: return "Proximity not supported"; - case 40: return "Illegal or unsupported proximity relation"; - case 41: return "Illegal or unsupported proximity distance"; - case 42: return "Illegal or unsupported proximity unit"; - case 43: return "Illegal or unsupported proximity ordering"; - case 44: return "Illegal or unsupported combination of proximity modifiers"; - case 45: return "Index set name (prefix) assigned to multiple identifiers"; - default: break; - } - - sprintf(buf, "Unknown CQL error #%d", code); - return buf; -} diff --git a/cql/cqlstring.c b/cql/cqlstring.c deleted file mode 100644 index 49a7882..0000000 --- a/cql/cqlstring.c +++ /dev/null @@ -1,40 +0,0 @@ -/* $Id: cqlstring.c,v 1.2 2003-02-14 18:49:23 adam Exp $ - Copyright (C) 2002-2003 - Index Data Aps - -This file is part of the YAZ toolkit. - -See the file LICENSE for details. -*/ -#include - -struct cql_buf_info { - const char *str; - int off; -}; - -int getbuf(void *vp) -{ - struct cql_buf_info *bi = (struct cql_buf_info *) vp; - if (bi->str[bi->off] == 0) - return 0; - return bi->str[bi->off++]; -} - -void ungetbuf(int b, void *vp) -{ - struct cql_buf_info *bi = (struct cql_buf_info *) vp; - if (b) - (bi->off--); -} - -int cql_parser_string(CQL_parser cp, const char *str) -{ - struct cql_buf_info b; - - b.str = str; - b.off = 0; - - return cql_parser_stream(cp, getbuf, ungetbuf, &b); -} - diff --git a/cql/cqltransform.c b/cql/cqltransform.c deleted file mode 100644 index b538ce7..0000000 --- a/cql/cqltransform.c +++ /dev/null @@ -1,469 +0,0 @@ -/* $Id: cqltransform.c,v 1.4 2003-02-25 18:08:46 adam Exp $ - Copyright (C) 2002-2003 - Index Data Aps - -This file is part of the YAZ toolkit. - -See the file LICENSE. -*/ - -#include -#include -#include - -struct cql_prop_entry { - char *pattern; - char *value; - struct cql_prop_entry *next; -}; - -struct cql_transform_t_ { - struct cql_prop_entry *entry; - int error; - char *addinfo; -}; - -cql_transform_t cql_transform_open_FILE(FILE *f) -{ - char line[1024]; - cql_transform_t ct = (cql_transform_t) malloc (sizeof(*ct)); - struct cql_prop_entry **pp = &ct->entry; - - ct->error = 0; - ct->addinfo = 0; - while (fgets(line, sizeof(line)-1, f)) - { - const char *cp_value_start; - const char *cp_value_end; - const char *cp_pattern_end; - const char *cp = line; - while (*cp && !strchr(" \t=\r\n#", *cp)) - cp++; - cp_pattern_end = cp; - if (cp == line) - continue; - while (*cp && strchr(" \t\r\n", *cp)) - cp++; - if (*cp != '=') - continue; - cp++; - while (*cp && strchr(" \t\r\n", *cp)) - cp++; - cp_value_start = cp; - if (!(cp_value_end = strchr(cp, '#'))) - cp_value_end = strlen(line) + line; - - if (cp_value_end != cp_value_start && - strchr(" \t\r\n", cp_value_end[-1])) - cp_value_end--; - *pp = (struct cql_prop_entry *) malloc (sizeof(**pp)); - (*pp)->pattern = (char *) malloc (cp_pattern_end - line + 1); - memcpy ((*pp)->pattern, line, cp_pattern_end - line); - (*pp)->pattern[cp_pattern_end-line] = 0; - - (*pp)->value = (char *) malloc (cp_value_end - cp_value_start + 1); - if (cp_value_start != cp_value_end) - memcpy ((*pp)->value, cp_value_start, cp_value_end-cp_value_start); - (*pp)->value[cp_value_end - cp_value_start] = 0; - pp = &(*pp)->next; - } - *pp = 0; - return ct; -} - -void cql_transform_close(cql_transform_t ct) -{ - struct cql_prop_entry *pe; - if (!ct) - return; - pe = ct->entry; - while (pe) - { - struct cql_prop_entry *pe_next = pe->next; - free (pe->pattern); - free (pe->value); - free (pe); - pe = pe_next; - } - if (ct->addinfo) - free (ct->addinfo); - free (ct); -} - -cql_transform_t cql_transform_open_fname(const char *fname) -{ - cql_transform_t ct; - FILE *f = fopen(fname, "r"); - if (!f) - return 0; - ct = cql_transform_open_FILE(f); - fclose(f); - return ct; -} - -static const char *cql_lookup_property(cql_transform_t ct, - const char *pat1, const char *pat2) -{ - char pattern[80]; - struct cql_prop_entry *e; - - if (pat2) - sprintf (pattern, "%.39s%.39s", pat1, pat2); - else - sprintf (pattern, "%.39s", pat1); - for (e = ct->entry; e; e = e->next) - { - if (!strcmp(e->pattern, pattern)) - return e->value; - } - return 0; -} - -static const char *cql_lookup_value(cql_transform_t ct, - const char *prefix, - const char *value) -{ - struct cql_prop_entry *e; - int len = strlen(prefix); - - for (e = ct->entry; e; e = e->next) - { - if (!memcmp(e->pattern, prefix, len) && !strcmp(e->value, value)) - return e->pattern + len; - } - return 0; -} - - -int cql_pr_attr(cql_transform_t ct, const char *category, - const char *val, - const char *default_val, - void (*pr)(const char *buf, void *client_data), - void *client_data, - int errcode) -{ - const char *res; - res = cql_lookup_property(ct, category, val ? val : default_val); - if (!res) - res = cql_lookup_property(ct, category, "*"); - if (res) - { - char buf[64]; - - const char *cp0 = res, *cp1; - while ((cp1 = strchr(cp0, '='))) - { - while (*cp1 && *cp1 != ' ') - cp1++; - if (cp1 - cp0 >= sizeof(buf)) - break; - memcpy (buf, cp0, cp1 - cp0); - buf[cp1-cp0] = 0; - (*pr)("@attr ", client_data); - (*pr)(buf, client_data); - (*pr)(" ", client_data); - cp0 = cp1; - while (*cp0 == ' ') - cp0++; - } - return 1; - } - /* error ... */ - if (errcode && !ct->error) - { - ct->error = errcode; - ct->addinfo = strdup(val); - } - return 0; -} - -void emit_term(cql_transform_t ct, - const char *term, int length, - void (*pr)(const char *buf, void *client_data), - void *client_data) -{ - int i; - if (length > 0) - { - if (length > 1 && term[0] == '^' && term[length-1] == '^') - { - cql_pr_attr(ct, "position.", "firstAndLast", 0, - pr, client_data, 32); - term++; - length -= 2; - } - else if (term[0] == '^') - { - cql_pr_attr(ct, "position.", "first", 0, - pr, client_data, 32); - term++; - } - else if (term[length-1] == '^') - { - cql_pr_attr(ct, "position.", "last", 0, - pr, client_data, 32); - length--; - } - else - { - cql_pr_attr(ct, "position.", "any", 0, - pr, client_data, 32); - } - } - (*pr)("\"", client_data); - for (i = 0; iu.st.term; - const char *cp1; - const char *last_term = 0; - int last_length = 0; - while(cp0) - { - while (*cp0 == ' ') - cp0++; - cp1 = strchr(cp0, ' '); - if (last_term) - { - (*pr)("@", client_data); - (*pr)(op, client_data); - (*pr)(" ", client_data); - emit_term(ct, last_term, last_length, pr, client_data); - } - last_term = cp0; - if (cp1) - last_length = cp1 - cp0; - else - last_length = strlen(cp0); - cp0 = cp1; - } - if (last_term) - emit_term(ct, last_term, last_length, pr, client_data); -} - - -static const char *cql_get_ns(cql_transform_t ct, - struct cql_node *cn, - struct cql_node **prefix_ar, int prefix_level, - const char **n_prefix, - const char **n_suffix) -{ - int i; - const char *ns = 0; - char prefix[32]; - const char *cp = cn->u.st.index; - const char *cp_dot = strchr(cp, '.'); - - /* strz current prefix (empty if not given) */ - if (cp_dot && cp_dot-cp < sizeof(prefix)) - { - memcpy (prefix, cp, cp_dot - cp); - prefix[cp_dot - cp] = 0; - } - else - *prefix = 0; - - /* 2. lookup in prefix_ar. and return NS */ - for (i = prefix_level; !ns && --i >= 0; ) - { - struct cql_node *cn_prefix = prefix_ar[i]; - for (; cn_prefix; cn_prefix = cn_prefix->u.mod.next) - { - if (*prefix && cn_prefix->u.mod.name && - !strcmp(prefix, cn_prefix->u.mod.name)) - { - ns = cn_prefix->u.mod.value; - break; - } - else if (!*prefix && !cn_prefix->u.mod.name) - { - ns = cn_prefix->u.mod.value; - break; - } - } - } - if (!ns) - { - if (!ct->error) - { - ct->error = 15; - ct->addinfo = strdup(prefix); - } - return 0; - } - /* 3. lookup in set.NS for new prefix */ - *n_prefix = cql_lookup_value(ct, "set.", ns); - if (!*n_prefix) - { - if (!ct->error) - { - ct->error = 15; - ct->addinfo = strdup(ns); - } - return 0; - } - /* 4. lookup qualifier.prefix. */ - - cp = cn->u.st.index; - cp_dot = strchr(cp, '.'); - - *n_suffix = cp_dot ? cp_dot+1 : cp; - return ns; -} - -void cql_transform_r(cql_transform_t ct, - struct cql_node *cn, - void (*pr)(const char *buf, void *client_data), - void *client_data, - struct cql_node **prefix_ar, int prefix_level) -{ - const char *ns, *n_prefix, *n_suffix; - - if (!cn) - return; - switch (cn->which) - { - case CQL_NODE_ST: - if (cn->u.st.prefixes && prefix_level < 20) - prefix_ar[prefix_level++] = cn->u.st.prefixes; - ns = cql_get_ns(ct, cn, prefix_ar, prefix_level, &n_prefix, &n_suffix); - if (ns) - { - char n_full[64]; - sprintf (n_full, "%.20s.%.40s", n_prefix, n_suffix); - - if (!strcmp(ns, "http://www.loc.gov/zing/cql/srw-indexes/v1.0/") - && !strcmp(n_suffix, "resultSet")) - { - (*pr)("@set \"", client_data); - (*pr)(cn->u.st.term, client_data); - (*pr)("\" ", client_data); - return ; - } - cql_pr_attr(ct, "qualifier.", n_full, "srw.serverChoice", - pr, client_data, 16); - } - - if (cn->u.st.relation && !strcmp(cn->u.st.relation, "=")) - cql_pr_attr(ct, "relation.", "eq", "scr", - pr, client_data, 19); - else if (cn->u.st.relation && !strcmp(cn->u.st.relation, "<=")) - cql_pr_attr(ct, "relation.", "le", "scr", - pr, client_data, 19); - else if (cn->u.st.relation && !strcmp(cn->u.st.relation, ">=")) - cql_pr_attr(ct, "relation.", "ge", "scr", - pr, client_data, 19); - else - cql_pr_attr(ct, "relation.", cn->u.st.relation, "eq", - pr, client_data, 19); - if (cn->u.st.modifiers) - { - struct cql_node *mod = cn->u.st.modifiers; - for (; mod; mod = mod->u.mod.next) - { - cql_pr_attr(ct, "relationModifier.", mod->u.mod.value, 0, - pr, client_data, 20); - } - } - cql_pr_attr(ct, "structure.", cn->u.st.relation, 0, - pr, client_data, 24); - if (cn->u.st.relation && !strcmp(cn->u.st.relation, "all")) - { - emit_wordlist(ct, cn, pr, client_data, "and"); - } - else if (cn->u.st.relation && !strcmp(cn->u.st.relation, "any")) - { - emit_wordlist(ct, cn, pr, client_data, "or"); - } - else - { - emit_term(ct, cn->u.st.term, strlen(cn->u.st.term), - pr, client_data); - } - break; - case CQL_NODE_BOOL: - if (cn->u.boolean.prefixes && prefix_level < 20) - prefix_ar[prefix_level++] = cn->u.boolean.prefixes; - (*pr)("@", client_data); - (*pr)(cn->u.boolean.value, client_data); - (*pr)(" ", client_data); - - cql_transform_r(ct, cn->u.boolean.left, pr, client_data, - prefix_ar, prefix_level); - cql_transform_r(ct, cn->u.boolean.right, pr, client_data, - prefix_ar, prefix_level); - } -} - -int cql_transform(cql_transform_t ct, - struct cql_node *cn, - void (*pr)(const char *buf, void *client_data), - void *client_data) -{ - struct cql_node *prefix_ar[20], **pp; - struct cql_prop_entry *e; - - ct->error = 0; - if (ct->addinfo) - free (ct->addinfo); - ct->addinfo = 0; - - prefix_ar[0] = 0; - pp = &prefix_ar[0]; - for (e = ct->entry; e ; e = e->next) - { - if (!memcmp(e->pattern, "set.", 4)) - { - *pp = cql_node_mk_mod(e->pattern+4, e->value); - pp = &(*pp)->u.mod.next; - } - else if (!strcmp(e->pattern, "set")) - { - *pp = cql_node_mk_mod(0, e->value); - pp = &(*pp)->u.mod.next; - } - } - cql_transform_r (ct, cn, pr, client_data, prefix_ar, 1); - cql_node_destroy(prefix_ar[0]); - return ct->error; -} - - -int cql_transform_FILE(cql_transform_t ct, struct cql_node *cn, FILE *f) -{ - return cql_transform(ct, cn, cql_fputs, f); -} - -int cql_transform_buf(cql_transform_t ct, struct cql_node *cn, - char *out, int max) -{ - struct cql_buf_write_info info; - int r; - - info.off = 0; - info.max = max; - info.buf = out; - r = cql_transform(ct, cn, cql_buf_write_handler, &info); - if (info.off >= 0) - info.buf[info.off] = '\0'; - return r; -} - -int cql_transform_error(cql_transform_t ct, const char **addinfo) -{ - *addinfo = ct->addinfo; - return ct->error; -} diff --git a/cql/cqlutil.c b/cql/cqlutil.c deleted file mode 100644 index 15e2827..0000000 --- a/cql/cqlutil.c +++ /dev/null @@ -1,177 +0,0 @@ -/* $Id: cqlutil.c,v 1.3 2003-03-03 19:57:35 adam Exp $ - Copyright (C) 2002-2003 - Index Data Aps - -This file is part of the YAZ toolkit. - -See the file LICENSE. -*/ - -#include -#include - -#include - -void cql_fputs(const char *buf, void *client_data) -{ - FILE *f = (FILE *) client_data; - fputs(buf, f); -} - -struct cql_node *cql_node_dup (struct cql_node *cp) -{ - struct cql_node *cn = 0; - - if (!cp) - return 0; - switch (cp->which) - { - case CQL_NODE_ST: - cn = cql_node_mk_sc(cp->u.st.index, - cp->u.st.relation, - cp->u.st.term); - cn->u.st.modifiers = cql_node_dup(cp->u.st.modifiers); - cn->u.st.prefixes = cql_node_dup(cp->u.st.prefixes); - break; - case CQL_NODE_MOD: - cn = cql_node_mk_mod(cp->u.mod.name, - cp->u.mod.value); - cn->u.mod.next = cql_node_dup(cp->u.mod.next); - break; - case CQL_NODE_BOOL: - cn = cql_node_mk_boolean(cp->u.boolean.value); - cn->u.boolean.left = cql_node_dup(cp->u.boolean.left); - cn->u.boolean.right = cql_node_dup(cp->u.boolean.right); - cn->u.boolean.prefixes = cql_node_dup(cp->u.boolean.prefixes); - } - return cn; -} - -struct cql_node *cql_node_mk_sc(const char *index, - const char *relation, - const char *term) -{ - struct cql_node *p = (struct cql_node *) malloc(sizeof(*p)); - p->which = CQL_NODE_ST; - p->u.st.index = 0; - if (index) - p->u.st.index = strdup(index); - p->u.st.term = 0; - if (term) - p->u.st.term = strdup(term); - p->u.st.relation = 0; - if (relation) - p->u.st.relation = strdup(relation); - p->u.st.modifiers = 0; - p->u.st.prefixes = 0; - return p; -} - -struct cql_node *cql_node_mk_mod(const char *name, - const char *value) -{ - struct cql_node *p = (struct cql_node *) malloc(sizeof(*p)); - p->which = CQL_NODE_MOD; - - p->u.mod.name = 0; - if (name) - p->u.mod.name = strdup(name); - p->u.mod.value = 0; - if (value) - p->u.mod.value = strdup(value); - p->u.mod.next = 0; - return p; -} - -struct cql_node *cql_node_mk_boolean(const char *op) -{ - struct cql_node *p = (struct cql_node *) malloc(sizeof(*p)); - p->which = CQL_NODE_BOOL; - p->u.boolean.value = 0; - if (op) - p->u.boolean.value = strdup(op); - p->u.boolean.left = 0; - p->u.boolean.right = 0; - p->u.boolean.modifiers = 0; - p->u.boolean.prefixes = 0; - return p; -} - -struct cql_node *cql_node_prefix(struct cql_node *n, const char *prefix, - const char *uri) -{ - struct cql_node **cpp = 0; - if (n->which == CQL_NODE_ST) - { - cpp = &n->u.st.prefixes; - } - else if (n->which == CQL_NODE_BOOL) - { - cpp = &n->u.boolean.prefixes; - } - if (cpp) - { - struct cql_node *cp = cql_node_mk_mod(prefix, uri); - cp->u.mod.next = *cpp; - *cpp = cp; - } - return n; -} - -struct cql_node *cql_node_mk_proxargs(const char *relation, - const char *distance, - const char *unit, - const char *ordering) -{ - struct cql_node *m = 0, *m1; - - if (ordering && *ordering) - m = cql_node_mk_mod("ordering", ordering); - if (unit && *unit) - { - m1 = cql_node_mk_mod("unit", unit); - m1->u.mod.next = m; - m = m1; - } - if (distance && *distance) - { - m1 = cql_node_mk_mod("distance", distance); - m1->u.mod.next = m; - m = m1; - } - if (relation && *relation) - { - m1 = cql_node_mk_mod("relation", relation); - m1->u.mod.next = m; - m = m1; - } - return m; -} - -void cql_node_destroy(struct cql_node *cn) -{ - if (!cn) - return; - switch (cn->which) - { - case CQL_NODE_ST: - free (cn->u.st.index); - free (cn->u.st.relation); - free (cn->u.st.term); - cql_node_destroy(cn->u.st.modifiers); - cql_node_destroy(cn->u.st.prefixes); - break; - case CQL_NODE_MOD: - free (cn->u.mod.name); - free (cn->u.mod.value); - cql_node_destroy(cn->u.mod.next); - break; - case CQL_NODE_BOOL: - free (cn->u.boolean.value); - cql_node_destroy(cn->u.boolean.left); - cql_node_destroy(cn->u.boolean.right); - cql_node_destroy(cn->u.boolean.prefixes); - } - free (cn); -} - diff --git a/cql/lexer.c b/cql/lexer.c deleted file mode 100644 index 04113ae..0000000 --- a/cql/lexer.c +++ /dev/null @@ -1,113 +0,0 @@ -/* $Id: lexer.c,v 1.5 2003-09-04 18:13:39 adam Exp $ - Copyright (C) 2002-2003 - Index Data Aps - -This file is part of the YAZ toolkit. - -See the file LICENSE. -*/ - -static void putb(YYSTYPE *lval, CQL_parser cp, int c) -{ - if (lval->len+1 >= lval->size) - { - char *nb = nmem_malloc(cp->nmem, (lval->size = lval->len * 2 + 20)); - memcpy (nb, lval->buf, lval->len); - lval->buf = nb; - } - if (c) - lval->buf[lval->len++] = c; - lval->buf[lval->len] = '\0'; -} - -/* - * bison lexer for CQL. - */ - -int yylex(YYSTYPE *lval, void *vp) -{ - CQL_parser cp = (CQL_parser) vp; - int c; - lval->cql = 0; - lval->rel = 0; - lval->len = 0; - lval->size = 10; - lval->buf = nmem_malloc(cp->nmem, lval->size); - lval->buf[0] = '\0'; - do - { - c = cp->getbyte(cp->client_data); - if (c == 0) - return 0; - if (c == '\n') - return 0; - } while (isspace(c)); - if (strchr("()=>') - { - c1 = cp->getbyte(cp->client_data); - if (c1 == '=') - { - putb(lval, cp, c1); - return GE; - } - else - cp->ungetbyte(c1, cp->client_data); - } - else if (c == '<') - { - c1 = cp->getbyte(cp->client_data); - if (c1 == '=') - { - putb(lval, cp, c1); - return LE; - } - else if (c1 == '>') - { - putb(lval, cp, c1); - return NE; - } - else - cp->ungetbyte(c1, cp->client_data); - } - return c; - } - if (c == '"') - { - while ((c = cp->getbyte(cp->client_data)) != EOF && c != '"') - { - if (c == '\\') - c = cp->getbyte(cp->client_data); - putb(lval, cp, c); - } - putb(lval, cp, 0); - } - else - { - putb(lval, cp, c); - while ((c = cp->getbyte(cp->client_data)) != 0 && - !strchr(" \n()=<>/", c)) - { - if (c == '\\') - c = cp->getbyte(cp->client_data); - putb(lval, cp, c); - } -#if YYDEBUG - printf ("got %s\n", lval->buf); -#endif - if (c != 0) - cp->ungetbyte(c, cp->client_data); - if (!strcmp(lval->buf, "and")) - return AND; - if (!strcmp(lval->buf, "or")) - return OR; - if (!strcmp(lval->buf, "not")) - return NOT; - if (!strncmp(lval->buf, "prox", 4)) - return PROX; - } - return TERM; -} diff --git a/cql/xcqlutil.c b/cql/xcqlutil.c deleted file mode 100644 index 60c486b..0000000 --- a/cql/xcqlutil.c +++ /dev/null @@ -1,210 +0,0 @@ -/* $Id: xcqlutil.c,v 1.2 2003-02-14 18:49:23 adam Exp $ - Copyright (C) 2002-2003 - Index Data Aps - -This file is part of the YAZ toolkit. - -See the file LICENSE. -*/ -#include -#include -#include - -#include - -static void pr_n(const char *buf, - void (*pr)(const char *buf, void *client_data), - void *client_data, int n) -{ - int i; - for (i = 0; i': - (*pr)(">", client_data); - break; - default: - bf[0] = *src; - bf[1] = 0; - (*pr)(bf, client_data); - } - src++; - } -} - -static void prefixes(struct cql_node *cn, - void (*pr)(const char *buf, void *client_data), - void *client_data, int level) -{ - if (cn) - { - pr_n("\n", pr, client_data, level); - for (; cn; cn = cn->u.mod.next) - { - pr_n("\n", pr, client_data, level+2); - if (cn->u.mod.name) - { - pr_n("", pr, client_data, level+4); - pr_cdata(cn->u.mod.name, pr, client_data); - pr_n("\n", pr, client_data, 0); - } - if (cn->u.mod.value) - { - pr_n("", pr, client_data, level+4); - pr_cdata(cn->u.mod.value, pr, client_data); - pr_n("\n", pr, client_data, 0); - } - pr_n("\n", pr, client_data, level+2); - } - pr_n("\n", pr, client_data, level); - } -} - -static void cql_to_xml_r(struct cql_node *cn, - void (*pr)(const char *buf, void *client_data), - void *client_data, int level) -{ - if (!cn) - return; - switch (cn->which) - { - case CQL_NODE_ST: - pr_n("\n", pr, client_data, level); - prefixes(cn->u.st.prefixes, pr, client_data, level+2); - if (cn->u.st.index) - { - pr_n("", pr, client_data, level+2); - pr_cdata(cn->u.st.index, pr, client_data); - pr_n("\n", pr, client_data, 0); - } - if (cn->u.st.relation) - { - struct cql_node *m = cn->u.st.modifiers; - pr_n("\n", pr, client_data, level+2); - pr_n("", pr, client_data, level+4); - pr_cdata(cn->u.st.relation, pr, client_data); - pr_n("\n", pr, client_data, 0); - if (m) - { - pr_n("\n", pr, client_data, level+4); - for (; m; m = m->u.mod.next) - { - pr_n("", pr, client_data, level+6); - pr_cdata(m->u.mod.value, pr, client_data); - pr_n("\n", pr, client_data, 0); - } - pr_n("\n", pr, client_data, level+4); - } - pr_n("\n", pr, client_data, level+2); - } - if (cn->u.st.term) - { - pr_n("", pr, client_data, level+2); - pr_cdata(cn->u.st.term, pr, client_data); - pr_n("\n", pr, client_data, 0); - } - pr_n("\n", pr, client_data, level); - break; - case CQL_NODE_BOOL: - pr_n("\n", pr, client_data, level); - prefixes(cn->u.st.prefixes, pr, client_data, level+2); - if (cn->u.boolean.value) - { - struct cql_node *m = cn->u.boolean.modifiers; - pr_n("\n", pr, client_data, level+2); - - pr_n("", pr, client_data, level+4); - pr_cdata(cn->u.boolean.value, pr, client_data); - pr_n("\n", pr, client_data, 0); - - if (m) - { - pr_n("\n", pr, client_data, level+4); - for (; m; m = m->u.mod.next) - { - pr_n("", pr, client_data, level+6); - pr_cdata(m->u.mod.name, pr, client_data); - pr_n("", pr, client_data, 0); - if (m->u.mod.value) - { - pr_n("", pr, client_data, 0); - pr_cdata(m->u.mod.value, pr, client_data); - pr_n("", pr, client_data, 0); - } - pr_n("\n", pr, client_data, 0); - } - pr_n("\n", pr, client_data, level+4); - } - pr_n("\n", pr, client_data, level+2); - } - if (cn->u.boolean.left) - { - printf ("%*s\n", level+2, ""); - cql_to_xml_r(cn->u.boolean.left, pr, client_data, level+4); - printf ("%*s\n", level+2, ""); - } - if (cn->u.boolean.right) - { - printf ("%*s\n", level+2, ""); - cql_to_xml_r(cn->u.boolean.right, pr, client_data, level+4); - printf ("%*s\n", level+2, ""); - } - pr_n("\n", pr, client_data, level); - } -} - -void cql_to_xml(struct cql_node *cn, - void (*pr)(const char *buf, void *client_data), - void *client_data) -{ - cql_to_xml_r(cn, pr, client_data, 0); -} - -void cql_to_xml_stdio(struct cql_node *cn, FILE *f) -{ - cql_to_xml(cn, cql_fputs, f); -} - -void cql_buf_write_handler (const char *b, void *client_data) -{ - struct cql_buf_write_info *info = (struct cql_buf_write_info *)client_data; - int l = strlen(b); - if (info->off < 0 || (info->off + l >= info->max)) - { - info->off = -1; - return; - } - memcpy (info->buf + info->off, b, l); - info->off += l; -} - -int cql_to_xml_buf(struct cql_node *cn, char *out, int max) -{ - struct cql_buf_write_info info; - info.off = 0; - info.max = max; - info.buf = out; - cql_to_xml(cn, cql_buf_write_handler, &info); - if (info.off >= 0) - info.buf[info.off] = '\0'; - return info.off; -} - diff --git a/doc/Makefile.am b/doc/Makefile.am index bf76e54..7bc45ad 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.48 2003-10-02 19:47:41 adam Exp $ +## $Id: Makefile.am,v 1.49 2003-10-27 12:21:24 adam Exp $ docdir=$(datadir)/doc/@PACKAGE@ @@ -24,9 +24,11 @@ HTMLFILES = \ zoom.records.html zoom.resultsets.html zoom.scan.html MANFILES=yaz-client.1 yaz-client-ssl.1 yaz-ztest.8 \ - yaz-ztest-ssl.8 yaz-config.8 yaz.7 zoomsh.1 yaz-asncomp.1 -REFFILES=yaz-client.sgml yaz-ztest.sgml yaz-config.sgml \ - yaz-man.sgml zoomsh.sgml yaz-asncomp.sgml + yaz-ztest-ssl.8 yaz-config.8 yaz.7 zoomsh.1 yaz-asncomp.1 \ + yaz-marcdump.1 +REFFILES=yaz-client-man.xml yaz-ztest-man.xml yaz-config-man.xml \ + yaz-man.xml zoomsh-man.xml yaz-asncomp-man.xml \ + yaz-marcdump-man.xml SUPPORTFILES=yazhtml.dsl yazphp.dsl yazprint.dsl tkl.xsl xml.dcl id.eps \ apilayer.obj @@ -37,20 +39,20 @@ man_MANS = $(MANFILES) EXTRA_DIST = $(XMLFILES) $(SUPPORTFILES) $(man_MANS) $(REFFILES) \ $(doc_DATA) Doxyfile -yaz-client.1: $(srcdir)/yaz-client.sgml $(srcdir)/yaz-client-commands.xml - docbook2man $(srcdir)/yaz-client.sgml +yaz-client.1: $(srcdir)/yaz-client-man.xml $(srcdir)/yaz-client-commands.xml + docbook2man $(srcdir)/yaz-client-man.xml -yaz-ztest.8: yaz-ztest.sgml ztest-options.xml - docbook2man $(srcdir)/yaz-ztest.sgml +yaz-ztest.8: yaz-ztest-man.xml ztest-options.xml + docbook2man $(srcdir)/yaz-ztest-man.xml -yaz-config.8: yaz-config.sgml - docbook2man $(srcdir)/yaz-config.sgml +yaz-config.8: yaz-config-man.xml + docbook2man $(srcdir)/yaz-config-man.xml -yaz.7: yaz-man.sgml - docbook2man $(srcdir)/yaz-man.sgml +yaz.7: yaz-man.xml + docbook2man $(srcdir)/yaz-man.xml -zoomsh.1: zoomsh.sgml - docbook2man $(srcdir)/zoomsh.sgml +zoomsh.1: zoomsh-man.xml + docbook2man $(srcdir)/zoomsh-man.xml yaz-ztest-ssl.8: ln -s yaz-ztest.8 yaz-ztest-ssl.8 @@ -58,8 +60,11 @@ yaz-ztest-ssl.8: yaz-client-ssl.1: ln -s yaz-client.1 yaz-client-ssl.1 -yaz-asncomp.1: yaz-asncomp.sgml - docbook2man $(srcdir)/yaz-asncomp.sgml +yaz-asncomp.1: yaz-asncomp-man.xml + docbook2man $(srcdir)/yaz-asncomp-man.xml + +yaz-marcdump.1: yaz-marcdump-man.xml + docbook2man $(srcdir)/yaz-marcdump-man.xml $(HTMLFILES): $(XMLFILES) jade -E14 -D $(srcdir) -d yazhtml.dsl -t sgml $(srcdir)/xml.dcl yaz.xml diff --git a/doc/yaz-asncomp-man.xml b/doc/yaz-asncomp-man.xml new file mode 100644 index 0000000..f39207f --- /dev/null +++ b/doc/yaz-asncomp-man.xml @@ -0,0 +1,254 @@ + + + + + yaz-asncomp + 1 + + + + yaz-asncomp + YAZ ASN.1 compiler + + + + + yaz-asncomp + + + + + + + + + filename + + + + DESCRIPTION + + yaz-asncomp is an ASN.1 compiler that + reads an ASN.1 specification in filename + and produces C/C++ definitions and BER encoders/decoders for it. + + + The produced C/C++ code and header files uses the ODR module of YAZ + which is a library that encodes/decodes/prints BER packages. + yaz-asncomp allows you to specify name of + resulting source via options. Alternatively, you can specify + a DEFINISIONS file, which provides customized output to + many output files - if the ASN.1 specification file consists + of many modules. + + + This utility is written in Tcl. Any version of Tcl should work. + + + + OPTIONS + + -v + + + + Makes the ASN.1 compiler print more verbose about the + various stages of operations. + + + + + -c + cfile + + Specifies the name of the C/C++ file with encoders/decoders. + + + + -h + hfile + + Specifies the name of header file with definitions. + + + + -p + pfile + + Specifies the name of the a private header file with + definitions. By default all definitions are put + in header file (option -h). + + + + -d + dfile + + Specifies the name of a definitions file. + + + + -I + iout + + Specifies first part of directory in which header files + are written. + + + + -i + idir + + Specifies second part of directory in which header files + are written. + + + + -m + module + + Specifies that ASN.1 compiler should only process the + module given. If this option is not specified, + all modules in the ASN.1 file are processed. + + + + + + DEFINITIONS FILE + + The definitions file is really a Tcl script but follows + traditional rules for Shell like configuration files. + That is # denotes the beginning of a comment. Definitions + are line oriented. The definitions files usually consists of + a series of variable assignments of the form: + + + set name value + + + Available variables are: + + + default-prefix + + Sets prefix for names in the produced output. + The value consists of three tokens: C function prefix, + C typedef prefix and preprocessor prefix respectively. + + + + prefix(module) + + This value sets prefix values for module + module. + The value has same form as default-prefix. + + + + filename(module) + + Specifies filename for C/header file for module + module. + + + + init(module,h) + + Code fragment to be put in first part of public header for module + module. + + + + body(module,h) + + Code fragment to be put in last part of public header for module + module (trailer). + + + + init(module,c) + + Code fragment to be put in first part of C based encoder/decoder for + module module. + + + + body(module,c) + + Code fragment to be put in last part of C based encoder/decoder for + module module (trailer). + + + + map(module,name) + + Maps ASN.1 type in module module + of name to value. + + + + membermap(module,name,member) + + Maps member member in SEQUENCE/CHOICE of + name in module + module to value. + The value consists of one or two tokens. + First token is name of C preprocessor part. Second token + is resulting C member name. If second token is omitted + the value (one token) is both preprocessor part and + C struct,union. + + + + unionmap(module,name,member) + + Maps member member in CHOICE of + name in module + module to value. + Value consists of to or three tokens. The first token + is name of the integer in the union that + is used as selector for the union itself. + The second token is name of the union. + The third token overrides the name of the CHOICE member; + if omitted the member name is used. + + + + + + FILES + + /usr/share/yaz/z39.50/z.tcl + + + /usr/share/yaz/z39.50/*.asn + + + SEE ALSO + + + yaz + 7 + + + Section "The ODR Module" in the YAZ manual. + + + + + diff --git a/doc/yaz-asncomp.sgml b/doc/yaz-asncomp.sgml deleted file mode 100644 index f39207f..0000000 --- a/doc/yaz-asncomp.sgml +++ /dev/null @@ -1,254 +0,0 @@ - - - - - yaz-asncomp - 1 - - - - yaz-asncomp - YAZ ASN.1 compiler - - - - - yaz-asncomp - - - - - - - - - filename - - - - DESCRIPTION - - yaz-asncomp is an ASN.1 compiler that - reads an ASN.1 specification in filename - and produces C/C++ definitions and BER encoders/decoders for it. - - - The produced C/C++ code and header files uses the ODR module of YAZ - which is a library that encodes/decodes/prints BER packages. - yaz-asncomp allows you to specify name of - resulting source via options. Alternatively, you can specify - a DEFINISIONS file, which provides customized output to - many output files - if the ASN.1 specification file consists - of many modules. - - - This utility is written in Tcl. Any version of Tcl should work. - - - - OPTIONS - - -v - - - - Makes the ASN.1 compiler print more verbose about the - various stages of operations. - - - - - -c - cfile - - Specifies the name of the C/C++ file with encoders/decoders. - - - - -h - hfile - - Specifies the name of header file with definitions. - - - - -p - pfile - - Specifies the name of the a private header file with - definitions. By default all definitions are put - in header file (option -h). - - - - -d - dfile - - Specifies the name of a definitions file. - - - - -I - iout - - Specifies first part of directory in which header files - are written. - - - - -i - idir - - Specifies second part of directory in which header files - are written. - - - - -m - module - - Specifies that ASN.1 compiler should only process the - module given. If this option is not specified, - all modules in the ASN.1 file are processed. - - - - - - DEFINITIONS FILE - - The definitions file is really a Tcl script but follows - traditional rules for Shell like configuration files. - That is # denotes the beginning of a comment. Definitions - are line oriented. The definitions files usually consists of - a series of variable assignments of the form: - - - set name value - - - Available variables are: - - - default-prefix - - Sets prefix for names in the produced output. - The value consists of three tokens: C function prefix, - C typedef prefix and preprocessor prefix respectively. - - - - prefix(module) - - This value sets prefix values for module - module. - The value has same form as default-prefix. - - - - filename(module) - - Specifies filename for C/header file for module - module. - - - - init(module,h) - - Code fragment to be put in first part of public header for module - module. - - - - body(module,h) - - Code fragment to be put in last part of public header for module - module (trailer). - - - - init(module,c) - - Code fragment to be put in first part of C based encoder/decoder for - module module. - - - - body(module,c) - - Code fragment to be put in last part of C based encoder/decoder for - module module (trailer). - - - - map(module,name) - - Maps ASN.1 type in module module - of name to value. - - - - membermap(module,name,member) - - Maps member member in SEQUENCE/CHOICE of - name in module - module to value. - The value consists of one or two tokens. - First token is name of C preprocessor part. Second token - is resulting C member name. If second token is omitted - the value (one token) is both preprocessor part and - C struct,union. - - - - unionmap(module,name,member) - - Maps member member in CHOICE of - name in module - module to value. - Value consists of to or three tokens. The first token - is name of the integer in the union that - is used as selector for the union itself. - The second token is name of the union. - The third token overrides the name of the CHOICE member; - if omitted the member name is used. - - - - - - FILES - - /usr/share/yaz/z39.50/z.tcl - - - /usr/share/yaz/z39.50/*.asn - - - SEE ALSO - - - yaz - 7 - - - Section "The ODR Module" in the YAZ manual. - - - - - diff --git a/doc/yaz-client-man.xml b/doc/yaz-client-man.xml new file mode 100644 index 0000000..ba3b9bb --- /dev/null +++ b/doc/yaz-client-man.xml @@ -0,0 +1,166 @@ + +]> + + + + + yaz-client + 1 + + + + yaz-client + Z39.50/SRW client for implementors + + + + + yaz-client + + + + + + + + + addr + + + + yaz-client-ssl + + addr + + + + + DESCRIPTION + + yaz-client is a Z39.50/SRW client (origin) with a + simple command line interface that allows you to test behavior and + performance of Z39.50 targets and SRW servers. + + + yaz-client-ssl is identical to + yaz-client except that it supports SSL transport. + + + If the addr is specified, the client creates + a connection to the Z39.50/SRW target at the address. + + + + OPTIONS + + + -m filename + + If specified, retrieved MARC (ISO2709) records will + be appended to the file given. + + + + -a filename + + If specified, logging of protocol packages will be appended + file given. The special filename - + (dash) denotes standard output. + + + + -u auth + + If specified, the auth string + will be used for authentication. + + + + -c filename + + If specified, CCL configuration will be read from + the file given. + + + + -q filename + + If specified, CQL configuration will be read from + the file given. + + + + + -p addr + + If specified, the client will use the proxy at the address + given. + + + + + -k size + + Sets preferred messages and maximum record size for Initialize + Request in kilobytes. Default value is 1024 (1 MB). + + + + + -x + + Makes the YAZ client print hex dumps of packages sent and received + on standard output. + + + + + + COMMANDS + + The YAZ client accepts the following commands. + + &yaz-client-commands; + + FILES + + yaz-<version>/client/client.c + + + SEE ALSO + + + yaz + 7 + + + + Section "The YAZ Client" in the YAZ manual. + + + Section "Prefix Query Format" in the YAZ manual. + + + Section "Common Command Language" in the YAZ manual. + + + Section "Common QUery Language" in the YAZ manual. + + + + + diff --git a/doc/yaz-client.sgml b/doc/yaz-client.sgml deleted file mode 100644 index 1475ba4..0000000 --- a/doc/yaz-client.sgml +++ /dev/null @@ -1,166 +0,0 @@ - -]> - - - - - yaz-client - 1 - - - - yaz-client - Z39.50/SRW client for implementors - - - - - yaz-client - - - - - - - - - addr - - - - yaz-client-ssl - - addr - - - - - DESCRIPTION - - yaz-client is a Z39.50/SRW client (origin) with a - simple command line interface that allows you to test behavior and - performance of Z39.50 targets and SRW servers. - - - yaz-client-ssl is identical to - yaz-client except that it supports SSL transport. - - - If the addr is specified, the client creates - a connection to the Z39.50/SRW target at the address. - - - - OPTIONS - - - -m filename - - If specified, retrieved MARC (ISO2709) records will - be appended to the file given. - - - - -a filename - - If specified, logging of protocol packages will be appended - file given. The special filename - - (dash) denotes standard output. - - - - -u auth - - If specified, the auth string - will be used for authentication. - - - - -c filename - - If specified, CCL configuration will be read from - the file given. - - - - -q filename - - If specified, CQL configuration will be read from - the file given. - - - - - -p addr - - If specified, the client will use the proxy at the address - given. - - - - - -k size - - Sets preferred messages and maximum record size for Initialize - Request in kilobytes. Default value is 1024 (1 MB). - - - - - -x - - Makes the YAZ client print hex dumps of packages sent and received - on standard output. - - - - - - COMMANDS - - The YAZ client accepts the following commands. - - &yaz-client-commands; - - FILES - - yaz-<version>/client/client.c - - - SEE ALSO - - - yaz - 7 - - - - Section "The YAZ Client" in the YAZ manual. - - - Section "Prefix Query Format" in the YAZ manual. - - - Section "Common Command Language" in the YAZ manual. - - - Section "Common QUery Language" in the YAZ manual. - - - - - diff --git a/doc/yaz-config-man.xml b/doc/yaz-config-man.xml new file mode 100644 index 0000000..c5bc8ee --- /dev/null +++ b/doc/yaz-config-man.xml @@ -0,0 +1,137 @@ + + + + + yaz-config + 8 + + + + yaz-config + Script to get information about YAZ. + + + + + yaz-config + + + + + + + libraries + + + + DESCRIPTION + + yaz-config is a script that returns information + that your own software should use to build software that uses YAZ. + + + + The following libraries are supported: + + + + + threads + + Use the threaded version of YAZ. + + + + ssl + + Use YAZ with SSL support. + + + + + + + OPTIONS + + + + --prefix[=DIR] + + Returns prefix of YAZ or assume a different one if DIR is + specified. + + + + + --version + + Returns version of YAZ. + + + + + --libs + + Library specification be used when using YAZ. + + + + + --lalibs + + Return library specification. + + + + + --cflags + + Return C Compiler flags. + + + + + --tabs + + Return directory of YAZ tables. + + + + + + + FILES + + prefix/bin/yaz-config + + + prefix/lib/libyaz*.a + + + prefix/include/yaz/*.h + + + SEE ALSO + + yaz(7) + + + Section "How to make apps using YAZ on UNIX" in the YAZ manual. + + + + + diff --git a/doc/yaz-config.sgml b/doc/yaz-config.sgml deleted file mode 100644 index 5234fa1..0000000 --- a/doc/yaz-config.sgml +++ /dev/null @@ -1,137 +0,0 @@ - - - - - yaz-config - 8 - - - - yaz-config - Script to get information about YAZ. - - - - - yaz-config - - - - - - - libraries - - - - DESCRIPTION - - yaz-config is a script that returns information - that your own software should use to build software that uses YAZ. - - - - The following libraries are supported: - - - - - threads - - Use the threaded version of YAZ. - - - - ssl - - Use YAZ with SSL support. - - - - - - - OPTIONS - - - - --prefix[=DIR] - - Returns prefix of YAZ or assume a different one if DIR is - specified. - - - - - --version - - Returns version of YAZ. - - - - - --libs - - Library specification be used when using YAZ. - - - - - --lalibs - - Return library specification. - - - - - --cflags - - Return C Compiler flags. - - - - - --tabs - - Return directory of YAZ tables. - - - - - - - FILES - - prefix/bin/yaz-config - - - prefix/lib/libyaz*.a - - - prefix/include/yaz/*.h - - - SEE ALSO - - yaz(7) - - - Section "How to make apps using YAZ on UNIX" in the YAZ manual. - - - - - diff --git a/doc/yaz-man.sgml b/doc/yaz-man.sgml deleted file mode 100644 index 0fbd363..0000000 --- a/doc/yaz-man.sgml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - yaz - 7 - - - - YAZ - Z39.50 toolkit. - - - - - YAZ - - - - DESCRIPTION - - YAZ is a C/C++ programmer's toolkit supporting the development - of Z39.50v3 clients and servers. The YAZ toolkit offers - several different levels of access to the ISO23950/Z39.50, SRW/SRU - and ILL protocols. The level that you need to use depends - on your requirements, and the role (server of client) that you want - to implement. - - - - COPYRIGHT - - Copyright (c) 1995-2003, Index Data. - - - Permission to use, copy, modify, distribute, and sell this software and - its documentation, in whole or in part, for any purpose, is hereby granted, - provided that: - - - 1. This copyright and permission notice appear in all copies of the - software and its documentation. Notices of copyright or attribution - which appear at the beginning of any file must remain unchanged. - - - 2. The names of Index Data or the individual authors may not be used to - endorse or promote products derived from this software without specific - prior written permission. - - - - THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR - NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - OF THIS SOFTWARE. - - - - SEE ALSO - - - yaz-client - 1 - , - - yaz-ztest - 8 - , - - yaz-config - 8 - , - - zoomsh - 1 - - - YAZ manual ( - prefix/share/doc/yaz) - - - YAZ home page. - - - Z39.50 Maintenance - Agency Page. - - - - - diff --git a/doc/yaz-man.xml b/doc/yaz-man.xml new file mode 100644 index 0000000..4c6bc7a --- /dev/null +++ b/doc/yaz-man.xml @@ -0,0 +1,109 @@ + + + + + yaz + 7 + + + + YAZ + Z39.50 toolkit. + + + + + YAZ + + + + DESCRIPTION + + YAZ is a C/C++ programmer's toolkit supporting the development + of Z39.50v3 clients and servers. The YAZ toolkit offers + several different levels of access to the ISO23950/Z39.50, SRW/SRU + and ILL protocols. The level that you need to use depends + on your requirements, and the role (server of client) that you want + to implement. + + + + COPYRIGHT + + Copyright (c) 1995-2003, Index Data. + + + Permission to use, copy, modify, distribute, and sell this software and + its documentation, in whole or in part, for any purpose, is hereby granted, + provided that: + + + 1. This copyright and permission notice appear in all copies of the + software and its documentation. Notices of copyright or attribution + which appear at the beginning of any file must remain unchanged. + + + 2. The names of Index Data or the individual authors may not be used to + endorse or promote products derived from this software without specific + prior written permission. + + + + THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, + EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, + INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR + NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + OF THIS SOFTWARE. + + + + SEE ALSO + + + yaz-client + 1 + , + + yaz-ztest + 8 + , + + yaz-config + 8 + , + + zoomsh + 1 + + + YAZ manual ( + prefix/share/doc/yaz) + + + YAZ home page. + + + Z39.50 Maintenance + Agency Page. + + + + + diff --git a/doc/yaz-marcdump-man.xml b/doc/yaz-marcdump-man.xml new file mode 100644 index 0000000..607c75a --- /dev/null +++ b/doc/yaz-marcdump-man.xml @@ -0,0 +1,140 @@ + + + + + yaz-marcdump + 1 + + + + yaz-marcdump + MARC record dump utility + + + + + yaz-marcdump + + + + + + + + file + + + + DESCRIPTION + + yaz-marcdump reads ISO2709/MARC records from one or + more files. + It validates each record and supports output in line-format, + MARCXML, OAIMARC as well as Hex output. + + + By default, each record is printed to standard output in a line + format with newline for each field, $x for each subfield x. + + + yaz-marcdump can also be requested to perform + character set conversion of each record. + + + + OPTIONS + + + + -x + + Print MARC records in a simple XML format. + This format is equivalent to YAZ_MARC_SIMPLEXML in + yaz/marcdisp.h. + + + + + -X + + Print MARC records in MARCXML. + This format is equivalent to YAZ_MARC_MARCXML in + yaz/marcdisp.h. + + + + + -O + + Print MARC records in OAIMARC. Another XML variant. + This format is equivalent to YAZ_MARC_OAIMARC in + yaz/marcdisp.h. + + + + + -ffrom] + + Specify the character set from + of the input MARC record. + Should be used in conjunction with option -t. + + + + + -tto] + + Specify the character set of + of the output. + Should be used in conjunction with option -f. + + + + + -v + + Print more information about the parsing process. + Useful if you have ill-formatted ISO2709 records as input. + + + + + + + EXAMPLES + + The following command converts MARC21/USMARC using MARC-8 encoding to + MARCXML in UTF-8 encoding. + + yaz-marcdump -f MARC-8 -t UTF-8 -X marc21.raw >marcxml.xml + + + + + FILES + + prefix/bin/yaz-marcdump + prefix/include/yaz/marcdisp.h + + + SEE ALSO + + yaz(7) + + + + + diff --git a/doc/yaz-ztest-man.xml b/doc/yaz-ztest-man.xml new file mode 100644 index 0000000..c172f03 --- /dev/null +++ b/doc/yaz-ztest-man.xml @@ -0,0 +1,104 @@ + +]> + + + + + yaz-ztest + 8 + + + + yaz-ztest + Z39.50 Test Server + + + + + yaz-ztest + + + + + + + + + + + listener-spec + + + + yaz-ztest-ssl + + addr + + + + DESCRIPTION + + yaz-ztest is a Z39.50 test server. + The server acts as a real Z39.50 server but does not use a database. + It returns a random hit count and returns a subset of a few built-in + records. + + + yaz-ztest-ssl is identical to + yaz-ztest except that it supports SSL transport. + + + The listener-spec consists of a transport + mode followed by a colon, followed by a listener address. The + transport mode is either tcp, unix, + or ssl (yaz-ztest-ssl only). + + + For TCP and SSL, an address has the form: + + hostname | IP-number [ : portnumber ] + + + + For UNIX local socket the address is the filename of the local socket. + + + + OPTIONS + &ztest-options; + + FILES + + yaz-<version>/ztest/yaz-ztest.c + + + yaz-<version>/include/yaz/backend.h + + + SEE ALSO + + + yaz + 7 + + + Section "Generic server" in the YAZ manual. + + + + + diff --git a/doc/yaz-ztest.sgml b/doc/yaz-ztest.sgml deleted file mode 100644 index 8796c52..0000000 --- a/doc/yaz-ztest.sgml +++ /dev/null @@ -1,104 +0,0 @@ - -]> - - - - - yaz-ztest - 8 - - - - yaz-ztest - Z39.50 Test Server - - - - - yaz-ztest - - - - - - - - - - - listener-spec - - - - yaz-ztest-ssl - - addr - - - - DESCRIPTION - - yaz-ztest is a Z39.50 test server. - The server acts as a real Z39.50 server but does not use a database. - It returns a random hit count and returns a subset of a few built-in - records. - - - yaz-ztest-ssl is identical to - yaz-ztest except that it supports SSL transport. - - - The listener-spec consists of a transport - mode followed by a colon, followed by a listener address. The - transport mode is either tcp, unix, - or ssl (yaz-ztest-ssl only). - - - For TCP and SSL, an address has the form: - - hostname | IP-number [ : portnumber ] - - - - For UNIX local socket the address is the filename of the local socket. - - - - OPTIONS - &ztest-options; - - FILES - - yaz-<version>/ztest/yaz-ztest.c - - - yaz-<version>/include/yaz/backend.h - - - SEE ALSO - - - yaz - 7 - - - Section "Generic server" in the YAZ manual. - - - - - diff --git a/doc/zoomsh-man.xml b/doc/zoomsh-man.xml new file mode 100644 index 0000000..995c323 --- /dev/null +++ b/doc/zoomsh-man.xml @@ -0,0 +1,162 @@ + +]> + + + + + zoomsh + 1 + + + + zoomsh + ZOOM shell + + + + + zoomsh + commands + + + + DESCRIPTION + + zoomsh is a ZOOM client with a simple + command line interface. The client demonstrates the ZOOM + API and is useful for testing targets. + + + You may pass one or more commands to zoomsh. + These commands are invoked first. + + + EXAMPLES + + If you start the yaz-ztest in one console you + can use the ZOOM shell as follows: + connect localhost:9999 +ZOOM>search computer +localhost:9999: 7 hits +ZOOM>show 0 1 +1 Default USmarc +001 11224466 +003 DLC +005 00000000000000.0 +008 910710c19910701nju 00010 eng +010 $a 11224466 +040 $a DLC $c DLC +050 00 $a 123-xyz +100 10 $a Jack Collins +245 10 $a How to program a computer +260 1 $a Penguin +263 $a 8710 +300 $a p. cm. +ZOOM>quit +]]> + + + + You can also achieve the same result by passing the commands + as arguments on a single command line: + + + $ zoomsh "connect localhost:9999" "search computer" + "show 0 1" quit + + + COMMANDS + + + connect + zurl + + Connects to the target given by zurl. + + + close + [zurl] + + Closes connection to target given by + zurl or all targets if + zurl was omitted. + + + show + [start + [count]] + + + Displays count records starting at offset given + by start. First records has offset 0 + (unlike the Z39.50 protocol). + + + quit + + + Quits zoomsh. + + + set + name + [value] + + + Sets option name to + value. + + + get + name + + + Prints value of option name. + + + help + + + Prints list of available commands. + + + + + + SEE ALSO + + + yaz + 7 + , + + yaz-ztest + 8 + , + + + Section "Building clients with ZOOM" in the YAZ manual. + + + ZOOM home page. + + + + + diff --git a/doc/zoomsh.sgml b/doc/zoomsh.sgml deleted file mode 100644 index e44a60a..0000000 --- a/doc/zoomsh.sgml +++ /dev/null @@ -1,162 +0,0 @@ - -]> - - - - - zoomsh - 1 - - - - zoomsh - ZOOM shell - - - - - zoomsh - commands - - - - DESCRIPTION - - zoomsh is a ZOOM client with a simple - command line interface. The client demonstrates the ZOOM - API and is useful for testing targets. - - - You may pass one or more commands to zoomsh. - These commands are invoked first. - - - EXAMPLES - - If you start the yaz-ztest in one console you - can use the ZOOM shell as follows: - connect localhost:9999 -ZOOM>search computer -localhost:9999: 7 hits -ZOOM>show 0 1 -1 Default USmarc -001 11224466 -003 DLC -005 00000000000000.0 -008 910710c19910701nju 00010 eng -010 $a 11224466 -040 $a DLC $c DLC -050 00 $a 123-xyz -100 10 $a Jack Collins -245 10 $a How to program a computer -260 1 $a Penguin -263 $a 8710 -300 $a p. cm. -ZOOM>quit -]]> - - - - You can also achieve the same result by passing the commands - as arguments on a single command line: - - - $ zoomsh "connect localhost:9999" "search computer" - "show 0 1" quit - - - COMMANDS - - - connect - zurl - - Connects to the target given by zurl. - - - close - [zurl] - - Closes connection to target given by - zurl or all targets if - zurl was omitted. - - - show - [start - [count]] - - - Displays count records starting at offset given - by start. First records has offset 0 - (unlike the Z39.50 protocol). - - - quit - - - Quits zoomsh. - - - set - name - [value] - - - Sets option name to - value. - - - get - name - - - Prints value of option name. - - - help - - - Prints list of available commands. - - - - - - SEE ALSO - - - yaz - 7 - , - - yaz-ztest - 8 - , - - - Section "Building clients with ZOOM" in the YAZ manual. - - - ZOOM home page. - - - - - diff --git a/ill/.cvsignore b/ill/.cvsignore deleted file mode 100644 index 8388140..0000000 --- a/ill/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -ill-core.c -item-req.c -libill.la -*.lo diff --git a/ill/Makefile.am b/ill/Makefile.am deleted file mode 100644 index f9db5ae..0000000 --- a/ill/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -## $Id: Makefile.am,v 1.10 2003-05-27 21:12:22 adam Exp $ - -AM_CPPFLAGS=-I$(top_srcdir)/include - -tabdatadir=$(pkgdatadir)/ill -tabdata_DATA=ill9702.asn item-req.asn ill.tcl -EXTRA_DIST=$(tabdata_DATA) - -noinst_LTLIBRARIES=libill.la - -libill_la_SOURCES=ill-core.c item-req.c ill-get.c - -$(srcdir)/ill-core.c \ -$(top_srcdir)/include/yaz/ill-core.h: \ -$(srcdir)/ill.tcl $(srcdir)/ill9702.asn $(top_srcdir)/util/yaz-asncomp - cd $(srcdir); ../util/yaz-asncomp -d ill.tcl -i yaz -I ../include $(YCFLAGS) ill9702.asn - -$(srcdir)/item-req.c \ -$(top_srcdir)/include/yaz/item-req.h: \ -$(srcdir)/ill.tcl $(srcdir)/item-req.asn $(top_srcdir)/util/yaz-asncomp - cd $(srcdir); ../util/yaz-asncomp -d ill.tcl -i yaz -I ../include $(YCFLAGS) item-req.asn diff --git a/ill/ill-get.c b/ill/ill-get.c deleted file mode 100644 index f953752..0000000 --- a/ill/ill-get.c +++ /dev/null @@ -1,690 +0,0 @@ -/* - * Copyright (c) 1999-2001, Index Data. - * See the file LICENSE for details. - * - * $Log: ill-get.c,v $ - * Revision 1.9 2001-03-25 21:55:12 adam - * Added odr_intdup. Ztest server returns TaskPackage for ItemUpdate. - * - * Revision 1.8 2001/02/21 13:46:53 adam - * C++ fixes. - * - * Revision 1.7 2001/02/20 11:25:32 adam - * Added ill_get_APDU and ill_get_Cancel. - * - * Revision 1.6 2000/08/10 08:41:26 adam - * Fixes for ILL. - * - * Revision 1.5 2000/02/24 08:52:01 adam - * Bug fix. - * - * Revision 1.4 2000/02/04 11:01:15 adam - * Added more elements. - * - * Revision 1.3 2000/01/31 13:15:21 adam - * Removed uses of assert(3). Cleanup of ODR. CCL parser update so - * that some characters are not surrounded by spaces in resulting term. - * ILL-code updates. - * - * Revision 1.2 2000/01/15 09:38:51 adam - * Implemented ill_get_ILLRequest. Added some type mappings for ILL protocol. - * - * Revision 1.1 1999/12/16 23:36:19 adam - * Implemented ILL protocol. Minor updates ASN.1 compiler. - * - */ - -#include - -bool_t *ill_get_bool (struct ill_get_ctl *gc, const char *name, - const char *sub, int val) -{ - ODR o = gc->odr; - char element[128]; - const char *v; - bool_t *r = (bool_t *) odr_malloc (o, sizeof(*r)); - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - - v = (gc->f)(gc->clientData, element); - if (v) - val = atoi(v); - else if (val < 0) - return 0; - *r = val; - return r; -} - -int *ill_get_int (struct ill_get_ctl *gc, const char *name, - const char *sub, int val) -{ - ODR o = gc->odr; - char element[128]; - const char *v; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - v = (gc->f)(gc->clientData, element); - if (v) - val = atoi(v); - return odr_intdup(o, val); -} - -int *ill_get_enumerated (struct ill_get_ctl *gc, const char *name, - const char *sub, int val) -{ - return ill_get_int(gc, name, sub, val); -} - -ILL_String *ill_get_ILL_String_x (struct ill_get_ctl *gc, const char *name, - const char *sub, const char *vdefault) -{ - ILL_String *r = (ILL_String *) odr_malloc (gc->odr, sizeof(*r)); - char element[128]; - const char *v; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - v = (gc->f)(gc->clientData, element); - if (!v) - v = vdefault; - if (!v) - return 0; - r->which = ILL_String_GeneralString; - r->u.GeneralString = odr_strdup (gc->odr, v); - return r; -} - -ILL_String *ill_get_ILL_String(struct ill_get_ctl *gc, const char *name, - const char *sub) -{ - return ill_get_ILL_String_x (gc, name, sub, 0); -} - -ILL_ISO_Date *ill_get_ILL_ISO_Date (struct ill_get_ctl *gc, const char *name, - const char *sub, const char *val) -{ - char element[128]; - const char *v; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - v = (gc->f)(gc->clientData, element); - if (!v) - v = val; - if (!v) - return 0; - return odr_strdup (gc->odr, v); -} - -ILL_ISO_Time *ill_get_ILL_ISO_Time (struct ill_get_ctl *gc, const char *name, - const char *sub, const char *val) -{ - char element[128]; - const char *v; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - v = (gc->f)(gc->clientData, element); - if (!v) - v = val; - if (!v) - return 0; - return odr_strdup (gc->odr, v); -} - -ILL_Person_Or_Institution_Symbol *ill_get_Person_Or_Insitution_Symbol ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - char element[128]; - ODR o = gc->odr; - ILL_Person_Or_Institution_Symbol *p = - (ILL_Person_Or_Institution_Symbol *) odr_malloc (o, sizeof(*p)); - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - p->which = ILL_Person_Or_Institution_Symbol_person_symbol; - if ((p->u.person_symbol = ill_get_ILL_String (gc, element, "person"))) - return p; - - p->which = ILL_Person_Or_Institution_Symbol_institution_symbol; - if ((p->u.institution_symbol = - ill_get_ILL_String (gc, element, "institution"))) - return p; - return 0; -} - -static ILL_Name_Of_Person_Or_Institution *ill_get_Name_Of_Person_Or_Institution( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - char element[128]; - ODR o = gc->odr; - ILL_Name_Of_Person_Or_Institution *p = - (ILL_Name_Of_Person_Or_Institution *) odr_malloc (o, sizeof(*p)); - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - p->which = ILL_Name_Of_Person_Or_Institution_name_of_person; - if ((p->u.name_of_person = - ill_get_ILL_String (gc, element, "name-of-person"))) - return p; - - p->which = ILL_Name_Of_Person_Or_Institution_name_of_institution; - if ((p->u.name_of_institution = - ill_get_ILL_String (gc, element, "name-of-institution"))) - return p; - return 0; -} - -ILL_System_Id *ill_get_System_Id(struct ill_get_ctl *gc, - const char *name, const char *sub) -{ - ODR o = gc->odr; - char element[128]; - ILL_System_Id *p; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - p = (ILL_System_Id *) odr_malloc (o, sizeof(*p)); - p->person_or_institution_symbol = ill_get_Person_Or_Insitution_Symbol ( - gc, element, "person-or-institution-symbol"); - p->name_of_person_or_institution = ill_get_Name_Of_Person_Or_Institution ( - gc, element, "name-of-person-or-institution"); - return p; -} - -ILL_Transaction_Id *ill_get_Transaction_Id (struct ill_get_ctl *gc, - const char *name, const char *sub) -{ - ODR o = gc->odr; - ILL_Transaction_Id *r = (ILL_Transaction_Id *) odr_malloc (o, sizeof(*r)); - char element[128]; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - r->initial_requester_id = - ill_get_System_Id (gc, element, "initial-requester-id"); - r->transaction_group_qualifier = - ill_get_ILL_String_x (gc, element, "transaction-group-qualifier", ""); - r->transaction_qualifier = - ill_get_ILL_String_x (gc, element, "transaction-qualifier", ""); - r->sub_transaction_qualifier = - ill_get_ILL_String (gc, element, "sub-transaction-qualifier"); - return r; -} - - -ILL_Service_Date_this *ill_get_Service_Date_this ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - ODR o = gc->odr; - ILL_Service_Date_this *r = - (ILL_Service_Date_this *) odr_malloc (o, sizeof(*r)); - char element[128]; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - r->date = ill_get_ILL_ISO_Date (gc, element, "date", "20000101"); - r->time = ill_get_ILL_ISO_Time (gc, element, "time", 0); - return r; -} - -ILL_Service_Date_original *ill_get_Service_Date_original ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - ODR o = gc->odr; - ILL_Service_Date_original *r = - (ILL_Service_Date_original *) odr_malloc (o, sizeof(*r)); - char element[128]; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - r->date = ill_get_ILL_ISO_Date (gc, element, "date", 0); - r->time = ill_get_ILL_ISO_Time (gc, element, "time", 0); - if (!r->date && !r->time) - return 0; - return r; -} - -ILL_Service_Date_Time *ill_get_Service_Date_Time ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - ODR o = gc->odr; - ILL_Service_Date_Time *r = - (ILL_Service_Date_Time *) odr_malloc (o, sizeof(*r)); - char element[128]; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - r->date_time_of_this_service = ill_get_Service_Date_this ( - gc, element, "this"); - r->date_time_of_original_service = ill_get_Service_Date_original ( - gc, element, "original"); - return r; -} - -ILL_Requester_Optional_Messages_Type *ill_get_Requester_Optional_Messages_Type ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - ODR o = gc->odr; - ILL_Requester_Optional_Messages_Type *r = - (ILL_Requester_Optional_Messages_Type *) odr_malloc (o, sizeof(*r)); - char element[128]; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - r->can_send_RECEIVED = ill_get_bool (gc, element, "can-send-RECEIVED", 0); - r->can_send_RETURNED = ill_get_bool (gc, element, "can-send-RETURNED", 0); - r->requester_SHIPPED = - ill_get_enumerated (gc, element, "requester-SHIPPED", 1); - r->requester_CHECKED_IN = - ill_get_enumerated (gc, element, "requester-CHECKED-IN", 1); - return r; -} - -ILL_Item_Id *ill_get_Item_Id ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - ODR o = gc->odr; - ILL_Item_Id *r = (ILL_Item_Id *) odr_malloc (o, sizeof(*r)); - char element[128]; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - r->item_type = ill_get_enumerated (gc, element, "item-type", - ILL_Item_Id_monograph); - r->held_medium_type = 0; - r->call_number = ill_get_ILL_String(gc, element, "call-number"); - r->author = ill_get_ILL_String(gc, element, "author"); - r->title = ill_get_ILL_String(gc, element, "title"); - r->sub_title = ill_get_ILL_String(gc, element, "sub-title"); - r->sponsoring_body = ill_get_ILL_String(gc, element, "sponsoring-body"); - r->place_of_publication = - ill_get_ILL_String(gc, element, "place-of-publication"); - r->publisher = ill_get_ILL_String(gc, element, "publisher"); - r->series_title_number = - ill_get_ILL_String(gc, element, "series-title-number"); - r->volume_issue = ill_get_ILL_String(gc, element, "volume-issue"); - r->edition = ill_get_ILL_String(gc, element, "edition"); - r->publication_date = ill_get_ILL_String(gc, element, "publication-date"); - r->publication_date_of_component = - ill_get_ILL_String(gc, element, "publication-date-of-component"); - r->author_of_article = ill_get_ILL_String(gc, element, - "author-of-article"); - r->title_of_article = ill_get_ILL_String(gc, element, "title-of-article"); - r->pagination = ill_get_ILL_String(gc, element, "pagination"); - r->national_bibliography_no = 0; - r->iSBN = ill_get_ILL_String(gc, element, "ISBN"); - r->iSSN = ill_get_ILL_String(gc, element, "ISSN"); - r->system_no = 0; - r->additional_no_letters = - ill_get_ILL_String(gc, element, "additional-no-letters"); - r->verification_reference_source = - ill_get_ILL_String(gc, element, "verification-reference-source"); - return r; -} - - -ILL_Client_Id *ill_get_Client_Id ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - char element[128]; - ODR o = gc->odr; - ILL_Client_Id *r = (ILL_Client_Id *) odr_malloc(o, sizeof(*r)); - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - r->client_name = ill_get_ILL_String (gc, element, "client-name"); - r->client_status = ill_get_ILL_String (gc, element, "client-status"); - r->client_identifier = ill_get_ILL_String (gc, element, - "client-identifier"); - return r; -} - -ILL_Postal_Address *ill_get_Postal_Address ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - ODR o = gc->odr; - ILL_Postal_Address *r = - (ILL_Postal_Address *) odr_malloc(o, sizeof(*r)); - char element[128]; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - r->name_of_person_or_institution = - ill_get_Name_Of_Person_Or_Institution ( - gc, element, "name-of-person-or-institution"); - r->extended_postal_delivery_address = - ill_get_ILL_String ( - gc, element, "extended-postal-delivery-address"); - r->street_and_number = - ill_get_ILL_String (gc, element, "street-and-number"); - r->post_office_box = - ill_get_ILL_String (gc, element, "post-office-box"); - r->city = ill_get_ILL_String (gc, element, "city"); - r->region = ill_get_ILL_String (gc, element, "region"); - r->country = ill_get_ILL_String (gc, element, "country"); - r->postal_code = ill_get_ILL_String (gc, element, "postal-code"); - return r; -} - -ILL_System_Address *ill_get_System_Address ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - ODR o = gc->odr; - ILL_System_Address *r = - (ILL_System_Address *) odr_malloc(o, sizeof(*r)); - char element[128]; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - r->telecom_service_identifier = - ill_get_ILL_String (gc, element, "telecom-service-identifier"); - r->telecom_service_address = - ill_get_ILL_String (gc, element, "telecom-service-addreess"); - return r; -} - -ILL_Delivery_Address *ill_get_Delivery_Address ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - ODR o = gc->odr; - ILL_Delivery_Address *r = - (ILL_Delivery_Address *) odr_malloc(o, sizeof(*r)); - char element[128]; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - r->postal_address = - ill_get_Postal_Address (gc, element, "postal-address"); - r->electronic_address = - ill_get_System_Address (gc, element, "electronic-address"); - return r; -} - -ILL_Search_Type *ill_get_Search_Type ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - ODR o = gc->odr; - ILL_Search_Type *r = (ILL_Search_Type *) odr_malloc(o, sizeof(*r)); - char element[128]; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - r->level_of_service = ill_get_ILL_String (gc, element, "level-of-service"); - r->need_before_date = ill_get_ILL_ISO_Date (gc, element, - "need-before-date", 0); - r->expiry_date = ill_get_ILL_ISO_Date (gc, element, "expiry-date", 0); - r->expiry_flag = ill_get_enumerated (gc, element, "expiry-flag", 3); - - return r; -} - -ILL_Request *ill_get_ILLRequest ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - ODR o = gc->odr; - ILL_Request *r = (ILL_Request *) odr_malloc(o, sizeof(*r)); - char element[128]; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - r->protocol_version_num = - ill_get_enumerated (gc, element, "protocol-version-num", - ILL_Request_version_2); - - r->transaction_id = ill_get_Transaction_Id (gc, element, "transaction-id"); - r->service_date_time = - ill_get_Service_Date_Time (gc, element, "service-date-time"); - r->requester_id = ill_get_System_Id (gc, element, "requester-id"); - r->responder_id = ill_get_System_Id (gc, element, "responder-id"); - r->transaction_type = - ill_get_enumerated(gc, element, "transaction-type", 1); - - r->delivery_address = - ill_get_Delivery_Address (gc, element, "delivery-address"); - r->delivery_service = 0; /* TODO */ - /* ill_get_Delivery_Service (gc, element, "delivery-service"); */ - r->billing_address = - ill_get_Delivery_Address (gc, element, "billing-address"); - - r->num_iLL_service_type = 1; - r->iLL_service_type = (ILL_Service_Type **) - odr_malloc (o, sizeof(*r->iLL_service_type)); - *r->iLL_service_type = - ill_get_enumerated (gc, element, "ill-service-type", - ILL_Service_Type_copy_non_returnable); - - r->responder_specific_service = 0; - r->requester_optional_messages = - ill_get_Requester_Optional_Messages_Type ( - gc, element,"requester-optional-messages"); - r->search_type = ill_get_Search_Type(gc, element, "search-type"); - r->num_supply_medium_info_type = 0; - r->supply_medium_info_type = 0; - - r->place_on_hold = ill_get_enumerated ( - gc, element, "place-on-hold", - ILL_Place_On_Hold_Type_according_to_responder_policy); - r->client_id = ill_get_Client_Id (gc, element, "client-id"); - - r->item_id = ill_get_Item_Id (gc, element, "item-id"); - r->supplemental_item_description = 0; - r->cost_info_type = 0; - r->copyright_compliance = - ill_get_ILL_String(gc, element, "copyright-complicance"); - r->third_party_info_type = 0; - r->retry_flag = ill_get_bool (gc, element, "retry-flag", 0); - r->forward_flag = ill_get_bool (gc, element, "forward-flag", 0); - r->requester_note = ill_get_ILL_String(gc, element, "requester-note"); - r->forward_note = ill_get_ILL_String(gc, element, "forward-note"); - r->num_iLL_request_extensions = 0; - r->iLL_request_extensions = 0; - return r; -} - -ILL_ItemRequest *ill_get_ItemRequest ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - ODR o = gc->odr; - ILL_ItemRequest *r = (ILL_ItemRequest *)odr_malloc(o, sizeof(*r)); - char element[128]; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - r->protocol_version_num = - ill_get_enumerated (gc, element, "protocol-version-num", - ILL_Request_version_2); - - r->transaction_id = ill_get_Transaction_Id (gc, element, "transaction-id"); - r->service_date_time = - ill_get_Service_Date_Time (gc, element, "service-date-time"); - r->requester_id = ill_get_System_Id (gc, element, "requester-id"); - r->responder_id = ill_get_System_Id (gc, element, "responder-id"); - r->transaction_type = - ill_get_enumerated(gc, element, "transaction-type", 1); - - r->delivery_address = - ill_get_Delivery_Address (gc, element, "delivery-address"); - r->delivery_service = 0; /* TODO */ - /* ill_get_Delivery_Service (gc, element, "delivery-service"); */ - r->billing_address = - ill_get_Delivery_Address (gc, element, "billing-address"); - - r->num_iLL_service_type = 1; - r->iLL_service_type = (ILL_Service_Type **) - odr_malloc (o, sizeof(*r->iLL_service_type)); - *r->iLL_service_type = - ill_get_enumerated (gc, element, "ill-service-type", - ILL_Service_Type_copy_non_returnable); - - r->responder_specific_service = 0; - r->requester_optional_messages = - ill_get_Requester_Optional_Messages_Type ( - gc, element,"requester-optional-messages"); - r->search_type = ill_get_Search_Type(gc, element, "search-type"); - r->num_supply_medium_info_type = 0; - r->supply_medium_info_type = 0; - - r->place_on_hold = ill_get_enumerated ( - gc, element, "place-on-hold", - ILL_Place_On_Hold_Type_according_to_responder_policy); - r->client_id = ill_get_Client_Id (gc, element, "client-id"); - - r->item_id = ill_get_Item_Id (gc, element, "item-id"); - r->supplemental_item_description = 0; - r->cost_info_type = 0; - r->copyright_compliance = - ill_get_ILL_String(gc, element, "copyright-complicance"); - r->third_party_info_type = 0; - r->retry_flag = ill_get_bool (gc, element, "retry-flag", 0); - r->forward_flag = ill_get_bool (gc, element, "forward-flag", 0); - r->requester_note = ill_get_ILL_String(gc, element, "requester-note"); - r->forward_note = ill_get_ILL_String(gc, element, "forward-note"); - r->num_iLL_request_extensions = 0; - r->iLL_request_extensions = 0; - return r; -} - -ILL_Cancel *ill_get_Cancel ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - ODR o = gc->odr; - ILL_Cancel *r = (ILL_Cancel *)odr_malloc(o, sizeof(*r)); - char element[128]; - - strcpy(element, name); - if (sub) - { - strcat (element, ","); - strcat (element, sub); - } - r->protocol_version_num = - ill_get_enumerated (gc, element, "protocol-version-num", - ILL_Request_version_2); - - r->transaction_id = ill_get_Transaction_Id (gc, element, "transaction-id"); - r->service_date_time = - ill_get_Service_Date_Time (gc, element, "service-date-time"); - r->requester_id = ill_get_System_Id (gc, element, "requester-id"); - r->responder_id = ill_get_System_Id (gc, element, "responder-id"); - r->requester_note = ill_get_ILL_String(gc, element, "requester-note"); - - r->num_cancel_extensions = 0; - r->cancel_extensions = 0; - return r; -} - -ILL_APDU *ill_get_APDU ( - struct ill_get_ctl *gc, const char *name, const char *sub) -{ - ODR o = gc->odr; - ILL_APDU *r = (ILL_APDU *)odr_malloc(o, sizeof(*r)); - char element[128]; - const char *v; - - strcpy (element, name); - strcat (element, ",which"); - - v = (gc->f)(gc->clientData, element); - if (!v) - v = "request"; - if (!strcmp (v, "request")) - { - r->which = ILL_APDU_ILL_Request; - r->u.illRequest = ill_get_ILLRequest(gc, name, sub); - } - else if (!strcmp (v, "cancel")) - { - r->which = ILL_APDU_Cancel; - r->u.Cancel = ill_get_Cancel(gc, name, sub); - } - else - return 0; - return r; -} diff --git a/ill/ill.tcl b/ill/ill.tcl deleted file mode 100644 index 927e2d0..0000000 --- a/ill/ill.tcl +++ /dev/null @@ -1,63 +0,0 @@ -# Config File for ILL -# $Id: ill.tcl,v 1.3 2001-02-21 13:46:53 adam Exp $ -# ---------------------------------------------------------- -# Prefix Specifications -# -# 1: C function prefix -# 2: C type prefix -# 3: C preprocessor prefix - -# Default prefix -set default-prefix {ill_ ILL_ ILL_} - -# ---------------------------------------------------------- -set m ISO-10161-ILL-1 - -# Filename -set filename($m) ill-core - -# Header initialization code -set init($m,h) " -" - -# Header body code -set body($m,h) " -#ifdef __cplusplus -extern \"C\" \{ -#endif - -#ifdef __cplusplus -\} -#endif -" - -# C body code -set body($m,c) " -" - -# Some mappings - that map ill_ILL_ to ill_ -set map($m,ILL-APDU) APDU -set map($m,ILL-Request) Request -set map($m,ILL-Answer) Answer -set map($m,ILL-String) String -set map($m,ILL-APDU-Type) APDU_Type -set map($m,ILL-Service-Type) Service_Type -set map($m,Service_Date_Time_0) Service_Date_this -set map($m,Service_Date_Time_1) Service_Date_original -set map($m,Overdue_0) Overdue_ExtensionS -set membermap($m,APDU,ILL-Request) {APDU_ILL_Request illRequest} -set membermap($m,APDU,ILL-Answer) {APDU_ILL_Answer illAnswer} - -# ---------------------------------------------------------- -set m Z39.50-extendedService-ItemOrder-ItemRequest-1 -# Filename -set filename($m) item-req - -# Mappings of a few basic types -proc asnBasicPrintableString {} { - return {odr_visiblestring char} -} - -proc asnBasicANY {} { - return {odr_any Odr_any} -} diff --git a/ill/ill9702.asn b/ill/ill9702.asn deleted file mode 100644 index e947489..0000000 --- a/ill/ill9702.asn +++ /dev/null @@ -1,1165 +0,0 @@ --- use of parameters and types is to be consistent with their definitions in clause 3 - -ISO-10161-ILL-1 DEFINITIONS EXPLICIT TAGS ::= - -BEGIN --- ISO-10161-ILL-1 refers to the ILL ISO standard 10161 version 1 --- and version 2 as specified in ISO standard 10161 Amendment 1 - -ILL-APDU ::= CHOICE { - ILL-Request, - Forward-Notification, - Shipped, - ILL-Answer, - Conditional-Reply, - Cancel, - Cancel-Reply, - Received, - Recall, - Returned, - Checked-In, - Overdue, - Renew, - Renew-Answer, - Lost, - Damaged, - Message, - Status-Query, - Status-Or-Error-Report, - Expired - } - --- The tagging scheme used in the APDU definitions is as follows: --- each named type that is a component type of an APDU definition is assigned a different tag --- that is unique within the set of APDU definitions. Where these component types themselves --- have structure, the tagging within such type definitions has only local scope. - -ILL-Request ::= [APPLICATION 1] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - transaction-type [5] IMPLICIT Transaction-Type DEFAULT 1, - delivery-address [6] IMPLICIT Delivery-Address OPTIONAL, - delivery-service Delivery-Service OPTIONAL, - billing-address [8] IMPLICIT Delivery-Address OPTIONAL, - iLL-service-type [9] IMPLICIT SEQUENCE SIZE (1..5) OF - ILL-Service-Type, - -- this sequence is a list, in order of preference - responder-specific-service [10] EXTERNAL OPTIONAL, - -- use direct reference style - requester-optional-messages [11] IMPLICIT Requester-Optional-Messages-Type, - search-type [12] IMPLICIT Search-Type OPTIONAL, - supply-medium-info-type [13] IMPLICIT SEQUENCE SIZE (1..7) OF - Supply-Medium-Info-Type OPTIONAL, - -- this sequence is a list, in order of preference, - -- with a maximum number of 7 entries - place-on-hold [14] IMPLICIT Place-On-Hold-Type DEFAULT 3, - client-id [15] IMPLICIT Client-Id OPTIONAL, - item-id [16] IMPLICIT Item-Id, - supplemental-item-description [17] IMPLICIT Supplemental-Item-Description OPTIONAL, - cost-info-type [18] IMPLICIT Cost-Info-Type OPTIONAL, - copyright-compliance [19] ILL-String OPTIONAL, - third-party-info-type [20] IMPLICIT Third-Party-Info-Type OPTIONAL, - -- mandatory when initiating a FORWARD service or an - -- ILL-REQUEST service for a partitioned ILL sub- - -- transaction or when initiating an ILL-REQUEST service for - -- an ILL sub-transaction if the received ILL-REQUEST - -- included an "already-tried-list";optional otherwise - retry-flag [21] IMPLICIT BOOLEAN DEFAULT FALSE, - forward-flag [22] IMPLICIT BOOLEAN DEFAULT FALSE, - requester-note [46] ILL-String OPTIONAL, - forward-note [47] ILL-String OPTIONAL, - iLL-request-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Forward-Notification ::= [APPLICATION 2] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id, - -- mandatory in this APDU - responder-address [24] IMPLICIT System-Address OPTIONAL, - intermediary-id [25] IMPLICIT System-Id, - notification-note [48] ILL-String OPTIONAL, - forward-notification-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Shipped ::= [APPLICATION 3] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-address [24] IMPLICIT System-Address OPTIONAL, - intermediary-id [25] IMPLICIT System-Id OPTIONAL, - supplier-id [26] IMPLICIT System-Id OPTIONAL, - client-id [15] IMPLICIT Client-Id OPTIONAL, - transaction-type [5] IMPLICIT Transaction-Type DEFAULT 1, - supplemental-item-description [17] IMPLICIT Supplemental-Item-Description OPTIONAL, - shipped-service-type [27] IMPLICIT Shipped-Service-Type, - responder-optional-messages [28] IMPLICIT Responder-Optional-Messages-Type - OPTIONAL, - supply-details [29] IMPLICIT Supply-Details, - return-to-address [30] IMPLICIT Postal-Address OPTIONAL, - responder-note [46] ILL-String OPTIONAL, - shipped-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -ILL-Answer ::= [APPLICATION 4] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - transaction-results [31] IMPLICIT Transaction-Results, - results-explanation [32] CHOICE { - conditional-results [1] Conditional-Results, - -- chosen if transaction-results=CONDITIONAL - retry-results [2] Retry-Results, - -- chosen if transaction-results=RETRY - unfilled-results [3] Unfilled-Results, - --chosen if transaction-results=UNFILLED - locations-results [4] Locations-Results, - -- chosen if transaction-results=LOCATIONS-PROVIDED - will-supply-results [5] Will-Supply-Results, - -- chosen if transaction-results=WILL-SUPPLY - hold-placed-results [6] Hold-Placed-Results, - -- chosen if transaction-results=HOLD-PLACED - estimate-results [7] Estimate-Results - -- chosen if transaction-results=ESTIMATE - } OPTIONAL, - -- optional if transaction-results equals RETRY, UNFILLED, - -- WILL-SUPPLY or HOLD-PLACED; - -- required if transaction-results equals CONDITIONAL, - -- LOCATIONS-PROVIDED or ESTIMATE - responder-specific-results [33] EXTERNAL OPTIONAL, - -- this type is mandatory if results-explanation - -- chosen for any result - -- has the value "responder-specific". - supplemental-item-description [17] IMPLICIT Supplemental-Item-Description OPTIONAL, - send-to-list [23] IMPLICIT Send-To-List-Type OPTIONAL, - already-tried-list [34] IMPLICIT Already-Tried-List-Type OPTIONAL, - responder-optional-messages [28] IMPLICIT Responder-Optional-Messages-Type - OPTIONAL, - responder-note [46] ILL-String OPTIONAL, - ill-answer-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Conditional-Reply ::= [APPLICATION 5] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - answer [35] IMPLICIT BOOLEAN, - requester-note [46] ILL-String OPTIONAL, - conditional-reply-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Cancel ::= [APPLICATION 6] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - requester-note [46] ILL-String OPTIONAL, - cancel-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Cancel-Reply ::= [APPLICATION 7] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - answer [35] IMPLICIT BOOLEAN, - responder-note [46] ILL-String OPTIONAL, - cancel-reply-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Received ::= [APPLICATION 8] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - supplier-id [26] IMPLICIT System-Id OPTIONAL, - supplemental-item-description [17] IMPLICIT Supplemental-Item-Description OPTIONAL, - date-received [36] IMPLICIT ISO-Date, - shipped-service-type [27] IMPLICIT Shipped-Service-Type, - requester-note [46] ILL-String OPTIONAL, - received-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Recall ::= [APPLICATION 9] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-note [46] ILL-String OPTIONAL, - recall-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Returned ::= [APPLICATION 10] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - supplemental-item-description [17] IMPLICIT Supplemental-Item-Description OPTIONAL, - date-returned [37] IMPLICIT ISO-Date, - returned-via [38] Transportation-Mode OPTIONAL, - insured-for [39] IMPLICIT Amount OPTIONAL, - requester-note [46] ILL-String OPTIONAL, - returned-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Checked-In ::= [APPLICATION 11] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - date-checked-in [40] IMPLICIT ISO-Date, - responder-note [46] ILL-String OPTIONAL, - checked-in-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Overdue ::= [APPLICATION 12] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - date-due [41] IMPLICIT Date-Due, - responder-note [46] ILL-String OPTIONAL, - overdue-extensions [49] SEQUENCE OF Extension OPTIONAL - } - -Renew ::= [APPLICATION 13] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - desired-due-date [42] IMPLICIT ISO-Date OPTIONAL, - requester-note [46] ILL-String OPTIONAL, - renew-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Renew-Answer ::= [APPLICATION 14] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - answer [35] IMPLICIT BOOLEAN, - date-due [41] IMPLICIT Date-Due OPTIONAL, - responder-note [46] ILL-String OPTIONAL, - renew-answer-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Lost ::= [APPLICATION 15] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - note [46] ILL-String OPTIONAL, - lost-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Damaged ::= [APPLICATION 16] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - damaged-details [5] IMPLICIT Damaged-Details OPTIONAL, - -- this parameter may only be present in APDU's with a - -- protocol-version-num value of 2 or greater - note [46] ILL-String OPTIONAL, - damaged-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Message ::= [APPLICATION 17] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - note [46] ILL-String, - message-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Status-Query ::= [APPLICATION 18] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - note [46] ILL-String OPTIONAL, - status-query-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Status-Or-Error-Report ::= [APPLICATION 19] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - reason-no-report [43] IMPLICIT Reason-No-Report OPTIONAL, - -- mandatory if no report is present; - -- not present otherwise - status-report [44] IMPLICIT Status-Report OPTIONAL, - error-report [45] IMPLICIT Error-Report OPTIONAL, - note [46] ILL-String OPTIONAL, - status-or-error-report-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Expired ::= [APPLICATION 20] SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id, - service-date-time [2] IMPLICIT Service-Date-Time, - requester-id [3] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - responder-id [4] IMPLICIT System-Id OPTIONAL, - -- mandatory when using store-and-forward communications - -- optional when using connection-oriented communications - expired-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } - -Account-Number ::= ILL-String - -Already-Forwarded ::= SEQUENCE { - responder-id [0] IMPLICIT System-Id, - responder-address [1] IMPLICIT System-Address OPTIONAL - } - -Already-Tried-List-Type ::= SEQUENCE OF System-Id - -Amount ::= SEQUENCE { - currency-code [0] IMPLICIT PrintableString (SIZE (3)) OPTIONAL, - -- values defined in ISO 4217-1981 - monetary-value [1] IMPLICIT AmountString (SIZE (1..10)) - } - -AmountString ::= PrintableString (FROM ("1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"|"0"|" "|"."|",")) - -Client-Id ::= SEQUENCE { - client-name [0] ILL-String OPTIONAL, - client-status [1] ILL-String OPTIONAL, - client-identifier [2] ILL-String OPTIONAL - } - -Conditional-Results ::= SEQUENCE { - conditions [0] IMPLICIT ENUMERATED { - cost-exceeds-limit (13), - charges (14), - prepayment-required (15), - lacks-copyright-compliance (16), - library-use-only (22), - no-reproduction (23), - client-signature-required (24), - special-collections-supervision-required (25), - other (27), - responder-specific (28), - proposed-delivery-service (30) - }, - date-for-reply [1] IMPLICIT ISO-Date OPTIONAL, - locations [2] IMPLICIT SEQUENCE OF Location-Info OPTIONAL, - proposed-delivery-service Delivery-Service OPTIONAL - -- this parameter specifies a proposed delivery service the - -- acceptance of which is a condition of supply. It may be a - -- physical service or an electronic service. This parameter - -- may only be present in APDUs with a - -- protocol-version-num value of 2 or greater - } - -Cost-Info-Type ::= SEQUENCE { - account-number [0] Account-Number OPTIONAL, - maximum-cost [1] IMPLICIT Amount OPTIONAL, - reciprocal-agreement [2] IMPLICIT BOOLEAN DEFAULT FALSE, - will-pay-fee [3] IMPLICIT BOOLEAN DEFAULT FALSE, - payment-provided [4] IMPLICIT BOOLEAN DEFAULT FALSE - } - -Current-State ::= ENUMERATED { - nOT-SUPPLIED (1), - pENDING (2), - iN-PROCESS (3), - fORWARD (4), - cONDITIONAL (5), - cANCEL-PENDING (6), - cANCELLED (7), - sHIPPED (8), - rECEIVED (9), - rENEW-PENDING (10), - nOT-RECEIVED-OVERDUE (11), - rENEW-OVERDUE (12), - oVERDUE (13), - rETURNED (14), - cHECKED-IN (15), - rECALL (16), - lOST (17), - uNKNOWN (18) - } - -Damaged-Details ::= SEQUENCE { - document-type-id [0] IMPLICIT OBJECT IDENTIFIER OPTIONAL, - -- identifies an OSI document type registered in accordance - -- with ISO 9834-2, for use in an automated environment - damaged-portion CHOICE { - complete-document [1] IMPLICIT NULL, - specific-units [2] IMPLICIT SEQUENCE - OF INTEGER - -- the nature and extent of a "unit" is implicit in the - -- value of document-type-id if one is supplied - } - } - -Date-Due ::= SEQUENCE { - date-due-field [0] IMPLICIT ISO-Date, - renewable [1] IMPLICIT BOOLEAN DEFAULT TRUE - } - -Delivery-Address ::= SEQUENCE { - postal-address [0] IMPLICIT Postal-Address OPTIONAL, - electronic-address [1] IMPLICIT System-Address OPTIONAL - } - -Delivery-Service ::= CHOICE { - physical-delivery [7] Transportation-Mode, - electronic-delivery [50] IMPLICIT SEQUENCE OF Electronic-Delivery-Service - -- electronic-delivery may only be present in APDUs - -- with a protocol-version-num value of 2 or greater - } - -Electronic-Delivery-Service ::= SEQUENCE { - -- the first four parameters are intended to be used in an automated - -- environment - e-delivery-service [0] IMPLICIT SEQUENCE { - -- identifies the kind of electronic delivery service, e.g. - -- MOTIS IPM,FTAM, etc., using the assigned object - -- identifier for the standard e.g. {joint-iso-ccitt mhs-motis - -- ipms} - e-delivery-mode [0] IMPLICIT OBJECT IDENTIFIER, - e-delivery-parameters [1] ANY DEFINED BY e-delivery-mode - } OPTIONAL, - document-type [1] IMPLICIT SEQUENCE { - document-type-id [2] IMPLICIT OBJECT IDENTIFIER, - -- identifies an OSI document type registered in accordance - -- with ISO 9834-2 - document-type-parameters [3] ANY DEFINED BY document-type-id - -- any parameters relating to the registered document type - } OPTIONAL, - e-delivery-description [4] ILL-String OPTIONAL, - -- holds a human readable name or description of the - -- required electronic delivery service and document type; - -- this may also be used to identify an electronic delivery - -- service for which there is no object identifier. - -- This parameter may be present instead of, or in addition - -- to, the previous 4 parameters - e-delivery-details [5] CHOICE { - e-delivery-address [0] IMPLICIT System-Address, - e-delivery-id [1] IMPLICIT System-Id - }, - name-or-code [6] ILL-String OPTIONAL, - -- holds a human-readable identifier or correlation - -- information for the document as shipped, e.g. a directory - -- and/or file name or message-id - delivery-time [7] IMPLICIT ISO-Time OPTIONAL - -- holds the requester's preferred delivery time or - -- the responder's proposed or actual delivery time - } - -Error-Report ::= SEQUENCE { - correlation-information [0] ILL-String, - report-source [1] IMPLICIT Report-Source, - user-error-report [2] User-Error-Report OPTIONAL, - -- mandatory if report-source is "user"; not present otherwise - provider-error-report [3] Provider-Error-Report OPTIONAL - -- mandatory if report-source is "provider"; not - -- present otherwise - } - -Estimate-Results ::= SEQUENCE { - cost-estimate [0] ILL-String, - locations [1] IMPLICIT SEQUENCE OF Location-Info OPTIONAL - } - -Extension ::= SEQUENCE { - identifier [0] IMPLICIT INTEGER, - critical [1] IMPLICIT BOOLEAN DEFAULT FALSE, - item [2] ANY DEFINED BY identifier - } - -General-Problem ::= ENUMERATED { - unrecognized-APDU (1), - mistyped-APDU (2), - badly-structured-APDU (3), - protocol-version-not-supported (4), - other (5) - } - -History-Report ::= SEQUENCE { - date-requested [0] IMPLICIT ISO-Date OPTIONAL, - author [1] ILL-String OPTIONAL, - title [2] ILL-String OPTIONAL, - author-of-article [3] ILL-String OPTIONAL, - title-of-article [4] ILL-String OPTIONAL, - date-of-last-transition [5] IMPLICIT ISO-Date, - most-recent-service [6] IMPLICIT ENUMERATED { - iLL-REQUEST (1), - fORWARD (21), - fORWARD-NOTIFICATION (2), - sHIPPED (3), - iLL-ANSWER (4), - cONDITIONAL-REPLY (5), - cANCEL (6), - cANCEL-REPLY (7), - rECEIVED (8), - rECALL (9), - rETURNED (10), - cHECKED-IN (11), - rENEW-ANSWER (14), - lOST (15), - dAMAGED (16), - mESSAGE (17), - sTATUS-QUERY (18), - sTATUS-OR-ERROR-REPORT (19), - eXPIRED (20) - }, - date-of-most-recent-service [7] IMPLICIT ISO-Date, - initiator-of-most-recent-service [8] IMPLICIT System-Id, - shipped-service-type [9] IMPLICIT Shipped-Service-Type OPTIONAL, - -- If the information is available, i.e. if a SHIPPED or - -- RECEIVED APDU has been sent or received, then the - -- value in this parameter shall be supplied. - -- Value must contain the most current information, e.g. if a - -- requester has received a SHIPPED APDU and then - -- invokes a RECEIVED.request, then the value from the - -- RECEIVED.request is used - transaction-results [10] IMPLICIT Transaction-Results OPTIONAL, - -- If the information is available, i.e. if an ILL-ANWSER - -- APDU has been sent or received, then the value in this - -- parameter shall be supplied. - most-recent-service-note [11] ILL-String OPTIONAL - -- If the information is available, i.e. if a note has been - -- supplied in the most recent service primitive, then the - -- value in this parameter shall be supplied. - } - -Hold-Placed-Results ::= SEQUENCE { - estimated-date-available [0] IMPLICIT ISO-Date, - hold-placed-medium-type [1] IMPLICIT Medium-Type OPTIONAL, - locations [2] IMPLICIT SEQUENCE OF Location-Info OPTIONAL - } - -ILL-APDU-Type ::= ENUMERATED { - iLL-REQUEST (1), - fORWARD-NOTIFICATION (2), - sHIPPED (3), - iLL-ANSWER (4), - cONDITIONAL-REPLY (5), - cANCEL (6), - cANCEL-REPLY (7), - rECEIVED (8), - rECALL (9), - rETURNED (10), - cHECKED-IN (11), - oVERDUE (12), - rENEW (13), - rENEW-ANSWER (14), - lOST (15), - dAMAGED (16), - mESSAGE (17), - sTATUS-QUERY (18), - sTATUS-OR-ERROR-REPORT (19), - eXPIRED (20) - } - -ILL-Service-Type ::= ENUMERATED { - loan (1), - copy-non-returnable (2), - locations (3), - estimate (4), - responder-specific (5) - } - -ILL-String ::= CHOICE { - GeneralString, - -- may contain any ISO registered G (graphic) and C - -- (control) character set - EDIFACTString - } - -- may not include leading or trailing spaces - -- may not consist only of space (" ") or non-printing - -- characters - -Intermediary-Problem ::= ENUMERATED { - cannot-send-onward (1) - } - -ISO-Date ::= VisibleString - -- conforms to ISO 8601 - -- length = 8 - -- fixed - -- YYYYMMDD - -ISO-Time ::= VisibleString - -- conforms to ISO 8601 - -- length = 6, - -- fixed - -- HHMMSS - -- local time of person or institution invoking service - -Item-Id ::= SEQUENCE { - item-type [0] IMPLICIT ENUMERATED { - monograph (1), - serial (2), - other (3) - } OPTIONAL, - held-medium-type [1] IMPLICIT Medium-Type OPTIONAL, - call-number [2] ILL-String OPTIONAL, - author [3] ILL-String OPTIONAL, - title [4] ILL-String OPTIONAL, - sub-title [5] ILL-String OPTIONAL, - sponsoring-body [6] ILL-String OPTIONAL, - place-of-publication [7] ILL-String OPTIONAL, - publisher [8] ILL-String OPTIONAL, - series-title-number [9] ILL-String OPTIONAL, - volume-issue [10] ILL-String OPTIONAL, - edition [11] ILL-String OPTIONAL, - publication-date [12] ILL-String OPTIONAL, - publication-date-of-component [13] ILL-String OPTIONAL, - author-of-article [14] ILL-String OPTIONAL, - title-of-article [15] ILL-String OPTIONAL, - pagination [16] ILL-String OPTIONAL, - national-bibliography-no [17] EXTERNAL OPTIONAL, - iSBN [18] ILL-String (SIZE (10)) OPTIONAL, - -- must conform to ISO 2108-1978 - iSSN [19] ILL-String (SIZE (8)) OPTIONAL, - -- must conform to ISO 3297-1986 - system-no [20] EXTERNAL OPTIONAL, - additional-no-letters [21] ILL-String OPTIONAL, - verification-reference-source [22] ILL-String OPTIONAL - } - -Location-Info ::= SEQUENCE { - location-id [0] IMPLICIT System-Id, - location-address [1] IMPLICIT System-Address OPTIONAL, - location-note [2] ILL-String OPTIONAL - } - -Locations-Results ::= SEQUENCE { - reason-locs-provided [0] IMPLICIT Reason-Locs-Provided OPTIONAL, - locations [1] IMPLICIT SEQUENCE OF Location-Info - } - -Medium-Type ::= ENUMERATED { - printed (1), - microform (3), - film-or-video-recording (4), - audio-recording (5), - machine-readable (6), - other (7) - } - -Name-Of-Person-Or-Institution ::= CHOICE { - name-of-person [0] ILL-String, - name-of-institution [1] ILL-String - } - -Person-Or-Institution-Symbol ::= CHOICE { - person-symbol [0] ILL-String, - institution-symbol [1] ILL-String - } - -Place-On-Hold-Type ::= ENUMERATED { - yes (1), - no (2), - according-to-responder-policy (3) - } - -Postal-Address ::= SEQUENCE { - name-of-person-or-institution [0] Name-Of-Person-Or-Institution OPTIONAL, - extended-postal-delivery-address [1] ILL-String OPTIONAL, - street-and-number [2] ILL-String OPTIONAL, - post-office-box [3] ILL-String OPTIONAL, - city [4] ILL-String OPTIONAL, - region [5] ILL-String OPTIONAL, - country [6] ILL-String OPTIONAL, - postal-code [7] ILL-String OPTIONAL - } - -Provider-Error-Report ::= CHOICE { - general-problem [0] IMPLICIT General-Problem, - transaction-id-problem [1] IMPLICIT Transaction-Id-Problem, - state-transition-prohibited [2] IMPLICIT State-Transition-Prohibited - } - -Reason-Locs-Provided ::= ENUMERATED { - in-use-on-loan (1), - in-process (2), - lost (3), - non-circulating (4), - not-owned (5), - on-order (6), - volume-issue-not-yet-available (7), - at-bindery (8), - lacking (9), - not-on-shelf (10), - on-reserve (11), - poor-condition (12), - cost-exceeds-limit (13), - on-hold (19), - other (27), - responder-specific (28) - } - -Reason-No-Report ::= ENUMERATED { - temporary (1), - permanent (2) - } - -Reason-Unfilled ::= ENUMERATED { - in-use-on-loan (1), - in-process (2), - lost (3), - non-circulating (4), - not-owned (5), - on-order (6), - volume-issue-not-yet-available (7), - at-bindery (8), - lacking (9), - not-on-shelf (10), - on-reserve (11), - poor-condition (12), - cost-exceeds-limit (13), - charges (14), - prepayment-required (15), - lacks-copyright-compliance (16), - not-found-as-cited (17), - locations-not-found (18), - on-hold (19), - policy-problem (20), - mandatory-messaging-not-supported (21), - expiry-not-supported (22) , - requested-delivery-services-not-supported (23), - preferred-delivery-time-not-possible (24), - other (27), - responder-specific (28) - } - -Report-Source ::= ENUMERATED { - user (1), - provider (2) - } - -Requester-Optional-Messages-Type ::= SEQUENCE { - can-send-RECEIVED [0] IMPLICIT BOOLEAN, - can-send-RETURNED [1] IMPLICIT BOOLEAN, - requester-SHIPPED [2] IMPLICIT ENUMERATED { - requires (1), - desires (2), - neither (3) - }, - requester-CHECKED-IN [3] IMPLICIT ENUMERATED { - requires (1), - desires (2), - neither (3) - } - } - -Responder-Optional-Messages-Type ::= SEQUENCE { - can-send-SHIPPED [0] IMPLICIT BOOLEAN, - can-send-CHECKED-IN [1] IMPLICIT BOOLEAN, - responder-RECEIVED [2] IMPLICIT ENUMERATED { - requires (1), - desires (2), - neither (3) - }, - responder-RETURNED [3] IMPLICIT ENUMERATED { - requires (1), - desires (2), - neither (3) - } - } - -Retry-Results ::= SEQUENCE { - reason-not-available [0] IMPLICIT ENUMERATED { - in-use-on-loan (1), - in-process (2), - on-order (6), - volume-issue-not-yet-available (7), - at-bindery (8), - cost-exceeds-limit (13), - charges (14), - prepayment-required (15), - lacks-copyright-compliance (16), - not-found-as-cited (17), - on-hold (19), - other (27), - responder-specific (28) - } OPTIONAL, - retry-date [1] IMPLICIT ISO-Date OPTIONAL, - locations [2] IMPLICIT SEQUENCE OF Location-Info OPTIONAL - } - -Search-Type ::= SEQUENCE { - level-of-service [0] ILL-String (SIZE (1)) OPTIONAL, - need-before-date [1] IMPLICIT ISO-Date OPTIONAL, - expiry-flag [2] IMPLICIT ENUMERATED { - need-Before-Date (1), - other-Date (2), - no-Expiry (3) - } DEFAULT 3, - -- value of "need-Before-Date" indicates that - -- need-before-date also specifies transaction expiry - -- date - expiry-date [3] IMPLICIT ISO-Date OPTIONAL - -- alternative expiry date can be used only when expiry-flag - -- is set to "Other-Date" - } - -Security-Problem ::= ILL-String - -Send-To-List-Type ::= SEQUENCE OF SEQUENCE { - system-id [0] IMPLICIT System-Id, - account-number [1] Account-Number OPTIONAL, - system-address [2] IMPLICIT System-Address OPTIONAL - } - -Service-Date-Time ::= SEQUENCE { - date-time-of-this-service [0] IMPLICIT SEQUENCE { - date [0] IMPLICIT ISO-Date, - time [1] IMPLICIT ISO-Time OPTIONAL - -- mandatory for 2nd and subsequent services - -- invoked for a given - -- ILL-transaction on the same day - }, - date-time-of-original-service [1] IMPLICIT SEQUENCE { - date [0] IMPLICIT ISO-Date, - time [1] IMPLICIT ISO-Time OPTIONAL - } OPTIONAL - } - -Shipped-Service-Type ::= ILL-Service-Type (loan | copy-non-returnable) - -- subtype of ILL-Service-Type - -State-Transition-Prohibited ::= SEQUENCE { - aPDU-type [0] IMPLICIT ILL-APDU-Type, - current-state [1] IMPLICIT Current-State - } - -Status-Report ::= SEQUENCE { - user-status-report [0] IMPLICIT History-Report, - provider-status-report [1] IMPLICIT Current-State - } - -Supplemental-Item-Description ::= SEQUENCE OF EXTERNAL - -- the syntax of supplementary item description information is defined outside this standard - -Supply-Details ::= SEQUENCE { - date-shipped [0] IMPLICIT ISO-Date OPTIONAL, - date-due [1] IMPLICIT Date-Due OPTIONAL, - chargeable-units [2] IMPLICIT INTEGER (1..9999) OPTIONAL, - cost [3] IMPLICIT Amount OPTIONAL, - shipped-conditions [4] IMPLICIT ENUMERATED { - library-use-only (22), - no-reproduction (23), - client-signature-required (24), - special-collections-supervision-required (25), - other (27) - } OPTIONAL, - shipped-via CHOICE { - physical-delivery [5] Transportation-Mode, - electronic-delivery [50] IMPLICIT - Electronic-Delivery-Service - } OPTIONAL, - -- electronic-delivery may only be present in APDUs with a - -- protocol-version-num value of 2 or greater - insured-for [6] IMPLICIT Amount OPTIONAL, - return-insurance-require [7] IMPLICIT Amount OPTIONAL, - no-of-units-per-medium [8] IMPLICIT SEQUENCE OF Units-Per-Medium-Type - OPTIONAL - } - -Supply-Medium-Info-Type ::= SEQUENCE { - supply-medium-type [0] IMPLICIT Supply-Medium-Type, - medium-characteristics [1] ILL-String OPTIONAL - } - -Supply-Medium-Type ::= ENUMERATED { - printed (1), - photocopy (2), - microform (3), - film-or-video-recording (4), - audio-recording (5), - machine-readable (6), - other (7) - } - -System-Address ::= SEQUENCE { - telecom-service-identifier [0] ILL-String OPTIONAL, - telecom-service-address [1] ILL-String OPTIONAL - } - -System-Id ::= SEQUENCE { - --at least one of the following must be present - person-or-institution-symbol [0] Person-Or-Institution-Symbol OPTIONAL, - name-of-person-or-institution [1] Name-Of-Person-Or-Institution OPTIONAL - } - -Third-Party-Info-Type ::= SEQUENCE { - permission-to-forward [0] IMPLICIT BOOLEAN DEFAULT FALSE, - permission-to-chain [1] IMPLICIT BOOLEAN DEFAULT FALSE, - permission-to-partition [2] IMPLICIT BOOLEAN DEFAULT FALSE, - permission-to-change-send-to-list [3] IMPLICIT BOOLEAN DEFAULT FALSE, - initial-requester-address [4] IMPLICIT System-Address OPTIONAL, - -- mandatory when initiating a FORWARD service or an - -- ILL-REQUEST service for a partitioned ILL - -- sub-transaction; optional otherwise - preference [5] IMPLICIT ENUMERATED { - ordered (1), - unordered (2) - } DEFAULT 2, - send-to-list [6] IMPLICIT Send-To-List-Type OPTIONAL, - already-tried-list [7] IMPLICIT Already-Tried-List-Type OPTIONAL - -- mandatory when initiating a FORWARD service, or when - -- initiating an ILL-REQUEST service for an ILL - -- sub-transaction if the received ILL-REQUEST included an - -- "already-tried-list"; optional otherwise - } - -Transaction-Id ::= SEQUENCE { - initial-requester-id [0] IMPLICIT System-Id OPTIONAL, - -- mandatory for sub-transactions; not called - -- "requester-id" to distinguish id of initial-requester - --from id of requester of sub-transaction if there is one - transaction-group-qualifier [1] ILL-String, - transaction-qualifier [2] ILL-String, - sub-transaction-qualifier [3] ILL-String OPTIONAL - -- mandatory for sub-transactions - } - -Transaction-Id-Problem ::= ENUMERATED { - duplicate-transaction-id (1), - invalid-transaction-id (2), - unknown-transaction-id (3) - } - -Transaction-Results ::= ENUMERATED { - conditional (1), - retry (2), - unfilled (3), - locations-provided (4), - will-supply (5), - hold-placed (6), - estimate (7) - } - -Transaction-Type ::= ENUMERATED { - simple (1), - chained (2), - partitioned (3) - } - -Transportation-Mode ::= ILL-String - -Unable-To-Perform ::= ENUMERATED { - not-available (1), - resource-limitation (2), - other (3) - } - -Unfilled-Results ::= SEQUENCE { - reason-unfilled [0] IMPLICIT Reason-Unfilled, - locations [1] IMPLICIT SEQUENCE OF Location-Info OPTIONAL - } - -Units-Per-Medium-Type ::= SEQUENCE { - medium [0] Supply-Medium-Type, - no-of-units [1] INTEGER (1..9999) - } - -User-Error-Report ::= CHOICE { - already-forwarded [0] IMPLICIT Already-Forwarded, - intermediary-problem [1] IMPLICIT Intermediary-Problem, - security-problem [2] Security-Problem, - unable-to-perform [3] IMPLICIT Unable-To-Perform - } - - -Will-Supply-Results ::= SEQUENCE { - reason-will-supply [0] ENUMERATED { - in-use-on-loan (1), - in-process (2), - on-order (6), - at-bindery (8), - on-hold (19), - being-processed-for-supply (26), - other (27), - responder-specific (28), - electronic-delivery (30) - }, - supply-date [1] ISO-Date OPTIONAL, - return-to-address [2] Postal-Address OPTIONAL, - locations [3] IMPLICIT SEQUENCE OF Location-Info OPTIONAL, - electronic-delivery-service [4] Electronic-Delivery-Service OPTIONAL - -- if present, this must be one of the services proposed by - -- the requester - } - -EDIFACTString ::= VisibleString - (FROM ("A"|"B"|"C"|"D"|"E"|"F"|"G"|"H"| - "I"|"J"|"K"|"L"|"M"|"N"|"O"|"P"|"Q"|"R"|"S"|"T"|"U"| - "V"|"W"|"X"|"Y"|"Z"|"a"|"b"|"c"|"d"|"e"|"f"|"g"|"h"| - "i"|"j"|"k"|"l"|"m"|"n"|"o"|"p"|"q"|"r"|"s"|"t"|"u"| - "v"|"w"|"x"|"y"|"z"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"| - "9"|"0"|" "|"."|","|"-"|"("|")"|"/"|"="|"!"|"""|"%"|"&"| - "*"|";"|"<"|">"|"'"|"+"|":"|"?")) - -END - - diff --git a/ill/item-req.asn b/ill/item-req.asn deleted file mode 100644 index 612d509..0000000 --- a/ill/item-req.asn +++ /dev/null @@ -1,58 +0,0 @@ -Z39.50-extendedService-ItemOrder-ItemRequest-1 DEFINITIONS ::= -BEGIN -IMPORTS - Transaction-Id, - Service-Date-Time, - System-Id, - Transaction-Type, - Delivery-Address, - ILL-Service-Type, - Requester-Optional-Messages-Type, - Search-Type, - Supply-Medium-Info-Type, - Place-On-Hold-Type, - Client-Id, - Item-Id, - Supplemental-Item-Description, - Cost-Info-Type, - ILL-String, - Third-Party-Info-Type, - Extension -FROM ISO-10161-ILL-1; - -ItemRequest ::=SEQUENCE { - protocol-version-num [0] IMPLICIT INTEGER { - version-1 (1), - version-2 (2) - }, - transaction-id [1] IMPLICIT Transaction-Id OPTIONAL, - service-date-time [2] IMPLICIT Service-Date-Time OPTIONAL, - requester-id [3] IMPLICIT System-Id OPTIONAL, - responder-id [4] IMPLICIT System-Id OPTIONAL, - transaction-type [5] IMPLICIT Transaction-Type DEFAULT 1, - delivery-address [6] IMPLICIT Delivery-Address OPTIONAL, - delivery-service Delivery-Service OPTIONAL, - billing-address [8] IMPLICIT Delivery-Address OPTIONAL, - iLL-service-type [9] IMPLICIT SEQUENCE SIZE (1..5) OF - ILL-Service-Type OPTIONAL, - responder-specific-service [10] EXTERNAL OPTIONAL, - -- use direct reference style - requester-optional-messages [11] IMPLICIT Requester-Optional-Messages-Type OPTIONAL, - search-type [12] IMPLICIT Search-Type OPTIONAL, - supply-medium-info-type [13] IMPLICIT SEQUENCE SIZE (1..7) OF - Supply-Medium-Info-Type OPTIONAL, - place-on-hold [14] IMPLICIT Place-On-Hold-Type DEFAULT 3, - client-id [15] IMPLICIT Client-Id OPTIONAL, - item-id [16] IMPLICIT Item-Id OPTIONAL, - supplemental-item-description [17] IMPLICIT Supplemental-Item-Description OPTIONAL, - cost-info-type [18] IMPLICIT Cost-Info-Type OPTIONAL, - copyright-compliance [19] ILL-String OPTIONAL, - third-party-info-type [20] IMPLICIT Third-Party-Info-Type OPTIONAL, - retry-flag [21] IMPLICIT BOOLEAN DEFAULT FALSE, - forward-flag [22] IMPLICIT BOOLEAN DEFAULT FALSE, - requester-note [46] ILL-String OPTIONAL, - forward-note [47] ILL-String OPTIONAL, - iLL-request-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL - } -END - diff --git a/lib/.cvsignore b/lib/.cvsignore deleted file mode 100644 index 8af9f14..0000000 --- a/lib/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -yaz-config -yaz-config.in -*.lo -*.la diff --git a/lib/Makefile.am b/lib/Makefile.am deleted file mode 100644 index 4fe2b90..0000000 --- a/lib/Makefile.am +++ /dev/null @@ -1,83 +0,0 @@ -## $Id: Makefile.am,v 1.29 2003-04-17 23:24:00 adam Exp $ - -if ISTHR -extra=libyazthread.la -endif - -if ISSSL -ssllib=libyazssl.la -endif - -bin_SCRIPTS = yaz-config - -lib_LTLIBRARIES = libyaz.la $(extra) $(ssllib) libyazmalloc.la - -# If the line below is omitted the LINK variable is -# not set in Makefile.in and it will NOT work .. -EXTRA_libyaz_la_SOURCES=x.c - -YAZ_VERSION_INFO=2:0:0 - -# No real sources -libyaz_la_SOURCES= -libyaz_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO) - -libyazthread_la_LIBADD=nmem.lo statserv.lo eventl.lo -libyazthread_la_SOURCES= -libyazthread_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO) - -libyazmalloc_la_LIBADD=xmalloc.lo -libyazmalloc_la_SOURCES= -libyazmalloc_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO) - -libyazssl_la_LIBADD=tcpip.lo comstack.lo -libyazssl_la_SOURCES= -libyazssl_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO) - -AM_CPPFLAGS= -I$(top_srcdir)/include -I$(top_srcdir)/server -THREADED_FLAGS = @CFLAGSTHREADS@ -XMALLOC_FLAGS = -DTRACE_XMALLOC=2 - -SSL_FLAGS= -I$(top_srcdir)/include $(SSL_DEFS) $(SSL_CFLAGS) - -nmem.lo: $(top_srcdir)/util/nmem.c - $(LTCOMPILE) $(THREADED_FLAGS) -c $(top_srcdir)/util/nmem.c - -nmem.o: $(top_srcdir)/util/nmem.c - $(COMPILE) $(THREADED_FLAGS) -c $(top_srcdir)/util/nmem.c - -statserv.lo: $(top_srcdir)/server/statserv.c - $(LTCOMPILE) $(THREADED_FLAGS) -c $(top_srcdir)/server/statserv.c - -statserv.o: $(top_srcdir)/server/statserv.c - $(COMPILE) $(THREADED_FLAGS) -c $(top_srcdir)/server/statserv.c - -eventl.lo: $(top_srcdir)/server/eventl.c - $(LTCOMPILE) $(THREADED_FLAGS) -c $(top_srcdir)/server/eventl.c - -eventl.o: $(top_srcdir)/server/eventl.c - $(COMPILE) $(THREADED_FLAGS) -c $(top_srcdir)/server/eventl.c - -xmalloc.lo: $(top_srcdir)/util/xmalloc.c - $(LTCOMPILE) $(XMALLOC_FLAGS) -c $(top_srcdir)/util/xmalloc.c - -xmalloc.o: $(top_srcdir)/util/xmalloc.c - $(COMPILE) $(XMALLOC_FLAGS) -c $(top_srcdir)/util/xmalloc.c - -comstack.lo: $(top_srcdir)/comstack/comstack.c - $(LTCOMPILE) $(SSL_FLAGS) -c $(top_srcdir)/comstack/comstack.c - -comstack.o: $(top_srcdir)/comstack/comstack.c - $(COMPILE) $(SSL_FLAGS) -c $(top_srcdir)/comstack/comstack.c - -tcpip.lo: $(top_srcdir)/comstack/tcpip.c - $(LTCOMPILE) $(SSL_FLAGS) -c $(top_srcdir)/comstack/tcpip.c - -tcpip.o: $(top_srcdir)/comstack/tcpip.c - $(COMPILE) $(SSL_FLAGS) -c $(top_srcdir)/comstack/tcpip.c - -libyaz_la_LIBADD=../odr/libodr.la \ - ../comstack/libcomstack.la ../server/libserver.la \ - ../util/libutil.la ../ccl/libccl.la ../cql/libcql.la ../zutil/libzutil.la \ - ../ill/libill.la ../z39.50/libz39.50.la - diff --git a/lib/x.c b/lib/x.c deleted file mode 100644 index e69de29..0000000 diff --git a/odr/.cvsignore b/odr/.cvsignore deleted file mode 100644 index 569ba57..0000000 --- a/odr/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -libodr.la -*.lo -tstodrcodec.c -tstodrcodec.h diff --git a/odr/Makefile.am b/odr/Makefile.am deleted file mode 100644 index 17b63e6..0000000 --- a/odr/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -## $Id: Makefile.am,v 1.11 2003-05-27 21:42:45 adam Exp $ - -noinst_LTLIBRARIES = libodr.la - -AM_CPPFLAGS=-I$(top_srcdir)/include - -TESTS = tstodr - -EXTRA_PROGRAMS = tstodr - -EXTRA_DIST = tstodrcodec.c tstodrcodec.h tstodr.asn - -tstodr_LDADD = libodr.la ../util/libutil.la -tstodr_SOURCES = tstodrcodec.c tstodrcodec.h tstodr.c - -# Rule for generating codecs for our small ASN.1 spec -tstodrcodec.c tstodrcodec.h: $(srcdir)/tstodr.asn $(top_srcdir)/util/yaz-asncomp - cd $(srcdir); $(top_srcdir)/util/yaz-asncomp tstodr.asn - -libodr_la_SOURCES = odr_bool.c ber_bool.c ber_len.c ber_tag.c odr_util.c \ - odr_null.c ber_null.c odr_int.c ber_int.c odr_tag.c odr_cons.c \ - odr_seq.c odr_oct.c ber_oct.c odr_bit.c ber_bit.c odr_oid.c \ - ber_oid.c odr_use.c odr_choice.c odr_any.c ber_any.c odr.c odr_mem.c \ - dumpber.c odr_enum.c odr-priv.h - diff --git a/odr/ber_any.c b/odr/ber_any.c deleted file mode 100644 index 73f8dfb..0000000 --- a/odr/ber_any.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * - * $Id: ber_any.c,v 1.27 2003-10-21 09:30:32 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include "odr-priv.h" - -int ber_any(ODR o, Odr_any **p) -{ - int res; - - switch (o->direction) - { - case ODR_DECODE: - if ((res = completeBER(o->bp, odr_max(o))) <= 0) /* FIX THIS */ - { - odr_seterror(o, OPROTO, 2); - return 0; - } - (*p)->buf = (unsigned char *)odr_malloc(o, res); - memcpy((*p)->buf, o->bp, res); - (*p)->len = (*p)->size = res; - o->bp += res; - return 1; - case ODR_ENCODE: - if (odr_write(o, (*p)->buf, (*p)->len) < 0) - return 0; - return 1; - default: odr_seterror(o, OOTHER, 3); return 0; - } -} - -#define BER_ANY_DEBUG 0 - -/* - * Return length of BER-package or 0. - */ -int completeBER_n(const unsigned char *buf, int len, int level) -{ - int res, ll, zclass, tag, cons; - const unsigned char *b = buf; - int bad = 0; - - if (len > 5000000 || level > 1000) - { - bad = 1; -#if BER_ANY_DEBUG - yaz_log(LOG_LOG, "completeBER lev=%d len=%d", level, len); -#endif - if (level > 1000) - return -2; - } - if (len < 2) - return 0; - if (!buf[0] && !buf[1]) - return -2; - if ((res = ber_dectag(b, &zclass, &tag, &cons, len)) <= 0) - return 0; -#if 0 -/* removed, since ber_dectag never reads that far .. */ - if (res > len) - return 0; -#endif - b += res; - len -= res; - assert (len >= 0); - res = ber_declen(b, &ll, len); - if (res == -2) - { -#if BER_ANY_DEBUG - if (bad) - yaz_log(LOG_LOG, "<<<<<<<<< return1 lev=%d res=%d", level, res); -#endif - return -1; /* error */ - } - if (res == -1) - { -#if BER_ANY_DEBUG - if (bad) - yaz_log(LOG_LOG, "<<<<<<<<< return3 lev=%d res=-1", level); -#endif - return 0; /* incomplete length */ - } - if (ll > 5000000) - { -#if BER_ANY_DEBUG - if (bad) - yaz_log(LOG_LOG, "<<<<<<<<< return2 lev=%d len=%d res=%d ll=%d", - level, len, res, ll); -#endif - return -1; /* error */ - } -#if 0 -/* no longer necessary, since ber_declen never reads that far (returns -1) */ - if (res > len) - { - if (bad) - yaz_log(LOG_LOG, "<<<<<<<<< return4 lev=%d res=%d len=%d", - level, res, len); - return 0; - } -#endif - b += res; - len -= res; - if (ll >= 0) - { /* definite length */ -#if BER_ANY_DEBUG - if (bad && len < ll) - yaz_log(LOG_LOG, "<<<<<<<<< return5 lev=%d len=%d ll=%d", - level, len, ll); -#endif - return (len >= ll ? ll + (b-buf) : 0); - } - /* indefinite length */ - if (!cons) - { /* if primitive, it's an error */ -#if BER_ANY_DEBUG - yaz_log(LOG_LOG, "<<<<<<<<< return6 lev=%d ll=%d len=%d res=%d", - level, ll, len, res); -#endif - return -1; /* error */ - } - /* constructed - cycle through children */ - while (len >= 2) - { - if (b[0] == 0 && b[1] == 0) - break; - if (!(res = completeBER_n(b, len, level+1))) - return 0; - if (res == -1) - return -1; - b += res; - len -= res; - } - if (len < 2) - return 0; - return (b - buf) + 2; -} - -int completeBER(const unsigned char *buf, int len) -{ - int res = completeBER_n(buf, len, 0); - if (res < 0) - return len; - return res; -} diff --git a/odr/ber_bit.c b/odr/ber_bit.c deleted file mode 100644 index d82e116..0000000 --- a/odr/ber_bit.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: ber_bit.c,v 1.16 2003-05-20 19:50:12 adam Exp $ - * - */ -#if HAVE_CONFIG_H -#include -#endif - -#include "odr-priv.h" - -int ber_bitstring(ODR o, Odr_bitmask *p, int cons) -{ - int res, len; - const unsigned char *base; - - switch (o->direction) - { - case ODR_DECODE: - if ((res = ber_declen(o->bp, &len, odr_max(o))) < 0) - { - odr_seterror(o, OPROTO, 4); - return 0; - } - o->bp += res; - if (cons) /* fetch component strings */ - { - base = o->bp; - while (odp_more_chunks(o, base, len)) - if (!odr_bitstring(o, &p, 0, 0)) - return 0; - return 1; - } - /* primitive bitstring */ - if (len < 0) - { - odr_seterror(o, OOTHER, 5); - return 0; - } - if (len == 0) - return 1; - if (len - 1 > ODR_BITMASK_SIZE) - { - odr_seterror(o, OOTHER, 6); - return 0; - } - if (len > odr_max(o)) - { - odr_seterror(o, OOTHER, 7); - return 0; - } - o->bp++; /* silently ignore the unused-bits field */ - len--; - memcpy(p->bits + p->top + 1, o->bp, len); - p->top += len; - o->bp += len; - return 1; - case ODR_ENCODE: - if ((res = ber_enclen(o, p->top + 2, 5, 0)) < 0) - return 0; - if (odr_putc(o, 0) < 0) /* no unused bits here */ - return 0; - if (p->top < 0) - return 1; - if (odr_write(o, p->bits, p->top + 1) < 0) - return 0; - return 1; - case ODR_PRINT: - return 1; - default: - odr_seterror(o, OOTHER, 8); - return 0; - } -} diff --git a/odr/ber_bool.c b/odr/ber_bool.c deleted file mode 100644 index 7ce8dc2..0000000 --- a/odr/ber_bool.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: ber_bool.c,v 1.14 2003-03-11 11:03:31 adam Exp $ - */ - -#if HAVE_CONFIG_H -#include -#endif - -#include -#include "odr-priv.h" - -int ber_boolean(ODR o, int *val) -{ - int res, len; - - switch (o->direction) - { - case ODR_ENCODE: - if (ber_enclen(o, 1, 1, 1) != 1) - return 0; - if (odr_putc(o, *val) < 0) - return 0; -#ifdef ODR_DEBUG - fprintf(stderr, "[val=%d]\n", *val); -#endif - return 1; - case ODR_DECODE: - if ((res = ber_declen(o->bp, &len, odr_max(o))) < 0) - { - odr_seterror(o, OPROTO, 9); - return 0; - } - o->bp+= res; - if (len != 1 || odr_max(o) < len) - { - odr_seterror(o, OPROTO, 10); - return 0; - } - *val = *o->bp; - o->bp++; -#ifdef ODR_DEBUG - fprintf(stderr, "[val=%d]\n", *val); -#endif - return 1; - case ODR_PRINT: - return 1; - default: odr_seterror(o, OOTHER, 11); return 0; - } -} diff --git a/odr/ber_int.c b/odr/ber_int.c deleted file mode 100644 index 21aa01f..0000000 --- a/odr/ber_int.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: ber_int.c,v 1.22 2003-03-11 11:03:31 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include - -#ifdef WIN32 -#include -#else -#include -#include -#endif - -#include "odr-priv.h" - -static int ber_encinteger(ODR o, int val); -static int ber_decinteger(const unsigned char *buf, int *val, int max); - -int ber_integer(ODR o, int *val) -{ - int res; - - switch (o->direction) - { - case ODR_DECODE: - if ((res = ber_decinteger(o->bp, val, odr_max(o))) <= 0) - { - odr_seterror(o, OPROTO, 50); - return 0; - } - o->bp += res; - return 1; - case ODR_ENCODE: - if ((res = ber_encinteger(o, *val)) < 0) - return 0; - return 1; - case ODR_PRINT: return 1; - default: odr_seterror(o, OOTHER, 51); return 0; - } -} - -/* - * Returns: number of bytes written or -1 for error (out of bounds). - */ -int ber_encinteger(ODR o, int val) -{ - int a, len; - union { int i; unsigned char c[sizeof(int)]; } tmp; - - tmp.i = htonl(val); /* ensure that that we're big-endian */ - for (a = 0; a < (int) sizeof(int) - 1; a++) /* skip superfluous octets */ - if (!((tmp.c[a] == 0 && !(tmp.c[a+1] & 0X80)) || - (tmp.c[a] == 0XFF && (tmp.c[a+1] & 0X80)))) - break; - len = sizeof(int) - a; - if (ber_enclen(o, len, 1, 1) != 1) - return -1; - if (odr_write(o, (unsigned char*) tmp.c + a, len) < 0) - return -1; -#ifdef ODR_DEBUG - fprintf(stderr, "[val=%d]", val); -#endif - return 0; -} - -/* - * Returns: Number of bytes read or 0 if no match, -1 if error. - */ -int ber_decinteger(const unsigned char *buf, int *val, int max) -{ - const unsigned char *b = buf; - unsigned char fill; - int res, len, remains; - union { int i; unsigned char c[sizeof(int)]; } tmp; - - if ((res = ber_declen(b, &len, max)) < 0) - return -1; - if (len+res > max || len < 0) /* out of bounds or indefinite encoding */ - return -1; - if (len > (int) sizeof(int)) /* let's be reasonable, here */ - return -1; - b+= res; - - remains = sizeof(int) - len; - memcpy(tmp.c + remains, b, len); - if (*b & 0X80) - fill = 0XFF; - else - fill = 0X00; - memset(tmp.c, fill, remains); - *val = ntohl(tmp.i); - - b += len; -#ifdef ODR_DEBUG - fprintf(stderr, "[val=%d]", *val); -#endif - return b - buf; -} diff --git a/odr/ber_len.c b/odr/ber_len.c deleted file mode 100644 index 2c76765..0000000 --- a/odr/ber_len.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (C) 1995-2003, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: ber_len.c,v 1.13 2003-10-20 13:44:05 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include "odr-priv.h" - -/* - * Encode BER length octets. If exact, lenlen is the exact desired - * encoding size, else, lenlen is the max available space. Len < 0 = - * Indefinite encoding. - * Returns: >0 success, number of bytes encoded. - * Returns: =0 success, indefinite start-marker set. 1 byte encoded. - * Returns: -1 failure, out of bounds. - */ -int ber_enclen(ODR o, int len, int lenlen, int exact) -{ - unsigned char octs[sizeof(int)]; - int n = 0; - int lenpos, end; - -#ifdef ODR_DEBUG - fprintf(stderr, "[len=%d]", len); -#endif - if (len < 0) /* Indefinite */ - { - if (odr_putc(o, 0x80) < 0) - return 0; -#ifdef ODR_DEBUG - fprintf(stderr, "[indefinite]"); -#endif - return 0; - } - if (len <= 127 && (lenlen == 1 || !exact)) /* definite short form */ - { - if (odr_putc(o, (unsigned char) len) < 0) - return 0; - return 1; - } - if (lenlen == 1) - { - if (odr_putc(o, 0x80) < 0) - return 0; - return 0; - } - /* definite long form */ - do - { - octs[n++] = len; - len >>= 8; - } - while (len); - if (n >= lenlen) - return -1; - lenpos = odr_tell(o); /* remember length-of-length position */ - if (odr_putc(o, 0) < 0) /* dummy */ - return 0; - if (exact) - while (n < --lenlen) /* pad length octets */ - if (odr_putc(o, 0) < 0) - return 0; - while (n--) - if (odr_putc(o, octs[n]) < 0) - return 0; - /* set length of length */ - end = odr_tell(o); - odr_seek(o, ODR_S_SET, lenpos); - if (odr_putc(o, (end - lenpos - 1) | 0X80) < 0) - return 0; - odr_seek(o, ODR_S_END, 0); - return odr_tell(o) - lenpos; -} - -/* - * Decode BER length octets. Returns - * > 0 : number of bytes read - * -1 : not enough room to read bytes within max bytes - * -2 : other error - * - * After return: - * len = -1 indefinite length. - * len >= 0 definite length - */ -int ber_declen(const unsigned char *buf, int *len, int max) -{ - const unsigned char *b = buf; - int n; - - if (max < 1) - return -1; - if (*b == 0X80) /* Indefinite */ - { - *len = -1; -#ifdef ODR_DEBUG - fprintf(stderr, "[len=%d]", *len); -#endif - return 1; - } - if (!(*b & 0X80)) /* Definite short form */ - { - *len = (int) *b; -#ifdef ODR_DEBUG - fprintf(stderr, "[len=%d]", *len); -#endif - return 1; - } - if (*b == 0XFF) /* reserved value */ - return -2; - /* indefinite long form */ - n = *b & 0X7F; - if (n >= max) - return -1; - *len = 0; - b++; - while (--n >= 0) - { - *len <<= 8; - *len |= *(b++); - } - if (*len < 0) - return -2; -#ifdef ODR_DEBUG - fprintf(stderr, "[len=%d]", *len); -#endif - return (b - buf); -} diff --git a/odr/ber_null.c b/odr/ber_null.c deleted file mode 100644 index 3b84a1d..0000000 --- a/odr/ber_null.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: ber_null.c,v 1.14 2003-03-11 11:03:31 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include "odr-priv.h" - -/* - * BER-en/decoder for NULL type. - */ -int ber_null(ODR o) -{ - switch (o->direction) - { - case ODR_ENCODE: - if (odr_putc(o, 0X00) < 0) - return 0; -#ifdef ODR_DEBUG - fprintf(stderr, "[NULL]\n"); -#endif - return 1; - case ODR_DECODE: - if (odr_max(o) < 1) - { - odr_seterror(o, OPROTO, 39); - return 0; - } - if (*(o->bp++) != 0X00) - { - odr_seterror(o, OPROTO, 12); - return 0; - } -#ifdef ODR_DEBUG - fprintf(stderr, "[NULL]\n"); -#endif - return 1; - case ODR_PRINT: return 1; - default: odr_seterror(o, OOTHER, 13); return 0; - } -} diff --git a/odr/ber_oct.c b/odr/ber_oct.c deleted file mode 100644 index a332846..0000000 --- a/odr/ber_oct.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: ber_oct.c,v 1.21 2003-03-11 11:03:31 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include "odr-priv.h" - -int ber_octetstring(ODR o, Odr_oct *p, int cons) -{ - int res, len; - const unsigned char *base; - unsigned char *c; - - switch (o->direction) - { - case ODR_DECODE: - if ((res = ber_declen(o->bp, &len, odr_max(o))) < 0) - { - odr_seterror(o, OPROTO, 14); - return 0; - } - o->bp += res; - if (cons) /* fetch component strings */ - { - base = o->bp; - while (odp_more_chunks(o, base, len)) - if (!odr_octetstring(o, &p, 0, 0)) - return 0; - return 1; - } - /* primitive octetstring */ - if (len < 0) - { - odr_seterror(o, OOTHER, 15); - return 0; - } - if (len > odr_max(o)) - { - odr_seterror(o, OOTHER, 16); - return 0; - } - if (len + 1 > p->size - p->len) - { - c = (unsigned char *)odr_malloc(o, p->size += len + 1); - if (p->len) - memcpy(c, p->buf, p->len); - p->buf = c; - } - if (len) - memcpy(p->buf + p->len, o->bp, len); - p->len += len; - o->bp += len; - /* the final null is really not part of the buffer, but */ - /* it helps somes applications that assumes C strings */ - if (len) - p->buf[p->len] = '\0'; - return 1; - case ODR_ENCODE: - if ((res = ber_enclen(o, p->len, 5, 0)) < 0) - return 0; - if (p->len == 0) - return 1; - if (odr_write(o, p->buf, p->len) < 0) - return 0; - return 1; - case ODR_PRINT: return 1; - default: odr_seterror(o, OOTHER, 17); return 0; - } -} diff --git a/odr/ber_oid.c b/odr/ber_oid.c deleted file mode 100644 index 905a482..0000000 --- a/odr/ber_oid.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: ber_oid.c,v 1.15 2003-03-11 11:03:31 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include "odr-priv.h" - -int ber_oidc(ODR o, Odr_oid *p) -{ - int len, lenp, end; - int pos, n, res, id; - unsigned char octs[8]; - - switch (o->direction) - { - case ODR_DECODE: - if ((res = ber_declen(o->bp, &len, odr_max(o))) < 1) - { - odr_seterror(o, OPROTO, 18); - return 0; - } - if (len < 0) - { - odr_seterror(o, OPROTO, 19); - return 0; - } - o->bp += res; - if (len == 0) - { - *p = -1; - return 1; - } - if (len > odr_max(o)) - { - odr_seterror(o, OPROTO, 20); - return 0; - } - p[0] = *o->bp / 40; - if (p[0] > 2) - p[0] = 2; - p[1] = *o->bp - p[0] * 40; - o->bp++; - pos = 2; - len--; - while (len) - { - p[pos] = 0; - do - { - if (!len) - { - odr_seterror(o, OPROTO, 21); - return 0; - } - p[pos] <<= 7; - p[pos] |= *o->bp & 0X7F; - len--; - } - while (*(o->bp++) & 0X80); - pos++; - } - p[pos] = -1; - return 1; - case ODR_ENCODE: - /* we'll allow ourselves the quiet luxury of only doing encodings - shorter than 127 */ - lenp = odr_tell(o); - if (odr_putc(o, 0) < 0) /* dummy */ - return 0; - if (p[0] < 0 && p[1] <= 0) - { - odr_seterror(o, ODATA, 23); - return 0; - } - for (pos = 1; p[pos] >= 0; pos++) - { - id = pos > 1 ? p[pos] : p[0] * 40 + p[1]; - n = 0; - do - { - octs[n++] = id & 0X7F; - id >>= 7; - } - while (id); - while (n--) - { - unsigned char p; - - p = octs[n] | ((n > 0) << 7); - if (odr_putc(o, p) < 0) - return 0; - } - } - end = odr_tell(o); - odr_seek(o, ODR_S_SET, lenp); - if (ber_enclen(o, (end - lenp) - 1, 1, 1) != 1) - { - odr_seterror(o, OOTHER, 52); - return 0; - } - odr_seek(o, ODR_S_END, 0); - return 1; - default: - odr_seterror(o, OOTHER, 22); - return 0; - } -} diff --git a/odr/ber_tag.c b/odr/ber_tag.c deleted file mode 100644 index 98b8a95..0000000 --- a/odr/ber_tag.c +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: ber_tag.c,v 1.27 2003-05-24 19:20:14 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include "odr-priv.h" - -/* ber_tag - * On encoding: - * if p: write tag. return 1 (success) or -1 (error). - * if !p: return 0. - * On decoding: - * if tag && zclass match up, advance pointer and return 1. set cons. - * else leave pointer unchanged. Return 0. - * - * Should perhaps be odr_tag? - */ -int ber_tag(ODR o, void *p, int zclass, int tag, int *constructed, int opt, - const char *name) -{ - struct Odr_ber_tag *odr_ber_tag = &o->op->odr_ber_tag; - int rd; - char **pp = (char **)p; - - if (o->direction == ODR_DECODE) - *pp = 0; - o->t_class = -1; - if (o->op->stackp < 0) - { - odr_seek(o, ODR_S_SET, 0); - o->top = 0; - o->bp = o->buf; - odr_ber_tag->lclass = -1; - } - switch (o->direction) - { - case ODR_ENCODE: - if (!*pp) - { - if (!opt) - { - odr_seterror(o, OREQUIRED, 24); - odr_setelement (o, name); - } - return 0; - } - if ((rd = ber_enctag(o, zclass, tag, *constructed)) < 0) - return -1; -#ifdef ODR_DEBUG - fprintf(stderr, "\n[class=%d,tag=%d,cons=%d,stackp=%d]", zclass, tag, - *constructed, o->stackp); -#endif - return 1; - - case ODR_DECODE: - if (o->op->stackp > -1 && !odr_constructed_more(o)) - { - if (!opt) - { - odr_seterror(o, OREQUIRED, 25); - odr_setelement(o, name); - } - return 0; - } - if (odr_ber_tag->lclass < 0) - { - if ((odr_ber_tag->br = - ber_dectag(o->bp, &odr_ber_tag->lclass, - &odr_ber_tag->ltag, &odr_ber_tag->lcons, - odr_max(o))) <= 0) - { - odr_seterror(o, OPROTO, 26); - odr_setelement(o, name); - return 0; - } -#ifdef ODR_DEBUG - fprintf(stderr, - "\n[class=%d,tag=%d,cons=%d,stackp=%d]", - odr_ber_tag->lclass, odr_ber_tag->ltag, - odr_ber_tag->lcons, o->stackp); -#endif - } - if (zclass == odr_ber_tag->lclass && tag == odr_ber_tag->ltag) - { - o->bp += odr_ber_tag->br; - *constructed = odr_ber_tag->lcons; - odr_ber_tag->lclass = -1; - return 1; - } - else - { - if (!opt) - { - odr_seterror(o, OREQUIRED, 27); - odr_setelement(o, name); - } - return 0; - } - case ODR_PRINT: - if (!*pp && !opt) - { - odr_seterror(o,OREQUIRED, 28); - odr_setelement(o, name); - } - return *pp != 0; - default: - odr_seterror(o, OOTHER, 29); - odr_setelement(o, name); - return 0; - } -} - -/* ber_enctag - * BER-encode a zclass/tag/constructed package (identifier octets). Return - * number of bytes encoded, or -1 if out of bounds. - */ -int ber_enctag(ODR o, int zclass, int tag, int constructed) -{ - int cons = (constructed ? 1 : 0), n = 0; - unsigned char octs[sizeof(int)], b; - - b = (zclass << 6) & 0XC0; - b |= (cons << 5) & 0X20; - if (tag <= 30) - { - b |= tag & 0X1F; - if (odr_putc(o, b) < 0) - return -1; - return 1; - } - else - { - b |= 0X1F; - if (odr_putc(o, b) < 0) - return -1; - do - { - octs[n++] = tag & 0X7F; - tag >>= 7; - } - while (tag); - while (n--) - { - unsigned char oo; - - oo = octs[n] | ((n > 0) << 7); - if (odr_putc(o, oo) < 0) - return -1; - } - return 0; - } -} - -/* ber_dectag - * Decode BER identifier octets. Return number of bytes read or -1 for error. - */ -int ber_dectag(const unsigned char *b, int *zclass, int *tag, - int *constructed, int max) -{ - int l = 1; - - if (l > max) - return -1; - - *zclass = *b >> 6; - *constructed = (*b >> 5) & 0X01; - if ((*tag = *b & 0x1F) <= 30) - return 1; - *tag = 0; - do - { - if (l >= max) - return -1; - *tag <<= 7; - *tag |= b[l] & 0X7F; - } - while (b[l++] & 0X80); - return l; -} diff --git a/odr/dumpber.c b/odr/dumpber.c deleted file mode 100644 index b332f9a..0000000 --- a/odr/dumpber.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: dumpber.c,v 1.16 2003-04-24 12:48:47 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include "odr-priv.h" - -static int do_dumpBER(FILE *f, const char *buf, int len, int level, int offset) -{ - int res, ll, zclass, tag, cons, lenlen, taglen; - const char *b = buf, *bp = buf; - - if (!len) - return 0; - if (!buf[0] && !buf[1]) - return 0; - if ((res = ber_dectag((unsigned char*)b, &zclass, &tag, &cons, len)) <= 0) - return 0; - if (res > len) - { - fprintf(stderr, "Unexpected end of buffer\n"); - return 0; - } - fprintf(f, "%5d: %*s", offset, level * 4, ""); - if (zclass == ODR_UNIVERSAL) - { - static char *nl[] = - { - "[Univ 0]", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING", - "NULL", "OID", "OBJECT DESCIPTOR", "EXTERNAL", "REAL", - "ENUM", "[UNIV 11]", "[UNIV 12]", "[UNIV 13]", "[UNIV 14]", - "[UNIV 15]", "SEQUENCE", "SET", "NUMERICSTRING", "PRINTABLESTRING", - "[UNIV 20]", "[UNIV 21]", "[UNIV 22]", "[UNIV 23]", "[UNIV 24]", - "GRAPHICSTRING", "VISIBLESTRING", "GENERALSTRING", "[UNIV 28]" - }; - - if (tag >= 0 && tag < 28) - fprintf(f, "%s", nl[tag]); - else - fprintf(f, "[UNIV %d]", tag); - } - else if (zclass == ODR_CONTEXT) - fprintf(f, "[%d]", tag); - else - fprintf(f, "[%d:%d]", zclass, tag); - b += res; - taglen = res; - len -= res; - bp = b; - if ((res = ber_declen((unsigned char*)b, &ll, len)) <= 0) - { - fprintf(f, "\n%*sBad length\n", level*4+5, ""); - return 0; - } - lenlen = res; - b += res; - len -= res; - if (ll >= 0) - fprintf(f, " len=%d", ll); - else - fprintf(f, " len=?"); - fprintf(f, " tl=%d, ll=%d cons=%d\n", taglen, lenlen, cons); - if (!cons) - { - if (ll < 0 || ll > len) - { - fprintf(f, "%*sBad length on primitive type. ll=%d len=%d\n", - level*4+5, "", ll, len); - return 0; - } - return ll + (b - buf); - } - if (ll >= 0) - { - if (ll > len) - { - fprintf(f, "%*sBad length of constructed type ll=%d len=%d.\n", - level*4+5, "", ll, len); - return 0; - } - len = ll; - } - /* constructed - cycle through children */ - while ((ll == -1 && len >= 2) || (ll >= 0 && len)) - { - if (ll == -1 && *b == 0 && *(b + 1) == 0) - break; - if (!(res = do_dumpBER(f, b, len, level + 1, offset + (b - buf)))) - { - fprintf(f, "%*sDump of content element failed.\n", level*4+5, ""); - return 0; - } - b += res; - len -= res; - if (len < 0) - { - fprintf(f, "%*sBad length\n", level*4+5, ""); - return 0; - } - } - if (ll == -1) - { - if (len < 2) - { - fprintf(f, "%*sBuffer too short in indefinite length.\n", - level*4+5, ""); - return 0; - } - return (b - buf) + 2; - } - return b - buf; -} - -int odr_dumpBER(FILE *f, const char *buf, int len) -{ - return do_dumpBER(f, buf, len, 0, 0); -} diff --git a/odr/odr-priv.h b/odr/odr-priv.h deleted file mode 100644 index 80366c3..0000000 --- a/odr/odr-priv.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation, in whole or in part, for any purpose, is hereby granted, - * provided that: - * - * 1. This copyright and permission notice appear in all copies of the - * software and its documentation. Notices of copyright or attribution - * which appear at the beginning of any file must remain unchanged. - * - * 2. The name of Index Data or the individual authors may not be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR - * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - * $Id: odr-priv.h,v 1.6 2003-05-24 19:20:14 adam Exp $ - */ - -#ifndef ODR_PRIV_H - -#define ODR_PRIV_H - -#include -#include - -struct Odr_ber_tag { /* used to be statics in ber_tag... */ - int lclass; - int ltag; - int br; - int lcons; -}; - -#define odr_max(o) ((o)->size - ((o)->bp - (o)->buf)) -#define odr_offset(o) ((o)->bp - (o)->buf) - -struct Odr_private { - /* stack for constructed types */ -#define ODR_MAX_STACK 50 - int stackp; /* top of stack (-1 == initial state) */ - odr_constack stack[ODR_MAX_STACK]; - - struct Odr_ber_tag odr_ber_tag; - yaz_iconv_t iconv_handle; - int error_id; - char element[80]; -}; - -/* Private macro. - * write a single character at the current position - grow buffer if - * necessary. - * (no, we're not usually this anal about our macros, but this baby is - * next to unreadable without some indentation :) - */ -#define odr_putc(o, c) \ -( \ - ( \ - (o)->pos < (o)->size ? \ - ( \ - (o)->buf[(o)->pos++] = (c), \ - 0 \ - ) : \ - ( \ - odr_grow_block((o), 1) == 0 ? \ - ( \ - (o)->buf[(o)->pos++] = (c), \ - 0 \ - ) : \ - ( \ - (o)->error = OSPACE, \ - -1 \ - ) \ - ) \ - ) == 0 ? \ - ( \ - (o)->pos > (o)->top ? \ - ( \ - (o)->top = (o)->pos, \ - 0 \ - ) : \ - 0 \ - ) : \ - -1 \ -) - -#endif diff --git a/odr/odr.c b/odr/odr.c deleted file mode 100644 index aaaec46..0000000 --- a/odr/odr.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * - * $Id: odr.c,v 1.46 2003-10-16 10:37:06 adam Exp $ - * - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include - -#include -#include "odr-priv.h" - -Odr_null *ODR_NULLVAL = (Odr_null *) "NULL"; /* the presence of a null value */ - -Odr_null *odr_nullval (void) -{ - return ODR_NULLVAL; -} - -char *odr_errlist[] = -{ - "No (unknown) error", - "Memory allocation failed", - "System error", - "No space in buffer", - "Required data element missing", - "Unexpected tag", - "Other error", - "Protocol error", - "Malformed data", - "Stack overflow", - "Length of constructed type different from sum of members", - "Overflow writing definite length of constructed type", - "Bad HTTP Request" -}; - -char *odr_errmsg(int n) -{ - return odr_errlist[n]; -} - -void odr_perror(ODR o, const char *message) -{ - const char *e = odr_getelement(o); - int err, x; - - err = odr_geterrorx(o, &x); - fprintf(stderr, "%s: %s (code %d:%d)", message, odr_errlist[err], err, x); - if (e && *e) - fprintf (stderr, " element %s", e); - fprintf(stderr, "\n"); -} - -int odr_geterror(ODR o) -{ - return o->error; -} - -int odr_geterrorx(ODR o, int *x) -{ - if (x) - *x = o->op->error_id; - return o->error; -} - -char *odr_getelement(ODR o) -{ - return o->op->element; -} - -void odr_seterror(ODR o, int error, int id) -{ - o->error = error; - o->op->error_id = id; - o->op->element[0] = '\0'; -} - -void odr_setelement(ODR o, const char *element) -{ - if (element) - { - strncpy(o->op->element, element, sizeof(o->op->element)-1); - o->op->element[sizeof(o->op->element)-1] = '\0'; - } -} - -void odr_setprint(ODR o, FILE *file) -{ - o->print = file; -} - -int odr_set_charset(ODR o, const char *to, const char *from) -{ - if (o->op->iconv_handle) - yaz_iconv_close (o->op->iconv_handle); - o->op->iconv_handle = 0; - if (to && from) - { - o->op->iconv_handle = yaz_iconv_open (to, from); - if (o->op->iconv_handle == 0) - return -1; - } - return 0; -} - -#include - -ODR odr_createmem(int direction) -{ - ODR r; - - if (!(r = (ODR)xmalloc(sizeof(*r)))) - return 0; - r->direction = direction; - r->print = stderr; - r->buf = 0; - r->size = r->pos = r->top = 0; - r->can_grow = 1; - r->mem = nmem_create(); - r->enable_bias = 1; - r->op = (struct Odr_private *) xmalloc (sizeof(*r->op)); - r->op->odr_ber_tag.lclass = -1; - r->op->iconv_handle = 0; - odr_reset(r); - yaz_log (LOG_DEBUG, "odr_createmem dir=%d o=%p", direction, r); - return r; -} - -void odr_reset(ODR o) -{ - odr_seterror(o, ONONE, 0); - o->bp = o->buf; - odr_seek(o, ODR_S_SET, 0); - o->top = 0; - o->t_class = -1; - o->t_tag = -1; - o->indent = 0; - o->op->stackp = -1; - nmem_reset(o->mem); - o->choice_bias = -1; - o->lenlen = 1; - if (o->op->iconv_handle != 0) - yaz_iconv(o->op->iconv_handle, 0, 0, 0, 0); - yaz_log (LOG_DEBUG, "odr_reset o=%p", o); -} - -void odr_destroy(ODR o) -{ - nmem_destroy(o->mem); - if (o->buf && o->can_grow) - xfree(o->buf); - if (o->print && o->print != stderr) - fclose(o->print); - if (o->op->iconv_handle != 0) - yaz_iconv_close (o->op->iconv_handle); - xfree(o->op); - xfree(o); - yaz_log (LOG_DEBUG, "odr_destroy o=%p", o); -} - -void odr_setbuf(ODR o, char *buf, int len, int can_grow) -{ - o->bp = (unsigned char *) buf; - - o->buf = (unsigned char *) buf; - o->can_grow = can_grow; - o->top = o->pos = 0; - o->size = len; -} - -char *odr_getbuf(ODR o, int *len, int *size) -{ - *len = o->top; - if (size) - *size = o->size; - return (char*) o->buf; -} - diff --git a/odr/odr_any.c b/odr/odr_any.c deleted file mode 100644 index e464872..0000000 --- a/odr/odr_any.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: odr_any.c,v 1.14 2003-05-20 19:55:30 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include "odr-priv.h" - -/* - * This is a catch-all type. It stuffs a random ostring (assumed to be properly - * encoded) into the stream, or reads a full data element. Implicit tagging - * does not work, and neither does the optional flag, unless the element - * is the last in a sequence. - */ -int odr_any(ODR o, Odr_any **p, int opt, const char *name) -{ - if (o->error) - return 0; - if (o->direction == ODR_PRINT) - { - odr_prname(o, name); - fprintf(o->print, "ANY (len=%d)\n", (*p)->len); - return 1; - } - if (o->direction == ODR_DECODE) - *p = (Odr_oct *)odr_malloc(o, sizeof(**p)); - if (ber_any(o, p)) - return 1; - *p = 0; - return odr_missing(o, opt, name); -} diff --git a/odr/odr_bit.c b/odr/odr_bit.c deleted file mode 100644 index 07d0647..0000000 --- a/odr/odr_bit.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: odr_bit.c,v 1.18 2003-05-20 19:55:30 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include "odr-priv.h" - -/* - * Top level bitstring string en/decoder. - * Returns 1 on success, 0 on error. - */ -int odr_bitstring(ODR o, Odr_bitmask **p, int opt, const char *name) -{ - int res, cons = 0; - - if (o->error) - return 0; - if (o->t_class < 0) - { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_BITSTRING; - } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) - return 0; - if (!res) - return odr_missing(o, opt, name); - if (o->direction == ODR_PRINT) - { - odr_prname(o, name); - fprintf(o->print, "BITSTRING(len=%d)\n",(*p)->top + 1); - return 1; - } - if (o->direction == ODR_DECODE) - { - *p = (Odr_bitmask *)odr_malloc(o, sizeof(Odr_bitmask)); - memset((*p)->bits, 0, ODR_BITMASK_SIZE); - (*p)->top = -1; - } -#if 0 - /* ignoring the cons helps with at least one target. - * http://bugzilla.indexdata.dk/cgi-bin/bugzilla/show_bug.cgi?id=24 - */ - return ber_bitstring(o, *p, 0); -#else - return ber_bitstring(o, *p, cons); -#endif -} diff --git a/odr/odr_bool.c b/odr/odr_bool.c deleted file mode 100644 index 9ad56a8..0000000 --- a/odr/odr_bool.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: odr_bool.c,v 1.15 2003-05-20 19:55:30 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include "odr-priv.h" - -/* - * Top level boolean en/decoder. - * Returns 1 on success, 0 on error. - */ -int odr_bool(ODR o, int **p, int opt, const char *name) -{ - int res, cons = 0; - - if (o->error) - return 0; - if (o->t_class < 0) - { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_BOOLEAN; - } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) - return 0; - if (!res) - return odr_missing(o, opt, name); - if (o->direction == ODR_PRINT) - { - odr_prname(o, name); - fprintf(o->print, "%s\n", (**p ? "TRUE" : "FALSE")); - return 1; - } - if (cons) - return 0; - if (o->direction == ODR_DECODE) - *p = (int *)odr_malloc(o, sizeof(int)); - return ber_boolean(o, *p); -} diff --git a/odr/odr_choice.c b/odr/odr_choice.c deleted file mode 100644 index 51f6b2f..0000000 --- a/odr/odr_choice.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: odr_choice.c,v 1.22 2003-03-11 11:03:31 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include "odr-priv.h" - -int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, - const char *name) -{ - int i, cl = -1, tg, cn, *which = (int *)whichp, bias = o->choice_bias; - - if (o->error) - return 0; - if (o->direction != ODR_DECODE && !*(char**)p) - return 0; - - if (o->direction == ODR_DECODE) - { - *which = -1; - *(char**)p = 0; - } - o->choice_bias = -1; - - if (o->direction == ODR_PRINT) - { - if (name) - { - odr_prname(o, name); - fprintf (o->print, "choice\n"); - } - } - for (i = 0; arm[i].fun; i++) - { - if (o->direction == ODR_DECODE) - { - if (bias >= 0 && bias != arm[i].which) - continue; - *which = arm[i].which; - } - else if (*which != arm[i].which) - continue; - - if (arm[i].tagmode != ODR_NONE) - { - if (o->direction == ODR_DECODE && cl < 0) - { - if (o->op->stackp > -1 && !odr_constructed_more(o)) - return 0; - if (ber_dectag(o->bp, &cl, &tg, &cn, odr_max(o)) <= 0) - return 0; - } - else if (o->direction != ODR_DECODE) - { - cl = arm[i].zclass; - tg = arm[i].tag; - } - if (tg == arm[i].tag && cl == arm[i].zclass) - { - if (arm[i].tagmode == ODR_IMPLICIT) - { - odr_implicit_settag(o, cl, tg); - return (*arm[i].fun)(o, (char **)p, 0, arm[i].name); - } - /* explicit */ - if (!odr_constructed_begin(o, p, cl, tg, 0)) - return 0; - return (*arm[i].fun)(o, (char **)p, 0, arm[i].name) && - odr_constructed_end(o); - } - } - else /* no tagging. Have to poll type */ - { - if ((*arm[i].fun)(o, (char **)p, 1, arm[i].name) && *(char**)p) - return 1; - } - } - return 0; -} - -void odr_choice_bias(ODR o, int what) -{ - if (o->enable_bias) - o->choice_bias = what; -} - -void odr_choice_enable_bias (ODR o, int mode) -{ - o->enable_bias = mode; -} diff --git a/odr/odr_cons.c b/odr/odr_cons.c deleted file mode 100644 index 1521343..0000000 --- a/odr/odr_cons.c +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * - * $Id: odr_cons.c,v 1.26 2003-05-20 19:55:30 adam Exp $ - * - */ -#if HAVE_CONFIG_H -#include -#endif - -#include "odr-priv.h" - -void odr_setlenlen(ODR o, int len) -{ - o->lenlen = len; -} - -int odr_constructed_begin(ODR o, void *p, int zclass, int tag, - const char *name) -{ - int res; - int cons = 1; - int lenlen = o->lenlen; - - if (o->error) - return 0; - o->lenlen = 1; /* reset lenlen */ - if (o->t_class < 0) - { - o->t_class = zclass; - o->t_tag = tag; - } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, 1, name)) < 0) - return 0; - if (!res || !cons) - return 0; - - if (o->op->stackp == ODR_MAX_STACK - 1) - { - odr_seterror(o, OSTACK, 30); - return 0; - } - o->op->stack[++(o->op->stackp)].lenb = o->bp; - o->op->stack[o->op->stackp].len_offset = odr_tell(o); -#ifdef ODR_DEBUG - fprintf(stderr, "[cons_begin(%d)]", o->op->stackp); -#endif - if (o->direction == ODR_ENCODE) - { - static unsigned char dummy[sizeof(int)+1]; - - o->op->stack[o->op->stackp].lenlen = lenlen; - - if (odr_write(o, dummy, lenlen) < 0) /* dummy */ - { - --(o->op->stackp); - return 0; - } - } - else if (o->direction == ODR_DECODE) - { - if ((res = ber_declen(o->bp, &o->op->stack[o->op->stackp].len, - odr_max(o))) < 0) - { - odr_seterror(o, OOTHER, 31); - --(o->op->stackp); - return 0; - } - o->op->stack[o->op->stackp].lenlen = res; - o->bp += res; - if (o->op->stack[o->op->stackp].len > odr_max(o)) - { - odr_seterror(o, OOTHER, 32); - --(o->op->stackp); - return 0; - } - } - else if (o->direction == ODR_PRINT) - { - odr_prname(o, name); - fprintf(o->print, "{\n"); - o->indent++; - } - else - { - odr_seterror(o, OOTHER, 33); - --(o->op->stackp); - return 0; - } - o->op->stack[o->op->stackp].base = o->bp; - o->op->stack[o->op->stackp].base_offset = odr_tell(o); - return 1; -} - -int odr_constructed_more(ODR o) -{ - if (o->error) - return 0; - if (o->op->stackp < 0) - return 0; - if (o->op->stack[o->op->stackp].len >= 0) - return o->bp - o->op->stack[o->op->stackp].base < o->op->stack[o->op->stackp].len; - else - return (!(*o->bp == 0 && *(o->bp + 1) == 0)); -} - -int odr_constructed_end(ODR o) -{ - int res; - int pos; - - if (o->error) - return 0; - if (o->op->stackp < 0) - { - odr_seterror(o, OOTHER, 34); - return 0; - } - switch (o->direction) - { - case ODR_DECODE: - if (o->op->stack[o->op->stackp].len < 0) - { - if (*o->bp++ == 0 && *(o->bp++) == 0) - { - o->op->stackp--; - return 1; - } - else - { - odr_seterror(o, OOTHER, 35); - return 0; - } - } - else if (o->bp - o->op->stack[o->op->stackp].base != - o->op->stack[o->op->stackp].len) - { - odr_seterror(o, OCONLEN, 36); - return 0; - } - o->op->stackp--; - return 1; - case ODR_ENCODE: - pos = odr_tell(o); - odr_seek(o, ODR_S_SET, o->op->stack[o->op->stackp].len_offset); - if ((res = ber_enclen(o, pos - o->op->stack[o->op->stackp].base_offset, - o->op->stack[o->op->stackp].lenlen, 1)) < 0) - { - odr_seterror(o, OLENOV, 37); - return 0; - } - odr_seek(o, ODR_S_END, 0); - if (res == 0) /* indefinite encoding */ - { -#ifdef ODR_DEBUG - fprintf(stderr, "[cons_end(%d): indefinite]", o->op->stackp); -#endif - if (odr_putc(o, 0) < 0 || odr_putc(o, 0) < 0) - return 0; - } -#ifdef ODR_DEBUG - else - { - fprintf(stderr, "[cons_end(%d): definite]", o->op->stackp); - } -#endif - o->op->stackp--; - return 1; - case ODR_PRINT: - o->op->stackp--; - o->indent--; - odr_prname(o, 0); - fprintf(o->print, "}\n"); - return 1; - default: - odr_seterror(o, OOTHER, 38); - return 0; - } -} diff --git a/odr/odr_enum.c b/odr/odr_enum.c deleted file mode 100644 index 22c20d8..0000000 --- a/odr/odr_enum.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: odr_enum.c,v 1.9 2003-05-20 19:55:30 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include "odr-priv.h" - -/* - * Top level enum en/decoder. - * Returns 1 on success, 0 on error. - */ -int odr_enum(ODR o, int **p, int opt, const char *name) -{ - int res, cons = 0; - - if (o->error) - return 0; - if (o->t_class < 0) - { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_ENUM; - } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) - return 0; - if (!res) - return odr_missing(o, opt, name); - if (o->direction == ODR_PRINT) - { - odr_prname(o, name); - fprintf(o->print, "%d\n", **p); - return 1; - } - if (cons) - { - odr_seterror(o, OPROTO, 54); - return 0; - } - if (o->direction == ODR_DECODE) - *p = (int *)odr_malloc(o, sizeof(int)); - return ber_integer(o, *p); -} diff --git a/odr/odr_int.c b/odr/odr_int.c deleted file mode 100644 index a685761..0000000 --- a/odr/odr_int.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: odr_int.c,v 1.19 2003-05-20 19:55:30 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include "odr-priv.h" - -/* - * Top level integer en/decoder. - * Returns 1 on success, 0 on error. - */ -int odr_integer(ODR o, int **p, int opt, const char *name) -{ - int res, cons = 0; - - if (o->error) - return 0; - if (o->t_class < 0) - { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_INTEGER; - } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) - return 0; - if (!res) - return odr_missing(o, opt, name); - if (o->direction == ODR_PRINT) - { - odr_prname(o, name); - fprintf(o->print, "%d\n", **p); - return 1; - } - if (cons) - { - odr_seterror(o, OPROTO, 1); - return 0; - } - if (o->direction == ODR_DECODE) - *p = (int *)odr_malloc(o, sizeof(int)); - return ber_integer(o, *p); -} diff --git a/odr/odr_mem.c b/odr/odr_mem.c deleted file mode 100644 index 2ec348a..0000000 --- a/odr/odr_mem.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * - * $Id: odr_mem.c,v 1.23 2003-03-18 13:34:35 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include "odr-priv.h" -#include - -/* ------------------------ NIBBLE MEMORY ---------------------- */ - -/* - * Extract the memory control block from o. - */ -NMEM odr_extract_mem(ODR o) -{ - NMEM r = o->mem; - - o->mem = 0; - return r; -} - -void *odr_malloc(ODR o, int size) -{ - if (o && !o->mem) - o->mem = nmem_create(); - return nmem_malloc(o ? o->mem : 0, size); -} - -char *odr_strdup(ODR o, const char *str) -{ - return nmem_strdup(o->mem, str); -} - -char *odr_strdupn(ODR o, const char *str, size_t n) -{ - return nmem_strdupn(o->mem, str, n); -} - -int *odr_intdup(ODR o, int v) -{ - return nmem_intdup(o->mem, v); -} - -int odr_total(ODR o) -{ - return o->mem ? nmem_total(o->mem) : 0; -} - -/* ---------- memory management for data encoding ----------*/ - - -int odr_grow_block(ODR b, int min_bytes) -{ - int togrow; - - if (!b->can_grow) - return -1; - if (!b->size) - togrow = 1024; - else - togrow = b->size; - if (togrow < min_bytes) - togrow = min_bytes; - if (b->size && !(b->buf = - (unsigned char *) xrealloc(b->buf, b->size += togrow))) - abort(); - else if (!b->size && !(b->buf = (unsigned char *) - xmalloc(b->size = togrow))) - abort(); -#ifdef ODR_DEBUG - fprintf(stderr, "New size for encode_buffer: %d\n", b->size); -#endif - return 0; -} - -int odr_write(ODR o, unsigned char *buf, int bytes) -{ - if (o->pos + bytes >= o->size && odr_grow_block(o, bytes)) - { - odr_seterror(o, OSPACE, 40); - return -1; - } - memcpy(o->buf + o->pos, buf, bytes); - o->pos += bytes; - if (o->pos > o->top) - o->top = o->pos; - return 0; -} - -int odr_seek(ODR o, int whence, int offset) -{ - if (whence == ODR_S_CUR) - offset += o->pos; - else if (whence == ODR_S_END) - offset += o->top; - if (offset > o->size && odr_grow_block(o, offset - o->size)) - { - odr_seterror(o, OSPACE, 41); - return -1; - } - o->pos = offset; - return 0; -} diff --git a/odr/odr_null.c b/odr/odr_null.c deleted file mode 100644 index 8e7d85d..0000000 --- a/odr/odr_null.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: odr_null.c,v 1.17 2003-05-20 19:55:30 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include "odr-priv.h" - -/* - * Top level null en/decoder. - * Returns 1 on success, 0 on error. - */ -int odr_null(ODR o, Odr_null **p, int opt, const char *name) -{ - int res, cons = 0; - - if (o->error) - return 0; - if (o->t_class < 0) - { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_NULL; - } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) - return 0; - if (!res) - return odr_missing(o, opt, name); - if (o->direction == ODR_PRINT) - { - odr_prname(o, name); - fprintf(o->print, "NULL\n"); - return 1; - } - if (cons) - { -#ifdef ODR_STRICT_NULL - odr_seterror(OPROTO, 42); - return 0; -#else - fprintf(stderr, "odr: Warning: Bad NULL\n"); -#endif - } - if (o->direction == ODR_DECODE) - *p = odr_nullval(); - return ber_null(o); -} diff --git a/odr/odr_oct.c b/odr/odr_oct.c deleted file mode 100644 index c0458dd..0000000 --- a/odr/odr_oct.c +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: odr_oct.c,v 1.22 2003-05-20 19:55:30 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include "odr-priv.h" - -/* - * Top level octet string en/decoder. - * Returns 1 on success, 0 on error. - */ -int odr_octetstring(ODR o, Odr_oct **p, int opt, const char *name) -{ - int res, cons = 0; - - if (o->error) - return 0; - if (o->t_class < 0) - { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_OCTETSTRING; - } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) - return 0; - if (!res) - return odr_missing(o, opt, name); - if (o->direction == ODR_PRINT) - { - int i; - odr_prname(o, name); - fprintf(o->print, "OCTETSTRING(len=%d)", (*p)->len); - for (i = 0; i<(*p)->len; i++) - { - if (i < 5 || i > ((*p)->len - 4)) - { - fprintf (o->print, " %02X", (*p)->buf[i]); - } - else if (i == 5) - fprintf (o->print, " .. "); - } - fprintf(o->print, "\n"); - return 1; - } - if (o->direction == ODR_DECODE) - { - *p = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct)); - (*p)->size= 0; - (*p)->len = 0; - (*p)->buf = 0; - } - if (ber_octetstring(o, *p, cons)) - return 1; - odr_seterror(o, OOTHER, 43); - return 0; -} - -/* - * Friendlier interface to octetstring. - */ -int odr_cstring(ODR o, char **p, int opt, const char *name) -{ - int cons = 0, res; - Odr_oct *t; - - if (o->error) - return 0; - if (o->t_class < 0) - { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_OCTETSTRING; - } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) - return 0; - if (!res) - return odr_missing(o, opt, name); - if (o->direction == ODR_PRINT) - { - odr_prname(o, name); - fprintf(o->print, "'%s'\n", *p); - return 1; - } - t = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct)); /* wrapper for octstring */ - if (o->direction == ODR_ENCODE) - { - t->buf = (unsigned char *) *p; - t->size = t->len = strlen(*p); - } - else - { - t->size= 0; - t->len = 0; - t->buf = 0; - } - if (!ber_octetstring(o, t, cons)) - return 0; - if (o->direction == ODR_DECODE) - { - *p = (char *) t->buf; - *(*p + t->len) = '\0'; /* ber_octs reserves space for this */ - } - return 1; -} - -/* - * iconv interface to octetstring. - */ -int odr_iconv_string(ODR o, char **p, int opt, const char *name) -{ - int cons = 0, res; - Odr_oct *t; - - if (o->error) - return 0; - if (o->t_class < 0) - { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_OCTETSTRING; - } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) - return 0; - if (!res) - return odr_missing(o, opt, name); - if (o->direction == ODR_PRINT) - { - odr_prname(o, name); - fprintf(o->print, "'%s'\n", *p); - return 1; - } - t = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct)); /* wrapper for octstring */ - if (o->direction == ODR_ENCODE) - { - t->buf = 0; - - if (o->op->iconv_handle != 0) - { - size_t inleft = strlen(*p); - char *inbuf = *p; - size_t outleft = 4 * inleft + 2; - char *outbuf = (char *) odr_malloc (o, outleft); - size_t ret; - - t->buf = (unsigned char *) outbuf; - - ret = yaz_iconv (o->op->iconv_handle, &inbuf, &inleft, - &outbuf, &outleft); - if (ret == (size_t)(-1)) - { - odr_seterror(o, ODATA, 44); - return 0; - } - t->size = t->len = outbuf - (char*) t->buf; - } - if (!t->buf) - { - t->buf = (unsigned char *) *p; - t->size = t->len = strlen(*p); - } - } - else - { - t->size= 0; - t->len = 0; - t->buf = 0; - } - if (!ber_octetstring(o, t, cons)) - return 0; - if (o->direction == ODR_DECODE) - { - *p = 0; - - if (o->op->iconv_handle != 0) - { - size_t inleft = t->len; - char *inbuf = (char *) t->buf; - size_t outleft = 4 * inleft + 2; - char *outbuf = (char *) odr_malloc (o, outleft); - size_t ret; - - *p = outbuf; - - ret = yaz_iconv (o->op->iconv_handle, &inbuf, &inleft, - &outbuf, &outleft); - if (ret == (size_t)(-1)) - { - odr_seterror(o, ODATA, 45); - return 0; - } - inleft = outbuf - (char*) *p; - - (*p)[inleft] = '\0'; /* null terminate it */ - } - if (!*p) - { - *p = (char *) t->buf; - *(*p + t->len) = '\0'; /* ber_octs reserves space for this */ - } - } - return 1; -} diff --git a/odr/odr_oid.c b/odr/odr_oid.c deleted file mode 100644 index 4077f36..0000000 --- a/odr/odr_oid.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: odr_oid.c,v 1.20 2003-05-20 19:55:30 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include "odr-priv.h" -#include - -/* - * Top level oid en/decoder. - * Returns 1 on success, 0 on error. - */ -int odr_oid(ODR o, Odr_oid **p, int opt, const char *name) -{ - int res, cons = 0; - - if (o->error) - return 0; - if (o->t_class < 0) - { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_OID; - } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) - return 0; - if (!res) - return odr_missing(o, opt, name); - if (cons) - { - odr_seterror(o, OPROTO, 46); - return 0; - } - if (o->direction == ODR_PRINT) - { - int i; - - odr_prname(o, name); - fprintf(o->print, "OID:"); - for (i = 0; (*p)[i] > -1; i++) - fprintf(o->print, " %d", (*p)[i]); - fprintf(o->print, "\n"); - return 1; - } - if (o->direction == ODR_DECODE) - *p = (int *)odr_malloc(o, OID_SIZE * sizeof(**p)); - return ber_oidc(o, *p); -} diff --git a/odr/odr_seq.c b/odr/odr_seq.c deleted file mode 100644 index ab68a76..0000000 --- a/odr/odr_seq.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: odr_seq.c,v 1.30 2003-03-11 11:03:31 adam Exp $ - */ - -#if HAVE_CONFIG_H -#include -#endif - -#include "odr-priv.h" - -int odr_sequence_begin(ODR o, void *p, int size, const char *name) -{ - char **pp = (char**) p; - - if (o->error) - return 0; - if (o->t_class < 0) - { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_SEQUENCE; - } - if (o->direction == ODR_DECODE) - *pp = 0; - if (odr_constructed_begin(o, p, o->t_class, o->t_tag, name)) - { - if (o->direction == ODR_DECODE && size) - *pp = (char *)odr_malloc(o, size); - return 1; - } - else - return 0; -} - -int odr_set_begin(ODR o, void *p, int size, const char *name) -{ - char **pp = (char**) p; - - if (o->error) - return 0; - if (o->t_class < 0) - { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_SET; - } - if (o->direction == ODR_DECODE) - *pp = 0; - if (odr_constructed_begin(o, p, o->t_class, o->t_tag, name)) - { - if (o->direction == ODR_DECODE && size) - *pp = (char *)odr_malloc(o, size); - return 1; - } - else - return 0; -} - -int odr_sequence_end(ODR o) -{ - return odr_constructed_end(o); -} - -int odr_set_end(ODR o) -{ - return odr_constructed_end(o); -} - -static int odr_sequence_more(ODR o) -{ - return odr_constructed_more(o); -} - -static int odr_sequence_x (ODR o, Odr_fun type, void *p, int *num) -{ - char ***pp = (char***) p; /* for dereferencing */ - char **tmp = 0; - int size = 0, i; - - switch (o->direction) - { - case ODR_DECODE: - *num = 0; - *pp = (char **)odr_nullval(); - while (odr_sequence_more(o)) - { - /* outgrown array? */ - if (*num * (int) sizeof(void*) >= size) - { - /* double the buffer size */ - tmp = (char **)odr_malloc(o, sizeof(void*) * - (size += size ? size : 128)); - if (*num) - { - memcpy(tmp, *pp, *num * sizeof(void*)); - /* - * For now, we just throw the old *p away, since we use - * nibble memory anyway (disgusting, isn't it?). - */ - } - *pp = tmp; - } - if (!(*type)(o, (*pp) + *num, 0, 0)) - return 0; - (*num)++; - } - break; - case ODR_ENCODE: case ODR_PRINT: -#ifdef ODR_DEBUG - fprintf(stderr, "[seqof: num=%d]", *num); -#endif - for (i = 0; i < *num; i++) - { -#ifdef ODR_DEBUG - fprintf(stderr, "[seqof: elem #%d]", i); -#endif - if (!(*type)(o, *pp + i, 0, 0)) - return 0; - } - break; - default: - odr_seterror(o, OOTHER, 47); - return 0; - } - return odr_sequence_end(o); -} - -int odr_set_of(ODR o, Odr_fun type, void *p, int *num, const char *name) -{ - if (!odr_set_begin(o, p, 0, name)) { - if (o->direction == ODR_DECODE) - *num = 0; - return 0; - } - return odr_sequence_x (o, type, p, num); -} - -int odr_sequence_of(ODR o, Odr_fun type, void *p, int *num, - const char *name) -{ - if (!odr_sequence_begin(o, p, 0, name)) { - if (o->direction == ODR_DECODE) - *num = 0; - return 0; - } - return odr_sequence_x (o, type, p, num); -} - diff --git a/odr/odr_tag.c b/odr/odr_tag.c deleted file mode 100644 index 8e40213..0000000 --- a/odr/odr_tag.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: odr_tag.c,v 1.14 2003-03-11 11:03:31 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include "odr-priv.h" - -int odr_peektag(ODR o, int *zclass, int *tag, int *cons) -{ - if (o->direction != ODR_DECODE) - { - odr_seterror(o, OOTHER, 48); - return 0; - } - if (o->op->stackp > -1 && !odr_constructed_more(o)) - return 0; - if (ber_dectag(o->bp, zclass, tag, cons, odr_max(o)) <= 0) - { - odr_seterror(o, OREQUIRED, 49); - return 0; - } - return 1; -} - -int odr_implicit_settag(ODR o, int zclass, int tag) -{ - if (o->error) - return 0; - if (o->t_class < 0) - { - o->t_class = zclass; - o->t_tag = tag; - } - return 1; -} - -int odr_initmember(ODR o, void *p, int size) -{ - char **pp = (char **) p; - - if (o->error) - return 0; - if (o->direction == ODR_DECODE) - *pp = (char *)odr_malloc(o, size); - else if (!*pp) - { - o->t_class = -1; - return 0; - } - return 1; -} diff --git a/odr/odr_use.c b/odr/odr_use.c deleted file mode 100644 index 918d69d..0000000 --- a/odr/odr_use.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: odr_use.c,v 1.14 2003-05-20 19:55:30 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include "odr-priv.h" - -int odr_external(ODR o, Odr_external **p, int opt, const char *name) -{ - Odr_external *pp; - static Odr_arm arm[] = - { - {ODR_EXPLICIT, ODR_CONTEXT, 0, ODR_EXTERNAL_single, - (Odr_fun)odr_any, "single"}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, ODR_EXTERNAL_octet, - (Odr_fun)odr_octetstring, "octet"}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, ODR_EXTERNAL_arbitrary, - (Odr_fun)odr_bitstring, "arbitrary"}, - {-1, -1, -1, -1, 0, 0} - }; - - odr_implicit_settag(o, ODR_UNIVERSAL, ODR_EXTERNAL); - if (!odr_sequence_begin(o, p, sizeof(Odr_external), name)) - return odr_missing(o, opt, name); - pp = *p; - return - odr_oid(o, &pp->direct_reference, 1, "direct") && - odr_integer(o, &pp->indirect_reference, 1, "indirect") && - odr_graphicstring(o, &pp->descriptor, 1, "descriptor") && - odr_choice(o, arm, &pp->u, &pp->which, 0) && - odr_sequence_end(o); -} - -int odr_visiblestring(ODR o, char **p, int opt, const char *name) -{ - return odr_implicit_tag(o, odr_cstring, p, ODR_UNIVERSAL, - ODR_VISIBLESTRING, opt, name); -} - -/* - * a char may not be sufficient to hold a general string, but we'll deal - * with that once we start looking more closely at UniCode & co. - */ -int odr_generalstring(ODR o, char **p, int opt, const char *name) -{ - return odr_implicit_tag(o, odr_iconv_string, p, ODR_UNIVERSAL, - ODR_GENERALSTRING,opt, name); -} - -int odr_graphicstring(ODR o, char **p, int opt, const char *name) -{ - return odr_implicit_tag(o, odr_cstring, p, ODR_UNIVERSAL, - ODR_GRAPHICSTRING, opt, name); -} - -int odr_generalizedtime(ODR o, char **p, int opt, const char *name) -{ - return odr_implicit_tag(o, odr_cstring, p, ODR_UNIVERSAL, - ODR_GENERALIZEDTIME, opt, name); -} diff --git a/odr/odr_util.c b/odr/odr_util.c deleted file mode 100644 index 5da4088..0000000 --- a/odr/odr_util.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * - * $Id: odr_util.c,v 1.25 2003-05-24 19:20:14 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include "odr-priv.h" -#include - -void odr_prname(ODR o, const char *name) -{ - if (name) - fprintf (o->print, "%*s%s ", o->indent*4, "", name); - else - fprintf (o->print, "%*s", o->indent*4, ""); -} - -int odp_more_chunks(ODR o, const unsigned char *base, int len) -{ - if (!len) - return 0; - if (len < 0) /* indefinite length */ - { - if (*o->bp == 0 && *(o->bp + 1) == 0) - { - o->bp += 2; - return 0; - } - else - return 1; - } - else - return o->bp - base < len; -} - -Odr_oid *odr_oiddup_nmem(NMEM nmem, Odr_oid *o) -{ - Odr_oid *r; - - if (!o) - return 0; - if (!(r = (int *)nmem_malloc(nmem, (oid_oidlen(o) + 1) * sizeof(int)))) - return 0; - oid_oidcpy(r, o); - return r; -} - -Odr_oid *odr_oiddup(ODR odr, Odr_oid *o) -{ - return odr_oiddup_nmem (odr->mem, o); -} - -Odr_oid *odr_getoidbystr_nmem(NMEM nmem, const char *str) -{ - int num = 1, i = 0; - const char *p = str; - Odr_oid *ret; - - if (!isdigit(*str)) - return 0; - while ((p = strchr(p, '.'))) - num++, p++; - ret = (int *)nmem_malloc(nmem, sizeof(*ret)*(num + 1)); - p = str; - do - ret[i++] = atoi(p); - while ((p = strchr(p, '.')) && *++p); - ret[i] = -1; - return ret; -} - -Odr_oid *odr_getoidbystr(ODR o, const char *str) -{ - return odr_getoidbystr_nmem (o->mem, str); -} - -int odr_missing(ODR o, int opt, const char *name) -{ - if (o->error) - return 0; - if (!opt) - { - odr_seterror(o, OREQUIRED, 53); - odr_setelement(o, name); - } - return opt; -} diff --git a/odr/tstodr.asn b/odr/tstodr.asn deleted file mode 100644 index 7a3f309..0000000 --- a/odr/tstodr.asn +++ /dev/null @@ -1,16 +0,0 @@ --- Small ASN.1 spec for tstodr test --- $Id: tstodr.asn,v 1.1 2003-05-06 10:08:30 adam Exp $ -tstodrcodec -{tstodrcodec} DEFINITIONS ::= -BEGIN -MySequence ::= SEQUENCE { - first [1] IMPLICIT INTEGER, - second [2] IMPLICIT OCTET STRING, - third [3] IMPLICIT BOOLEAN, - fourth [4] IMPLICIT NULL, - fifth [5] IMPLICIT INTEGER { - enum1(0), - enum2(1) - } -} -END diff --git a/odr/tstodr.c b/odr/tstodr.c deleted file mode 100644 index ead978d..0000000 --- a/odr/tstodr.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * - * $Id: tstodr.c,v 1.5 2003-05-26 13:47:23 adam Exp $ - * - */ -#include -#include -#include "tstodrcodec.h" - -void tst_MySequence1(ODR encode, ODR decode) -{ - char *ber_buf; - int ber_len; - Yc_MySequence *s = odr_malloc(encode, sizeof(*s)); - Yc_MySequence *t; - - s->first = odr_intdup(encode, 12345); - s->second = odr_malloc(encode, sizeof(*s->second)); - s->second->buf = "hello"; - s->second->len = 5; - s->second->size = 0; - s->third = odr_intdup(encode, 1); - s->fourth = odr_nullval(); - s->fifth = odr_intdup(encode, YC_MySequence_enum1); - - if (!yc_MySequence(encode, &s, 0, 0)) - exit(1); - - ber_buf = odr_getbuf(encode, &ber_len, 0); - - odr_setbuf(decode, ber_buf, ber_len, 0); - - if (!yc_MySequence(decode, &t, 0, 0)) - exit(2); - if (!t->first || *t->first != 12345) - exit(3); - if (!t->second || !t->second->buf || t->second->len != 5) - exit(4); - if (memcmp(t->second->buf, "hello", t->second->len)) - exit(5); - if (!t->third || *t->third != 1) - exit(6); - if (!t->fourth) - exit(7); - if (!t->fifth || *t->fifth != YC_MySequence_enum1) - exit(8); -} - -void tst_MySequence2(ODR encode, ODR decode) -{ - char *ber_buf; - int ber_len; - Yc_MySequence *s = odr_malloc(encode, sizeof(*s)); - Yc_MySequence *t; - - s->first = 0; /* deliberately miss this .. */ - s->second = odr_malloc(encode, sizeof(*s->second)); - s->second->buf = "hello"; - s->second->len = 5; - s->second->size = 0; - s->third = odr_intdup(encode, 1); - s->fourth = odr_nullval(); - s->fifth = odr_intdup(encode, YC_MySequence_enum1); - - if (yc_MySequence(encode, &s, 0, 0)) /* should fail */ - exit(9); - if (odr_geterror(encode) != OREQUIRED) - exit(10); - if (strcmp(odr_getelement(encode), "first")) - exit(11); - odr_reset(encode); - - if (odr_geterror(encode) != ONONE) - exit(12); - if (strcmp(odr_getelement(encode), "")) - exit(13); -} - -void tst_MySequence3(ODR encode, ODR decode) -{ - char buf[40]; - int i; - Yc_MySequence *t; - - srand(123); - for (i = 0; i<1000; i++) - { - int j; - for (j = 0; j -#include -#ifdef WIN32 -#include -#else -#include -#endif -#include -#include -#include - -#include -#include -#include -#include -#include "eventl.h" -#include "session.h" -#include - -#if YAZ_GNU_THREADS -#include -#define YAZ_EV_SELECT pth_select -#endif - -#ifndef YAZ_EV_SELECT -#define YAZ_EV_SELECT select -#endif - -IOCHAN iochan_create(int fd, IOC_CALLBACK cb, int flags) -{ - IOCHAN new_iochan; - - if (!(new_iochan = (IOCHAN)xmalloc(sizeof(*new_iochan)))) - return 0; - new_iochan->destroyed = 0; - new_iochan->fd = fd; - new_iochan->flags = flags; - new_iochan->fun = cb; - new_iochan->force_event = 0; - new_iochan->last_event = new_iochan->max_idle = 0; - new_iochan->next = NULL; - return new_iochan; -} - -int event_loop(IOCHAN *iochans) -{ - do /* loop as long as there are active associations to process */ - { - IOCHAN p, nextp; - fd_set in, out, except; - int res, max; - static struct timeval to; - time_t now = time(0); - - if (statserv_must_terminate()) - { - for (p = *iochans; p; p = p->next) - p->force_event = EVENT_TIMEOUT; - } - FD_ZERO(&in); - FD_ZERO(&out); - FD_ZERO(&except); - to.tv_sec = 3600; - to.tv_usec = 0; - max = 0; - for (p = *iochans; p; p = p->next) - { - time_t w, ftime; - yaz_log(LOG_DEBUG, "fd=%d flags=%d force_event=%d", - p->fd, p->flags, p->force_event); - if (p->force_event) - to.tv_sec = 0; /* polling select */ - if (p->flags & EVENT_INPUT) - FD_SET(p->fd, &in); - if (p->flags & EVENT_OUTPUT) - FD_SET(p->fd, &out); - if (p->flags & EVENT_EXCEPT) - FD_SET(p->fd, &except); - if (p->fd > max) - max = p->fd; - if (p->max_idle && p->last_event) - { - ftime = p->last_event + p->max_idle; - if (ftime < now) - w = p->max_idle; - else - w = ftime - now; - if (w < to.tv_sec) - to.tv_sec = w; - } - } - yaz_log(LOG_DEBUG, "select start %ld", (long) to.tv_sec); - res = YAZ_EV_SELECT(max + 1, &in, &out, &except, &to); - yaz_log(LOG_DEBUG, "select end"); - if (res < 0) - { - if (yaz_errno() == EINTR) - { - if (statserv_must_terminate()) - { - for (p = *iochans; p; p = p->next) - p->force_event = EVENT_TIMEOUT; - } - continue; - } - else - { - /* Destroy the first member in the chain, and try again */ - association *assoc = (association *)iochan_getdata(*iochans); - COMSTACK conn = assoc->client_link; - - cs_close(conn); - destroy_association(assoc); - iochan_destroy(*iochans); - yaz_log(LOG_DEBUG, "error select, destroying iochan %p", - *iochans); - } - } - now = time(0); - for (p = *iochans; p; p = p->next) - { - int force_event = p->force_event; - - p->force_event = 0; - if (!p->destroyed && (FD_ISSET(p->fd, &in) || - force_event == EVENT_INPUT)) - { - p->last_event = now; - (*p->fun)(p, EVENT_INPUT); - } - if (!p->destroyed && (FD_ISSET(p->fd, &out) || - force_event == EVENT_OUTPUT)) - { - p->last_event = now; - (*p->fun)(p, EVENT_OUTPUT); - } - if (!p->destroyed && (FD_ISSET(p->fd, &except) || - force_event == EVENT_EXCEPT)) - { - p->last_event = now; - (*p->fun)(p, EVENT_EXCEPT); - } - if (!p->destroyed && ((p->max_idle && now - p->last_event >= - p->max_idle) || force_event == EVENT_TIMEOUT)) - { - p->last_event = now; - (*p->fun)(p, EVENT_TIMEOUT); - } - } - for (p = *iochans; p; p = nextp) - { - nextp = p->next; - - if (p->destroyed) - { - IOCHAN tmp = p, pr; - - /* We need to inform the threadlist that this channel has been destroyed */ - statserv_remove(p); - - /* Now reset the pointers */ - if (p == *iochans) - *iochans = p->next; - else - { - for (pr = *iochans; pr; pr = pr->next) - if (pr->next == p) - break; - assert(pr); /* grave error if it weren't there */ - pr->next = p->next; - } - if (nextp == p) - nextp = p->next; - xfree(tmp); - } - } - } - while (*iochans); - return 0; -} diff --git a/server/eventl.h b/server/eventl.h deleted file mode 100644 index 95e45a4..0000000 --- a/server/eventl.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: eventl.h,v 1.12 2003-02-12 15:06:43 adam Exp $ - */ - -#ifndef EVENTL_H -#define EVENTL_H - -#include - -struct iochan; - -typedef void (*IOC_CALLBACK)(struct iochan *i, int event); - -typedef struct iochan -{ - int fd; - int flags; -#define EVENT_INPUT 0x01 -#define EVENT_OUTPUT 0x02 -#define EVENT_EXCEPT 0x04 -#define EVENT_TIMEOUT 0x08 -#define EVENT_WORK 0x10 -int force_event; - IOC_CALLBACK fun; - void *data; - int destroyed; - time_t last_event; - time_t max_idle; - - struct iochan *next; -} *IOCHAN; - -#define iochan_destroy(i) (void)((i)->destroyed = 1) -#define iochan_getfd(i) ((i)->fd) -#define iochan_setfd(i, f) ((i)->fd = (f)) -#define iochan_getdata(i) ((i)->data) -#define iochan_setdata(i, d) ((i)->data = d) -#define iochan_getflags(i) ((i)->flags) -#define iochan_setflags(i, d) ((i)->flags = d) -#define iochan_setflag(i, d) ((i)->flags |= d) -#define iochan_clearflag(i, d) ((i)->flags &= ~(d)) -#define iochan_getflag(i, d) ((i)->flags & d ? 1 : 0) -#define iochan_getfun(i) ((i)->fun) -#define iochan_setfun(i, d) ((i)->fun = d) -#define iochan_setevent(i, e) ((i)->force_event = (e)) -#define iochan_getnext(i) ((i)->next) -#define iochan_settimeout(i, t) ((i)->max_idle = (t), (i)->last_event = time(0)) - -IOCHAN iochan_create(int fd, IOC_CALLBACK cb, int flags); -int event_loop(IOCHAN *iochans); -void statserv_remove (IOCHAN pIOChannel); -#endif diff --git a/server/requestq.c b/server/requestq.c deleted file mode 100644 index 63ce3f3..0000000 --- a/server/requestq.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 1994-2003, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: requestq.c,v 1.10 2003-10-20 18:20:55 adam Exp $ - * - */ - -/* - * Simple queue management. - * - * We also use the request-freelist to store encoding buffers, rather than - * freeing and xmalloc'ing them on each cycle. - */ - -#include - -#include -#include "session.h" - -void request_enq(request_q *q, request *r) -{ - if (q->tail) - q->tail->next = r; - else - q->head = r; - q->tail = r; - q->num++; -} - -request *request_head(request_q *q) -{ - return q->head; -} - -request *request_deq(request_q *q) -{ - request *r = q->head; - - if (!r) - return 0; - q->head = q->head->next; - if (!q->head) - q->tail = 0; - q->num--; - return r; -} - -void request_initq(request_q *q) -{ - q->head = q->tail = q->list = 0; - q->num = 0; -} - -void request_delq(request_q *q) -{ - request *r1, *r = q->list; - while (r) - { - xfree (r->response); - r1 = r; - r = r->next; - xfree (r1); - } -} - -request *request_get(request_q *q) -{ - request *r = q->list; - - if (r) - q->list = r->next; - else - { - if (!(r = (request *)xmalloc(sizeof(*r)))) - abort(); - r->response = 0; - r->size_response = 0; - } - r->q = q; - r->len_refid = 0; - r->refid = 0; - r->gdu_request = 0; - r->apdu_request = 0; - r->request_mem = 0; - r->len_response = 0; - r->clientData = 0; - r->state = REQUEST_IDLE; - r->next = 0; - return r; -} - -void request_release(request *r) -{ - request_q *q = r->q; - r->next = q->list; - q->list = r; -} - diff --git a/server/service.c b/server/service.c deleted file mode 100644 index 9108beb..0000000 --- a/server/service.c +++ /dev/null @@ -1,500 +0,0 @@ -/* - * NT Service interface Utility. - * Based on code written by - * Chas Woodfield, Fretwell Downing Informatics. - * $Log: service.c,v $ - * Revision 1.5 2001-11-13 23:00:42 adam - * Separate malloc debug library. Removal of ASN_COMPILED-#ifdefs. - * - * Revision 1.4 2000/12/05 19:05:10 adam - * Service automatically starts in the directory from which it was installed. - * - * Revision 1.3 1999/06/10 11:45:30 adam - * Added bend_start, bend_stop handlers and removed pre_init. - * Handlers bend_start/bend_stop are called when service/daemon is - * started/stopped. - * - * Revision 1.2 1999/02/02 13:57:36 adam - * Uses preprocessor define WIN32 instead of WINDOWS to build code - * for Microsoft WIN32. - * - * Revision 1.1 1997/11/07 13:31:52 adam - * Added NT Service name part of statserv_options_block. Moved NT - * service utility to server library. - * - * Revision 1.6 1997/09/18 08:49:14 adam - * Option -runnormal no needed to run server in standalone mode. - * - * Revision 1.5 1997/09/17 12:10:43 adam - * YAZ version 1.4. - * - * Revision 1.4 1997/09/09 10:10:20 adam - * Another MSV5.0 port. Changed projects to include proper - * library/include paths. - * Server starts server in test-mode when no options are given. - * - * Revision 1.3 1997/09/04 13:50:30 adam - * Bug fix in ztest. - * - */ - -/************************************************************/ -/* Note this file is shared by all processes */ -/* Should really put it somewhere other than here */ -/* For some strange reason it won't work when part of a lib */ -/************************************************************/ - -#ifdef WIN32 - -#include -#include -#include -#include - -#include "service.h" - -static AppService *pService = NULL; -static BOOL bRunAsService = TRUE; -static void *pAppHandle = NULL; - -/* Private functions to this module */ -void Service_Create(LPTSTR pAppName, LPTSTR pServiceName, LPTSTR pServiceDisplayName, LPTSTR pDependancies, int argc, char **argv); -void Service_Delete(); -void Service_Initialize(); -BOOL NotifyServiceController(); -BOOL UpdateServiceStatus(DWORD Status); -void FailServiceStart(DWORD Win32Code, DWORD PrivateCode); -void CmdInstallService(int argc, char *argv[], BOOL bAutoStart); -void CmdRemoveService(); -LPTSTR GetLastErrorText(LPTSTR lpszBuf, DWORD dwSize); -BOOL CheckServiceArguments(int argc, char *argv[]); - -/* Callback functions for thee service manager */ -void WINAPI ServiceMain(DWORD argc, LPTSTR argv[]); -void WINAPI ServiceControlHandler(DWORD fdwControl); - -/* Function to handle Ctrl + C etc... */ -BOOL EventHandlerRoutine(DWORD dwCtrlType); - -void Service_Create(LPTSTR pAppName, LPTSTR pServiceName, LPTSTR pServiceDisplayName, LPTSTR pDependancies, int argc, char **argv) -{ - pService = malloc(sizeof(AppService)); - pService->pAppName = pAppName; - pService->pServiceName = pServiceName; - pService->pServiceDisplayName = pServiceDisplayName; - pService->pDependancies = pDependancies; - pService->hService = 0; - pService->ServiceTable[0].lpServiceName = pServiceName; - pService->ServiceTable[0].lpServiceProc = ServiceMain; - pService->ServiceTable[1].lpServiceName = NULL; - pService->ServiceTable[1].lpServiceProc = NULL; - pService->argc = argc; - pService->argv = argv; -} - -void Service_Delete() -{ - if (pService != NULL) - { - /* Mark the service as stopping */ - UpdateServiceStatus(SERVICE_STOP_PENDING); - - /* Stop the service */ - StopAppService(pAppHandle); - - /* Service has now stopped */ - UpdateServiceStatus(SERVICE_STOPPED); - - /* Free the memory */ - free(pService); - pService = NULL; - } -} - -void Service_Initialize() -{ - if (pService != NULL) - { - /* Register ourselves with the control dispatcher */ - StartServiceCtrlDispatcher(pService->ServiceTable); - } -} - -void WINAPI ServiceMain(DWORD argc, LPTSTR argv[]) -{ - if (pService != NULL) - { - if (NotifyServiceController()) - { - /* Set the status to pending */ - UpdateServiceStatus(SERVICE_START_PENDING); - - /* Lets attempt to start the service */ - if (StartAppService(pAppHandle, pService->argc, pService->argv)) - { - /* Service is now up and running */ - UpdateServiceStatus(SERVICE_RUNNING); - - /* Lets wait for our clients */ - RunAppService(pAppHandle); - } - else - { - FailServiceStart(GetLastError(), 0); - Service_Delete(); - } - } - } -} - -BOOL NotifyServiceController() -{ - if (pService == NULL) - { - return(FALSE); - } - else - { - if (bRunAsService) - { - pService->ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; - pService->ServiceStatus.dwCurrentState = SERVICE_STOPPED; - pService->ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP; - pService->ServiceStatus.dwWin32ExitCode = 0; - pService->ServiceStatus.dwServiceSpecificExitCode = 0; - pService->ServiceStatus.dwCheckPoint = 0; - pService->ServiceStatus.dwWaitHint = 0; - pService->hService = RegisterServiceCtrlHandler(pService->pServiceName, ServiceControlHandler); - - if (pService->hService) - UpdateServiceStatus(SERVICE_START_PENDING); - else - return(FALSE); - } - return(TRUE); - } -} - -void WINAPI ServiceControlHandler(DWORD fdwControl) -{ - if (pService != NULL) - { - switch (fdwControl) - { - case SERVICE_CONTROL_STOP: - /* Update the service status to be pending */ - Service_Delete(); - break; - - case SERVICE_CONTROL_INTERROGATE: - UpdateServiceStatus(pService->ServiceStatus.dwCurrentState); - break; - - default: - break; - } - } -} - -BOOL UpdateServiceStatus(DWORD Status) -{ - if (pService != NULL) - { - if (pService->hService) - { - pService->ServiceStatus.dwCurrentState = Status; - if ((Status == SERVICE_START_PENDING) || (Status == SERVICE_STOP_PENDING)) - { - pService->ServiceStatus.dwCheckPoint ++; - pService->ServiceStatus.dwWaitHint = 5000; /* 5 sec.*/ - } - else - { - pService->ServiceStatus.dwCheckPoint = 0; - pService->ServiceStatus.dwWaitHint = 0; - } - - return(SetServiceStatus(pService->hService, &pService->ServiceStatus)); - } - } - - return(FALSE); -} - -void FailServiceStart(DWORD Win32Code, DWORD PrivateCode) -{ - if (pService != NULL) - { - pService->ServiceStatus.dwWin32ExitCode = Win32Code; - pService->ServiceStatus.dwServiceSpecificExitCode = PrivateCode; - UpdateServiceStatus(SERVICE_STOPPED); - } -} - -void CmdInstallService(int argc, char *argv[], BOOL bAutoStart) -{ - if (pService != NULL) - { - SC_HANDLE schService; - SC_HANDLE schSCManager; - - TCHAR szPath[2048]; - - if (GetModuleFileName(NULL, szPath, 512) == 0) - { - _tprintf(TEXT("Unable to install %s - %s\n"), TEXT(pService->pServiceDisplayName), GetLastErrorText(pService->szErr, 256)); - } - else - { - int i; - char cwdstr[_MAX_PATH]; - - if (!_getcwd(cwdstr, sizeof(cwdstr))) - strcpy (cwdstr, "."); - - strcat (szPath, TEXT(" -runservice \"")); - strcat (szPath, cwdstr); - strcat (szPath, "\""); - - for (i = 1; i < argc; i++) - { - /* We will add the given command line arguments to the command */ - /* We are not interested in the install and remove options */ - if ((stricmp("-install", argv[i]) != 0) && - (stricmp("-installa", argv[i]) != 0) && - (stricmp("-remove", argv[i]) != 0)) - { - strcat(szPath, TEXT(" ")); - strcat(szPath, argv[i]); - } - } - - schSCManager = OpenSCManager(NULL, /* machine (NULL == local) */ - NULL, /* database (NULL == default) */ - SC_MANAGER_ALL_ACCESS); /* access required */ - if (schSCManager) - { - schService = CreateService(schSCManager, /* SCManager database */ - TEXT(pService->pServiceName), /* name of service */ - TEXT(pService->pServiceDisplayName), /* name to display */ - SERVICE_ALL_ACCESS, /* desired access */ - SERVICE_WIN32_OWN_PROCESS, /* service type */ - bAutoStart ? SERVICE_AUTO_START : - SERVICE_DEMAND_START, /* start type */ - SERVICE_ERROR_NORMAL, /* error control type */ - szPath, /* service's binary */ - NULL, /* no load ordering group */ - NULL, /* no tag identifier */ - TEXT(pService->pDependancies), /* dependencies */ - NULL, /* LocalSystem account */ - NULL); /* no password */ - - if (schService) - { - _tprintf(TEXT("%s installed.\n"), TEXT(pService->pServiceDisplayName)); - CloseServiceHandle(schService); - } - else - { - _tprintf(TEXT("CreateService failed - %s\n"), GetLastErrorText(pService->szErr, 256)); - } - - CloseServiceHandle(schSCManager); - } - else - _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(pService->szErr,256)); - } - } -} - -void CmdRemoveService() -{ - if (pService != NULL) - { - SC_HANDLE schService; - SC_HANDLE schSCManager; - - schSCManager = OpenSCManager(NULL, /* machine (NULL == local) */ - NULL, /* database (NULL == default) */ - SC_MANAGER_ALL_ACCESS); /* access required */ - if (schSCManager) - { - schService = OpenService(schSCManager, TEXT(pService->pServiceName), SERVICE_ALL_ACCESS); - - if (schService) - { - /* try to stop the service */ - if (ControlService(schService, SERVICE_CONTROL_STOP, &pService->ServiceStatus)) - { - _tprintf(TEXT("Stopping %s."), TEXT(pService->pServiceDisplayName)); - Sleep(1000); - - while (QueryServiceStatus(schService, &pService->ServiceStatus)) - { - if (pService->ServiceStatus.dwCurrentState == SERVICE_STOP_PENDING) - { - _tprintf(TEXT(".")); - Sleep( 1000 ); - } - else - break; - } - - if (pService->ServiceStatus.dwCurrentState == SERVICE_STOPPED) - _tprintf(TEXT("\n%s stopped.\n"), TEXT(pService->pServiceDisplayName)); - else - _tprintf(TEXT("\n%s failed to stop.\n"), TEXT(pService->pServiceDisplayName)); - - } - - /* now remove the service */ - if(DeleteService(schService)) - _tprintf(TEXT("%s removed.\n"), TEXT(pService->pServiceDisplayName)); - else - _tprintf(TEXT("DeleteService failed - %s\n"), GetLastErrorText(pService->szErr,256)); - - CloseServiceHandle(schService); - } - else - _tprintf(TEXT("OpenService failed - %s\n"), GetLastErrorText(pService->szErr,256)); - - CloseServiceHandle(schSCManager); - } - else - _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(pService->szErr,256)); - } -} - -LPTSTR GetLastErrorText(LPTSTR lpszBuf, DWORD dwSize) -{ - DWORD dwRet; - LPTSTR lpszTemp = NULL; - - dwRet = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_ARGUMENT_ARRAY, - NULL, - GetLastError(), - LANG_NEUTRAL, - (LPTSTR)&lpszTemp, - 0, - NULL); - - /* supplied buffer is not long enough */ - if (!dwRet || ((long)dwSize < (long)dwRet + 14)) - lpszBuf[0] = TEXT('\0'); - else - { - lpszTemp[lstrlen(lpszTemp)-2] = TEXT('\0'); /* remove cr and newline character */ - _stprintf(lpszBuf, TEXT("%s (0x%x)"), lpszTemp, GetLastError()); - } - - if (lpszTemp) - LocalFree((HLOCAL)lpszTemp); - - return(lpszBuf); -} - -BOOL CheckServiceArguments(int argc, char *argv[]) -{ - int i; - - /* Lets process the arguments */ - for (i = 1; i < argc; i++) - { - if (stricmp("-install", argv[i]) == 0) - { - /* They want to install the service */ - CmdInstallService(argc, argv, FALSE); - - /* We don't carry on, after we have installed the service */ - return(FALSE); - } - else if (stricmp("-installa", argv[i]) == 0) - { - /* They want to install the service */ - CmdInstallService(argc, argv, TRUE); - - /* We don't carry on, after we have installed the service */ - return(FALSE); - } - else if (stricmp("-remove", argv[i]) == 0) - { - /* Here they want to remove it */ - CmdRemoveService(); - - /* We don't carry on, after we have removed the service */ - return(FALSE); - } - else if (stricmp ("-runservice", argv[i]) == 0) - { - /* We can carry on, if we reached here */ - chdir(argv[i+1]); - argv[i] = ""; - argv[i+1] = ""; - return(TRUE); - } - } - bRunAsService = FALSE; - return(TRUE); -} - -BOOL SetupService(int argc, char *argv[], void *pHandle, LPTSTR pAppName, LPTSTR pServiceName, LPTSTR pServiceDisplayName, LPTSTR pDependancies) -{ - BOOL bDeleteService = TRUE; - BOOL bResult = FALSE; - - /* Save the handle for later use */ - pAppHandle = pHandle; - - /* Create our service class */ - Service_Create(pAppName, pServiceName, pServiceDisplayName, pDependancies, argc, argv); - - if (CheckServiceArguments(argc, argv)) - { - if (bRunAsService) - { - /* No need to set the console control handler, as the service manager handles all this for us */ - Service_Initialize(); - bDeleteService = FALSE; - } - else - { - /* Set the console control handler for exiting the program */ - SetConsoleCtrlHandler((PHANDLER_ROUTINE)EventHandlerRoutine, TRUE); - - /* Now do the main work */ - ServiceMain(argc, argv); - } - - /* We have been successful initializing, so let the caller know */ - bResult = TRUE; - } - - if (bDeleteService) - { - /* Finished with the service now */ - Service_Delete(); - } - return(bResult); -} - -BOOL EventHandlerRoutine(DWORD dwCtrlType) -{ - /* This routine dosn't seem to get called all the time, Why ??? */ - switch (dwCtrlType) - { - case CTRL_C_EVENT: /* A CTRL+C signal was received, either from keyboard input or from a signal generated by the GenerateConsoleCtrlEvent function.*/ - case CTRL_BREAK_EVENT: /* A CTRL+BREAK signal was received, either from keyboard input or from a signal generated by GenerateConsoleCtrlEvent.*/ - case CTRL_CLOSE_EVENT: /* A signal that the system sends to all processes attached to a console when the user closes the console (either by choosing the Close command from the console window's System menu, or by choosing the End Task command from the Task List).*/ - case CTRL_LOGOFF_EVENT: /* A signal that the system sends to all console processes when a user is logging off. This signal does not indicate which user is logging off, so no assumptions can be made.*/ - case CTRL_SHUTDOWN_EVENT: /* A signal that the system sends to all console processes when the system */ - /* We are basically shutting down, so call Service_Delete */ - Service_Delete(); - return(FALSE); - break; - - default: - /* we are not handling this one, so return FALSE */ - return(FALSE); - } -} -#endif diff --git a/server/service.h b/server/service.h deleted file mode 100644 index 347357c..0000000 --- a/server/service.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * NT Service interface Utility. - * Based on code written by - * Chas Woodfield, Fretwell Downing Datasystems. - * $Log: service.h,v $ - * Revision 1.1 1997-11-07 13:31:52 adam - * Added NT Service name part of statserv_options_block. Moved NT - * service utility to server library. - * - * Revision 1.2 1997/09/04 13:50:30 adam - * Bug fix in ztest. - * - */ - -#ifndef SERVICE_INCLUDED -#define SERVICE_INCLUDED - -#ifdef WIN32 - -#include - -typedef struct _Service -{ - LPTSTR pAppName; - LPTSTR pServiceName; - LPTSTR pServiceDisplayName; - LPTSTR pDependancies; - TCHAR szErr[256]; - SERVICE_STATUS_HANDLE hService; - SERVICE_STATUS ServiceStatus; - SERVICE_TABLE_ENTRY ServiceTable[2]; - int argc; - char **argv; -} AppService; - -/* Called by the app to initialize the service */ -BOOL SetupService(int argc, char *argv[], void *pHandle, LPTSTR pAppName, LPTSTR pServiceName, LPTSTR pServiceDisplayName, LPTSTR pDependancies); - -#endif /* WIN32 */ - -/* Functions that must be in the main application */ -/* Initializes the app */ -int StartAppService(void *pHandle, int argc, char **argv); - -/* Now we wait for any connections */ -void RunAppService(void *pHandle); - -/* Time to tidyup and stop the service */ -void StopAppService(void *pHandle); - -#endif diff --git a/server/seshigh.c b/server/seshigh.c deleted file mode 100644 index 34223f1..0000000 --- a/server/seshigh.c +++ /dev/null @@ -1,2605 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * - * $Id: seshigh.c,v 1.164 2003-10-21 09:48:23 adam Exp $ - */ - -/* - * Frontend server logic. - * - * This code receives incoming APDUs, and handles client requests by means - * of the backend API. - * - * Some of the code is getting quite involved, compared to simpler servers - - * primarily because it is asynchronous both in the communication with - * the user and the backend. We think the complexity will pay off in - * the form of greater flexibility when more asynchronous facilities - * are implemented. - * - * Memory management has become somewhat involved. In the simple case, where - * only one PDU is pending at a time, it will simply reuse the same memory, - * once it has found its working size. When we enable multiple concurrent - * operations, perhaps even with multiple parallel calls to the backend, it - * will maintain a pool of buffers for encoding and decoding, trying to - * minimize memory allocation/deallocation during normal operation. - * - */ - -#include -#include -#include -#ifdef WIN32 -#include -#define S_ISREG(x) (x & _S_IFREG) -#include -#include -#else -#include -#include -#endif -#include -#include - -#include -#include -#include -#include "eventl.h" -#include "session.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -static void process_gdu_request(association *assoc, request *req); -static int process_z_request(association *assoc, request *req, char **msg); -void backend_response(IOCHAN i, int event); -static int process_gdu_response(association *assoc, request *req, Z_GDU *res); -static int process_z_response(association *assoc, request *req, Z_APDU *res); -static Z_APDU *process_initRequest(association *assoc, request *reqb); -static Z_External *init_diagnostics(ODR odr, int errcode, char *errstring); -static Z_APDU *process_searchRequest(association *assoc, request *reqb, - int *fd); -static Z_APDU *response_searchRequest(association *assoc, request *reqb, - bend_search_rr *bsrr, int *fd); -static Z_APDU *process_presentRequest(association *assoc, request *reqb, - int *fd); -static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd); -static Z_APDU *process_sortRequest(association *assoc, request *reqb, int *fd); -static void process_close(association *assoc, request *reqb); -void save_referenceId (request *reqb, Z_ReferenceId *refid); -static Z_APDU *process_deleteRequest(association *assoc, request *reqb, - int *fd); -static Z_APDU *process_segmentRequest (association *assoc, request *reqb); - -static FILE *apduf = 0; /* for use in static mode */ -static statserv_options_block *control_block = 0; - -static Z_APDU *process_ESRequest(association *assoc, request *reqb, int *fd); - -/* - * Create and initialize a new association-handle. - * channel : iochannel for the current line. - * link : communications channel. - * Returns: 0 or a new association handle. - */ -association *create_association(IOCHAN channel, COMSTACK link) -{ - association *anew; - - if (!control_block) - control_block = statserv_getcontrol(); - if (!(anew = (association *)xmalloc(sizeof(*anew)))) - return 0; - anew->init = 0; - anew->version = 0; - anew->client_chan = channel; - anew->client_link = link; - anew->cs_get_mask = 0; - anew->cs_put_mask = 0; - anew->cs_accept_mask = 0; - if (!(anew->decode = odr_createmem(ODR_DECODE)) || - !(anew->encode = odr_createmem(ODR_ENCODE))) - return 0; - if (*control_block->apdufile) - { - char filename[256]; - FILE *f; - - strcpy(filename, control_block->apdufile); - if (!(anew->print = odr_createmem(ODR_PRINT))) - return 0; - if (*control_block->apdufile == '@') - { - odr_setprint(anew->print, yaz_log_file()); - } - else if (*control_block->apdufile != '-') - { - strcpy(filename, control_block->apdufile); - if (!control_block->dynamic) - { - if (!apduf) - { - if (!(apduf = fopen(filename, "w"))) - { - yaz_log(LOG_WARN|LOG_ERRNO, "%s", filename); - return 0; - } - setvbuf(apduf, 0, _IONBF, 0); - } - f = apduf; - } - else - { - sprintf(filename + strlen(filename), ".%d", getpid()); - if (!(f = fopen(filename, "w"))) - { - yaz_log(LOG_WARN|LOG_ERRNO, "%s", filename); - return 0; - } - setvbuf(f, 0, _IONBF, 0); - } - odr_setprint(anew->print, f); - } - } - else - anew->print = 0; - anew->input_buffer = 0; - anew->input_buffer_len = 0; - anew->backend = 0; - anew->state = ASSOC_NEW; - request_initq(&anew->incoming); - request_initq(&anew->outgoing); - anew->proto = cs_getproto(link); - return anew; -} - -/* - * Free association and release resources. - */ -void destroy_association(association *h) -{ - statserv_options_block *cb = statserv_getcontrol(); - request *req; - - xfree(h->init); - odr_destroy(h->decode); - odr_destroy(h->encode); - if (h->print) - odr_destroy(h->print); - if (h->input_buffer) - xfree(h->input_buffer); - if (h->backend) - (*cb->bend_close)(h->backend); - while ((req = request_deq(&h->incoming))) - request_release(req); - while ((req = request_deq(&h->outgoing))) - request_release(req); - request_delq(&h->incoming); - request_delq(&h->outgoing); - xfree(h); - xmalloc_trav("session closed"); - if (control_block && control_block->one_shot) - { - exit (0); - } -} - -static void do_close_req(association *a, int reason, char *message, - request *req) -{ - Z_APDU apdu; - Z_Close *cls = zget_Close(a->encode); - - /* Purge request queue */ - while (request_deq(&a->incoming)); - while (request_deq(&a->outgoing)); - if (a->version >= 3) - { - yaz_log(LOG_LOG, "Sending Close PDU, reason=%d, message=%s", - reason, message ? message : "none"); - apdu.which = Z_APDU_close; - apdu.u.close = cls; - *cls->closeReason = reason; - cls->diagnosticInformation = message; - process_z_response(a, req, &apdu); - iochan_settimeout(a->client_chan, 20); - } - else - { - request_release(req); - yaz_log(LOG_DEBUG, "v2 client. No Close PDU"); - iochan_setevent(a->client_chan, EVENT_TIMEOUT); /* force imm close */ - } - a->state = ASSOC_DEAD; -} - -static void do_close(association *a, int reason, char *message) -{ - request *req = request_get(&a->outgoing); - do_close_req (a, reason, message, req); -} - -/* - * This is where PDUs from the client are read and the further - * processing is initiated. Flow of control moves down through the - * various process_* functions below, until the encoded result comes back up - * to the output handler in here. - * - * h : the I/O channel that has an outstanding event. - * event : the current outstanding event. - */ -void ir_session(IOCHAN h, int event) -{ - int res; - association *assoc = (association *)iochan_getdata(h); - COMSTACK conn = assoc->client_link; - request *req; - - assert(h && conn && assoc); - if (event == EVENT_TIMEOUT) - { - if (assoc->state != ASSOC_UP) - { - yaz_log(LOG_LOG, "Final timeout - closing connection."); - cs_close(conn); - destroy_association(assoc); - iochan_destroy(h); - } - else - { - yaz_log(LOG_LOG, "Session idle too long. Sending close."); - do_close(assoc, Z_Close_lackOfActivity, 0); - } - return; - } - if (event & assoc->cs_accept_mask) - { - yaz_log (LOG_DEBUG, "ir_session (accept)"); - if (!cs_accept (conn)) - { - yaz_log (LOG_LOG, "accept failed"); - destroy_association(assoc); - iochan_destroy(h); - } - iochan_clearflag (h, EVENT_OUTPUT|EVENT_OUTPUT); - if (conn->io_pending) - { /* cs_accept didn't complete */ - assoc->cs_accept_mask = - ((conn->io_pending & CS_WANT_WRITE) ? EVENT_OUTPUT : 0) | - ((conn->io_pending & CS_WANT_READ) ? EVENT_INPUT : 0); - - iochan_setflag (h, assoc->cs_accept_mask); - } - else - { /* cs_accept completed. Prepare for reading (cs_get) */ - assoc->cs_accept_mask = 0; - assoc->cs_get_mask = EVENT_INPUT; - iochan_setflag (h, assoc->cs_get_mask); - } - return; - } - if ((event & assoc->cs_get_mask) || (event & EVENT_WORK)) /* input */ - { - if ((assoc->cs_put_mask & EVENT_INPUT) == 0 && (event & assoc->cs_get_mask)) - { - yaz_log(LOG_DEBUG, "ir_session (input)"); - /* We aren't speaking to this fellow */ - if (assoc->state == ASSOC_DEAD) - { - yaz_log(LOG_LOG, "Connection closed - end of session"); - cs_close(conn); - destroy_association(assoc); - iochan_destroy(h); - return; - } - assoc->cs_get_mask = EVENT_INPUT; - if ((res = cs_get(conn, &assoc->input_buffer, - &assoc->input_buffer_len)) <= 0) - { - yaz_log(LOG_LOG, "Connection closed by client"); - cs_close(conn); - destroy_association(assoc); - iochan_destroy(h); - return; - } - else if (res == 1) /* incomplete read - wait for more */ - { - if (conn->io_pending & CS_WANT_WRITE) - assoc->cs_get_mask |= EVENT_OUTPUT; - iochan_setflag(h, assoc->cs_get_mask); - return; - } - if (cs_more(conn)) /* more stuff - call us again later, please */ - iochan_setevent(h, EVENT_INPUT); - - /* we got a complete PDU. Let's decode it */ - yaz_log(LOG_DEBUG, "Got PDU, %d bytes: lead=%02X %02X %02X", res, - assoc->input_buffer[0] & 0xff, - assoc->input_buffer[1] & 0xff, - assoc->input_buffer[2] & 0xff); - req = request_get(&assoc->incoming); /* get a new request */ - odr_reset(assoc->decode); - odr_setbuf(assoc->decode, assoc->input_buffer, res, 0); - if (!z_GDU(assoc->decode, &req->gdu_request, 0, 0)) - { - yaz_log(LOG_LOG, "ODR error on incoming PDU: %s [element %s] " - "[near byte %d] ", - odr_errmsg(odr_geterror(assoc->decode)), - odr_getelement(assoc->decode), - odr_offset(assoc->decode)); - if (assoc->decode->error != OHTTP) - { - yaz_log(LOG_LOG, "PDU dump:"); - odr_dumpBER(yaz_log_file(), assoc->input_buffer, res); - request_release(req); - do_close(assoc, Z_Close_protocolError,"Malformed package"); - } - else - { - Z_GDU *p = z_get_HTTP_Response(assoc->encode, 400); - assoc->state = ASSOC_DEAD; - process_gdu_response(assoc, req, p); - } - return; - } - req->request_mem = odr_extract_mem(assoc->decode); - if (assoc->print && !z_GDU(assoc->print, &req->gdu_request, 0, 0)) - { - yaz_log(LOG_WARN, "ODR print error: %s", - odr_errmsg(odr_geterror(assoc->print))); - odr_reset(assoc->print); - } - request_enq(&assoc->incoming, req); - } - - /* can we do something yet? */ - req = request_head(&assoc->incoming); - if (req->state == REQUEST_IDLE) - { - request_deq(&assoc->incoming); - process_gdu_request(assoc, req); - } - } - if (event & assoc->cs_put_mask) - { - request *req = request_head(&assoc->outgoing); - - assoc->cs_put_mask = 0; - yaz_log(LOG_DEBUG, "ir_session (output)"); - req->state = REQUEST_PENDING; - switch (res = cs_put(conn, req->response, req->len_response)) - { - case -1: - yaz_log(LOG_LOG, "Connection closed by client"); - cs_close(conn); - destroy_association(assoc); - iochan_destroy(h); - break; - case 0: /* all sent - release the request structure */ - yaz_log(LOG_DEBUG, "Wrote PDU, %d bytes", req->len_response); -#if 0 - yaz_log(LOG_DEBUG, "HTTP out:\n%.*s", req->len_response, - req->response); -#endif - nmem_destroy(req->request_mem); - request_deq(&assoc->outgoing); - request_release(req); - if (!request_head(&assoc->outgoing)) - { /* restore mask for cs_get operation ... */ - iochan_clearflag(h, EVENT_OUTPUT|EVENT_INPUT); - iochan_setflag(h, assoc->cs_get_mask); - if (assoc->state == ASSOC_DEAD) - iochan_setevent(assoc->client_chan, EVENT_TIMEOUT); - } - else - { - assoc->cs_put_mask = EVENT_OUTPUT; - } - break; - default: - if (conn->io_pending & CS_WANT_WRITE) - assoc->cs_put_mask |= EVENT_OUTPUT; - if (conn->io_pending & CS_WANT_READ) - assoc->cs_put_mask |= EVENT_INPUT; - iochan_setflag(h, assoc->cs_put_mask); - } - } - if (event & EVENT_EXCEPT) - { - yaz_log(LOG_LOG, "ir_session (exception)"); - cs_close(conn); - destroy_association(assoc); - iochan_destroy(h); - } -} - -static int process_z_request(association *assoc, request *req, char **msg); - -static void assoc_init_reset(association *assoc) -{ - xfree (assoc->init); - assoc->init = (bend_initrequest *) xmalloc (sizeof(*assoc->init)); - - assoc->init->stream = assoc->encode; - assoc->init->print = assoc->print; - assoc->init->auth = 0; - assoc->init->referenceId = 0; - assoc->init->implementation_version = 0; - assoc->init->implementation_id = 0; - assoc->init->implementation_name = 0; - assoc->init->bend_sort = NULL; - assoc->init->bend_search = NULL; - assoc->init->bend_present = NULL; - assoc->init->bend_esrequest = NULL; - assoc->init->bend_delete = NULL; - assoc->init->bend_scan = NULL; - assoc->init->bend_segment = NULL; - assoc->init->bend_fetch = NULL; - assoc->init->bend_explain = NULL; - - assoc->init->charneg_request = NULL; - assoc->init->charneg_response = NULL; - - assoc->init->decode = assoc->decode; - assoc->init->peer_name = - odr_strdup (assoc->encode, cs_addrstr(assoc->client_link)); -} - -static int srw_bend_init(association *assoc) -{ - const char *encoding = "UTF-8"; - Z_External *ce; - bend_initresult *binitres; - statserv_options_block *cb = statserv_getcontrol(); - - assoc_init_reset(assoc); - - assoc->maximumRecordSize = 3000000; - assoc->preferredMessageSize = 3000000; -#if 1 - ce = yaz_set_proposal_charneg(assoc->decode, &encoding, 1, 0, 0, 1); - assoc->init->charneg_request = ce->u.charNeg3; -#endif - if (!(binitres = (*cb->bend_init)(assoc->init))) - { - yaz_log(LOG_WARN, "Bad response from backend."); - return 0; - } - assoc->backend = binitres->handle; - return 1; -} - -static int srw_bend_fetch(association *assoc, int pos, - Z_SRW_searchRetrieveRequest *srw_req, - Z_SRW_record *record) -{ - bend_fetch_rr rr; - ODR o = assoc->encode; - - rr.setname = "default"; - rr.number = pos; - rr.referenceId = 0; - rr.request_format = VAL_TEXT_XML; - rr.request_format_raw = yaz_oidval_to_z3950oid(assoc->decode, - CLASS_TRANSYN, - VAL_TEXT_XML); - rr.comp = (Z_RecordComposition *) - odr_malloc(assoc->decode, sizeof(*rr.comp)); - rr.comp->which = Z_RecordComp_complex; - rr.comp->u.complex = (Z_CompSpec *) - odr_malloc(assoc->decode, sizeof(Z_CompSpec)); - rr.comp->u.complex->selectAlternativeSyntax = (bool_t *) - odr_malloc(assoc->encode, sizeof(bool_t)); - *rr.comp->u.complex->selectAlternativeSyntax = 0; - rr.comp->u.complex->num_dbSpecific = 0; - rr.comp->u.complex->dbSpecific = 0; - rr.comp->u.complex->num_recordSyntax = 0; - rr.comp->u.complex->recordSyntax = 0; - - rr.comp->u.complex->generic = (Z_Specification *) - odr_malloc(assoc->decode, sizeof(Z_Specification)); - rr.comp->u.complex->generic->which = Z_Schema_uri; - rr.comp->u.complex->generic->schema.uri = srw_req->recordSchema; - rr.comp->u.complex->generic->elementSpec = 0; - - rr.stream = assoc->encode; - rr.print = assoc->print; - - rr.basename = 0; - rr.len = 0; - rr.record = 0; - rr.last_in_set = 0; - rr.output_format = VAL_TEXT_XML; - rr.output_format_raw = 0; - rr.errcode = 0; - rr.errstring = 0; - rr.surrogate_flag = 0; - rr.schema = srw_req->recordSchema; - - if (!assoc->init->bend_fetch) - return 1; - - (*assoc->init->bend_fetch)(assoc->backend, &rr); - - if (rr.len >= 0) - { - record->recordData_buf = rr.record; - record->recordData_len = rr.len; - record->recordPosition = odr_intdup(o, pos); - if (rr.schema) - record->recordSchema = odr_strdup(o, rr.schema); - else - record->recordSchema = 0; - } - return rr.errcode; -} - -static void srw_bend_search(association *assoc, request *req, - Z_SRW_searchRetrieveRequest *srw_req, - Z_SRW_searchRetrieveResponse *srw_res) -{ - int srw_error = 0; - bend_search_rr rr; - Z_External *ext; - - yaz_log(LOG_LOG, "Got SRW SearchRetrieveRequest"); - yaz_log(LOG_DEBUG, "srw_bend_search"); - if (!assoc->init) - { - yaz_log(LOG_DEBUG, "srw_bend_init"); - if (!srw_bend_init(assoc)) - { - srw_error = 3; /* assume Authentication error */ - - srw_res->num_diagnostics = 1; - srw_res->diagnostics = (Z_SRW_diagnostic *) - odr_malloc(assoc->encode, sizeof(*srw_res->diagnostics)); - srw_res->diagnostics[0].code = - odr_intdup(assoc->encode, srw_error); - srw_res->diagnostics[0].details = 0; - return; - } - } - - rr.setname = "default"; - rr.replace_set = 1; - rr.num_bases = 1; - rr.basenames = &srw_req->database; - rr.referenceId = 0; - - rr.query = (Z_Query *) odr_malloc (assoc->decode, sizeof(*rr.query)); - - if (srw_req->query_type == Z_SRW_query_type_cql) - { - ext = (Z_External *) odr_malloc(assoc->decode, sizeof(*ext)); - ext->direct_reference = odr_getoidbystr(assoc->decode, - "1.2.840.10003.16.2"); - ext->indirect_reference = 0; - ext->descriptor = 0; - ext->which = Z_External_CQL; - ext->u.cql = srw_req->query.cql; - - rr.query->which = Z_Query_type_104; - rr.query->u.type_104 = ext; - } - else if (srw_req->query_type == Z_SRW_query_type_pqf) - { - Z_RPNQuery *RPNquery; - YAZ_PQF_Parser pqf_parser; - - pqf_parser = yaz_pqf_create (); - - RPNquery = yaz_pqf_parse (pqf_parser, assoc->decode, - srw_req->query.pqf); - if (!RPNquery) - { - const char *pqf_msg; - size_t off; - int code = yaz_pqf_error (pqf_parser, &pqf_msg, &off); - yaz_log(LOG_LOG, "%*s^\n", off+4, ""); - yaz_log(LOG_LOG, "Bad PQF: %s (code %d)\n", pqf_msg, code); - - srw_error = 10; - } - - rr.query->which = Z_Query_type_1; - rr.query->u.type_1 = RPNquery; - - yaz_pqf_destroy (pqf_parser); - } - else - srw_error = 11; - - if (!srw_error && srw_req->sort_type != Z_SRW_sort_type_none) - srw_error = 80; - - if (!srw_error && !assoc->init->bend_search) - srw_error = 1; - - if (srw_error) - { - yaz_log(LOG_DEBUG, "srw_bend_search returned SRW error %d", srw_error); - srw_res->num_diagnostics = 1; - srw_res->diagnostics = (Z_SRW_diagnostic *) - odr_malloc(assoc->encode, sizeof(*srw_res->diagnostics)); - srw_res->diagnostics[0].code = - odr_intdup(assoc->encode, srw_error); - srw_res->diagnostics[0].details = 0; - return; - } - - rr.stream = assoc->encode; - rr.decode = assoc->decode; - rr.print = assoc->print; - rr.request = req; - rr.association = assoc; - rr.fd = 0; - rr.hits = 0; - rr.errcode = 0; - rr.errstring = 0; - rr.search_info = 0; - yaz_log_zquery(rr.query); - (assoc->init->bend_search)(assoc->backend, &rr); - srw_res->numberOfRecords = odr_intdup(assoc->encode, rr.hits); - if (rr.errcode) - { - yaz_log(LOG_DEBUG, "bend_search returned Bib-1 code %d", rr.errcode); - srw_res->num_diagnostics = 1; - srw_res->diagnostics = (Z_SRW_diagnostic *) - odr_malloc(assoc->encode, sizeof(*srw_res->diagnostics)); - srw_res->diagnostics[0].code = - odr_intdup(assoc->encode, - yaz_diag_bib1_to_srw (rr.errcode)); - srw_res->diagnostics[0].details = rr.errstring; - yaz_log(LOG_DEBUG, "srw_bend_search returned SRW error %d", - *srw_res->diagnostics[0].code); - - } - else - { - int number = srw_req->maximumRecords ? *srw_req->maximumRecords : 0; - int start = srw_req->startRecord ? *srw_req->startRecord : 1; - - yaz_log(LOG_LOG, "Request to pack %d+%d out of %d", - start, number, rr.hits); - - srw_res->numberOfRecords = odr_intdup(assoc->encode, rr.hits); - if (number > 0) - { - int i; - - if (start > rr.hits) - { - yaz_log(LOG_LOG, "Request out or range"); - } - else - { - int j = 0; - int packing = Z_SRW_recordPacking_string; - if (start + number > rr.hits) - number = rr.hits - start + 1; - if (srw_req->recordPacking && - !strcmp(srw_req->recordPacking, "xml")) - packing = Z_SRW_recordPacking_XML; - srw_res->records = (Z_SRW_record *) - odr_malloc(assoc->encode, - number * sizeof(*srw_res->records)); - for (i = 0; irecords[j].recordPacking = packing; - srw_res->records[j].recordData_buf = 0; - yaz_log(LOG_DEBUG, "srw_bend_fetch %d", i+start); - errcode = srw_bend_fetch(assoc, i+start, srw_req, - srw_res->records + j); - if (errcode) - { - srw_res->num_diagnostics = 1; - srw_res->diagnostics = (Z_SRW_diagnostic *) - odr_malloc(assoc->encode, - sizeof(*srw_res->diagnostics)); - srw_res->diagnostics[0].code = - odr_intdup(assoc->encode, - yaz_diag_bib1_to_srw (errcode)); - srw_res->diagnostics[0].details = rr.errstring; - break; - } - if (srw_res->records[j].recordData_buf) - j++; - } - srw_res->num_records = j; - if (!j) - srw_res->records = 0; - } - } - } -} - - -static void srw_bend_explain(association *assoc, request *req, - Z_SRW_explainRequest *srw_req, - Z_SRW_explainResponse *srw_res) -{ - yaz_log(LOG_LOG, "Got SRW ExplainRequest"); - if (!assoc->init) - { - yaz_log(LOG_DEBUG, "srw_bend_init"); - if (!srw_bend_init(assoc)) - return; - } - if (assoc->init && assoc->init->bend_explain) - { - bend_explain_rr rr; - - rr.stream = assoc->encode; - rr.decode = assoc->decode; - rr.print = assoc->print; - rr.explain_buf = 0; - (*assoc->init->bend_explain)(assoc->backend, &rr); - if (rr.explain_buf) - { - srw_res->explainData_buf = rr.explain_buf; - srw_res->explainData_len = strlen(rr.explain_buf); - } - } -} - -static int hex_digit (int ch) -{ - if (ch >= '0' && ch <= '9') - return ch - '0'; - else if (ch >= 'a' && ch <= 'f') - return ch - 'a'+10; - else if (ch >= 'A' && ch <= 'F') - return ch - 'A'+10; - return 0; -} - -static char *uri_val(const char *path, const char *name, ODR o) -{ - size_t nlen = strlen(name); - if (*path != '?') - return 0; - path++; - while (path && *path) - { - const char *p1 = strchr(path, '='); - if (!p1) - break; - if ((size_t)(p1 - path) == nlen && !memcmp(path, name, nlen)) - { - size_t i = 0; - char *ret; - - path = p1 + 1; - p1 = strchr(path, '&'); - if (!p1) - p1 = strlen(path) + path; - ret = odr_malloc(o, p1 - path + 1); - while (*path && *path != '&') - { - if (*path == '+') - { - ret[i++] = ' '; - path++; - } - else if (*path == '%' && path[1] && path[2]) - { - ret[i++] = hex_digit (path[1])*16 + hex_digit (path[2]); - path = path + 3; - } - else - ret[i++] = *path++; - } - ret[i] = '\0'; - return ret; - } - path = strchr(p1, '&'); - if (path) - path++; - } - return 0; -} - -void uri_val_int(const char *path, const char *name, ODR o, int **intp) -{ - const char *v = uri_val(path, name, o); - if (v) - *intp = odr_intdup(o, atoi(v)); -} - -static void process_http_request(association *assoc, request *req) -{ - Z_HTTP_Request *hreq = req->gdu_request->u.HTTP_Request; - ODR o = assoc->encode; - Z_GDU *p = 0; - Z_HTTP_Response *hres = 0; - int keepalive = 1; - - if (!strcmp(hreq->method, "GET")) - { - char *db = "Default"; - const char *p0 = hreq->path, *p1; -#if HAVE_XML2 - int ret = -1; - char *charset = 0; - Z_SOAP *soap_package = 0; - static Z_SOAP_Handler soap_handlers[2] = { - {"http://www.loc.gov/zing/srw/v1.0/", 0, - (Z_SOAP_fun) yaz_srw_codec}, - {0, 0, 0} - }; -#endif - - if (*p0 == '/') - p0++; - p1 = strchr(p0, '?'); - if (!p1) - p1 = p0 + strlen(p0); - if (p1 != p0) - { - db = odr_malloc(assoc->decode, p1 - p0 + 1); - memcpy (db, p0, p1 - p0); - db[p1 - p0] = '\0'; - } -#if HAVE_XML2 - if (p1 && *p1 == '?' && p1[1]) - { - Z_SRW_PDU *res = yaz_srw_get(o, Z_SRW_searchRetrieve_response); - Z_SRW_PDU *sr = yaz_srw_get(o, Z_SRW_searchRetrieve_request); - char *query = uri_val(p1, "query", o); - char *pQuery = uri_val(p1, "pQuery", o); - char *sortKeys = uri_val(p1, "sortKeys", o); - - if (query) - { - sr->u.request->query_type = Z_SRW_query_type_cql; - sr->u.request->query.cql = query; - } - if (pQuery) - { - sr->u.request->query_type = Z_SRW_query_type_pqf; - sr->u.request->query.pqf = pQuery; - } - if (sortKeys) - { - sr->u.request->sort_type = Z_SRW_sort_type_sort; - sr->u.request->sort.sortKeys = sortKeys; - } - sr->u.request->recordSchema = uri_val(p1, "recordSchema", o); - sr->u.request->recordPacking = uri_val(p1, "recordPacking", o); - if (!sr->u.request->recordPacking) - sr->u.request->recordPacking = "xml"; - uri_val_int(p1, "maximumRecords", o, - &sr->u.request->maximumRecords); - uri_val_int(p1, "startRecord", o, - &sr->u.request->startRecord); - if (sr->u.request->startRecord) - yaz_log(LOG_LOG, "startRecord=%d", *sr->u.request->startRecord); - sr->u.request->database = db; - srw_bend_search(assoc, req, sr->u.request, res->u.response); - - soap_package = odr_malloc(o, sizeof(*soap_package)); - soap_package->which = Z_SOAP_generic; - - soap_package->u.generic = - odr_malloc(o, sizeof(*soap_package->u.generic)); - - soap_package->u.generic->p = res; - soap_package->u.generic->ns = soap_handlers[0].ns; - soap_package->u.generic->no = 0; - - soap_package->ns = "SRU"; - - p = z_get_HTTP_Response(o, 200); - hres = p->u.HTTP_Response; - - ret = z_soap_codec_enc(assoc->encode, &soap_package, - &hres->content_buf, &hres->content_len, - soap_handlers, charset); - if (!charset) - z_HTTP_header_add(o, &hres->headers, "Content-Type", "text/xml"); - else - { - char ctype[60]; - strcpy(ctype, "text/xml; charset="); - strcat(ctype, charset); - z_HTTP_header_add(o, &hres->headers, "Content-Type", ctype); - } - - } - else - { - Z_SRW_PDU *res = yaz_srw_get(o, Z_SRW_explain_response); - Z_SRW_PDU *sr = yaz_srw_get(o, Z_SRW_explain_request); - - srw_bend_explain(assoc, req, sr->u.explain_request, - res->u.explain_response); - - if (res->u.explain_response->explainData_buf) - { - soap_package = odr_malloc(o, sizeof(*soap_package)); - soap_package->which = Z_SOAP_generic; - - soap_package->u.generic = - odr_malloc(o, sizeof(*soap_package->u.generic)); - - soap_package->u.generic->p = res; - soap_package->u.generic->ns = soap_handlers[0].ns; - soap_package->u.generic->no = 0; - - soap_package->ns = "SRU"; - - p = z_get_HTTP_Response(o, 200); - hres = p->u.HTTP_Response; - - ret = z_soap_codec_enc(assoc->encode, &soap_package, - &hres->content_buf, &hres->content_len, - soap_handlers, charset); - if (!charset) - z_HTTP_header_add(o, &hres->headers, "Content-Type", "text/xml"); - else - { - char ctype[60]; - strcpy(ctype, "text/xml; charset="); - strcat(ctype, charset); - z_HTTP_header_add(o, &hres->headers, "Content-Type", - ctype); - } - } - } -#endif -#ifdef DOCDIR - if (strlen(hreq->path) >= 5 && strlen(hreq->path) < 80 && - !memcmp(hreq->path, "/doc/", 5)) - { - FILE *f; - char fpath[120]; - - strcpy(fpath, DOCDIR); - strcat(fpath, hreq->path+4); - f = fopen(fpath, "rb"); - if (f) { - struct stat sbuf; - if (fstat(fileno(f), &sbuf) || !S_ISREG(sbuf.st_mode)) - { - fclose(f); - f = 0; - } - } - if (f) - { - long sz; - fseek(f, 0L, SEEK_END); - sz = ftell(f); - if (sz >= 0 && sz < 500000) - { - const char *ctype = "application/octet-stream"; - const char *cp; - - p = z_get_HTTP_Response(o, 200); - hres = p->u.HTTP_Response; - hres->content_buf = (char *) odr_malloc(o, sz + 1); - hres->content_len = sz; - fseek(f, 0L, SEEK_SET); - fread(hres->content_buf, 1, sz, f); - if ((cp = strrchr(fpath, '.'))) { - cp++; - if (!strcmp(cp, "png")) - ctype = "image/png"; - else if (!strcmp(cp, "gif")) - ctype = "image/gif"; - else if (!strcmp(cp, "xml")) - ctype = "text/xml"; - else if (!strcmp(cp, "html")) - ctype = "text/html"; - } - z_HTTP_header_add(o, &hres->headers, "Content-Type", ctype); - } - fclose(f); - } - } -#endif - -#if 0 - if (!strcmp(hreq->path, "/")) - { -#ifdef DOCDIR - struct stat sbuf; -#endif - const char *doclink = ""; - p = z_get_HTTP_Response(o, 200); - hres = p->u.HTTP_Response; - hres->content_buf = (char *) odr_malloc(o, 400); -#ifdef DOCDIR - if (stat(DOCDIR "/yaz.html", &sbuf) == 0 && S_ISREG(sbuf.st_mode)) - doclink = "

Documentation

"; -#endif - sprintf (hres->content_buf, - "\n" - "\n" - " \n" - " YAZ " YAZ_VERSION "\n" - " \n" - " \n" - "

YAZ " - YAZ_VERSION "

\n" - "%s" - " \n" - "\n", doclink); - hres->content_len = strlen(hres->content_buf); - z_HTTP_header_add(o, &hres->headers, "Content-Type", "text/html"); - } -#endif - - if (!p) - { - p = z_get_HTTP_Response(o, 404); - } - } - else if (!strcmp(hreq->method, "POST")) - { - const char *content_type = z_HTTP_header_lookup(hreq->headers, - "Content-Type"); - if (content_type && !yaz_strcmp_del("text/xml", content_type, "; ")) - { - Z_SOAP *soap_package = 0; - int ret = -1; - int http_code = 500; - const char *charset_p = 0; - char *charset = 0; - - static Z_SOAP_Handler soap_handlers[2] = { -#if HAVE_XML2 - {"http://www.loc.gov/zing/srw/v1.0/", 0, - (Z_SOAP_fun) yaz_srw_codec}, -#endif - {0, 0, 0} - }; - if ((charset_p = strstr(content_type, "; charset="))) - { - int i = 0; - charset_p += 10; - while (i < 20 && charset_p[i] && - !strchr("; \n\r", charset_p[i])) - i++; - charset = odr_malloc(assoc->encode, i+1); - memcpy(charset, charset_p, i); - charset[i] = '\0'; - yaz_log(LOG_LOG, "SOAP encoding %s", charset); - } - ret = z_soap_codec(assoc->decode, &soap_package, - &hreq->content_buf, &hreq->content_len, - soap_handlers); -#if HAVE_XML2 - if (!ret && soap_package->which == Z_SOAP_generic && - soap_package->u.generic->no == 0) - { - /* SRW package */ - Z_SRW_PDU *sr = soap_package->u.generic->p; - - if (sr->which == Z_SRW_searchRetrieve_request) - { - Z_SRW_PDU *res = - yaz_srw_get(assoc->encode, - Z_SRW_searchRetrieve_response); - - if (!sr->u.request->database) - { - const char *p0 = hreq->path, *p1; - if (*p0 == '/') - p0++; - p1 = strchr(p0, '?'); - if (!p1) - p1 = p0 + strlen(p0); - if (p1 != p0) - { - sr->u.request->database = - odr_malloc(assoc->decode, p1 - p0 + 1); - memcpy (sr->u.request->database, p0, p1 - p0); - sr->u.request->database[p1 - p0] = '\0'; - } - else - sr->u.request->database = "Default"; - } - srw_bend_search(assoc, req, sr->u.request, - res->u.response); - - soap_package->u.generic->p = res; - http_code = 200; - } - else if (sr->which == Z_SRW_explain_request) - { - Z_SRW_PDU *res = - yaz_srw_get(assoc->encode, Z_SRW_explain_response); - - srw_bend_explain(assoc, req, sr->u.explain_request, - res->u.explain_response); - if (!res->u.explain_response->explainData_buf) - { - z_soap_error(assoc->encode, soap_package, - "SOAP-ENV:Client", "Explain Not Supported", 0); - } - else - { - soap_package->u.generic->p = res; - http_code = 200; - } - } - else - { - z_soap_error(assoc->encode, soap_package, - "SOAP-ENV:Client", "Bad method", 0); - } - } -#endif - p = z_get_HTTP_Response(o, 200); - hres = p->u.HTTP_Response; - ret = z_soap_codec_enc(assoc->encode, &soap_package, - &hres->content_buf, &hres->content_len, - soap_handlers, charset); - hres->code = http_code; - if (!charset) - z_HTTP_header_add(o, &hres->headers, "Content-Type", "text/xml"); - else - { - char ctype[60]; - strcpy(ctype, "text/xml; charset="); - strcat(ctype, charset); - z_HTTP_header_add(o, &hres->headers, "Content-Type", ctype); - } - } - if (!p) /* still no response ? */ - p = z_get_HTTP_Response(o, 500); - } - else - { - p = z_get_HTTP_Response(o, 405); - hres = p->u.HTTP_Response; - - z_HTTP_header_add(o, &hres->headers, "Allow", "GET, POST"); - } - hres = p->u.HTTP_Response; - if (!strcmp(hreq->version, "1.0")) - { - const char *v = z_HTTP_header_lookup(hreq->headers, "Connection"); - if (v && !strcmp(v, "Keep-Alive")) - keepalive = 1; - else - keepalive = 0; - hres->version = "1.0"; - } - else - { - const char *v = z_HTTP_header_lookup(hreq->headers, "Connection"); - if (v && !strcmp(v, "close")) - keepalive = 0; - else - keepalive = 1; - hres->version = "1.1"; - } - if (!keepalive) - { - z_HTTP_header_add(o, &hres->headers, "Connection", "close"); - assoc->state = ASSOC_DEAD; - } - else - { - int t; - const char *alive = z_HTTP_header_lookup(hreq->headers, "Keep-Alive"); - - if (alive && isdigit(*alive)) - t = atoi(alive); - else - t = 15; - if (t < 0 || t > 3600) - t = 3600; - iochan_settimeout(assoc->client_chan,t); - z_HTTP_header_add(o, &hres->headers, "Connection", "Keep-Alive"); - } - process_gdu_response(assoc, req, p); -} - -static void process_gdu_request(association *assoc, request *req) -{ - if (req->gdu_request->which == Z_GDU_Z3950) - { - char *msg = 0; - req->apdu_request = req->gdu_request->u.z3950; - if (process_z_request(assoc, req, &msg) < 0) - do_close_req(assoc, Z_Close_systemProblem, msg, req); - } - else if (req->gdu_request->which == Z_GDU_HTTP_Request) - process_http_request(assoc, req); - else - { - do_close_req(assoc, Z_Close_systemProblem, "bad protocol packet", req); - } -} - -/* - * Initiate request processing. - */ -static int process_z_request(association *assoc, request *req, char **msg) -{ - int fd = -1; - Z_APDU *res; - int retval; - - *msg = "Unknown Error"; - assert(req && req->state == REQUEST_IDLE); - if (req->apdu_request->which != Z_APDU_initRequest && !assoc->init) - { - *msg = "Missing InitRequest"; - return -1; - } - switch (req->apdu_request->which) - { - case Z_APDU_initRequest: - iochan_settimeout(assoc->client_chan, - statserv_getcontrol()->idle_timeout * 60); - res = process_initRequest(assoc, req); break; - case Z_APDU_searchRequest: - res = process_searchRequest(assoc, req, &fd); break; - case Z_APDU_presentRequest: - res = process_presentRequest(assoc, req, &fd); break; - case Z_APDU_scanRequest: - if (assoc->init->bend_scan) - res = process_scanRequest(assoc, req, &fd); - else - { - *msg = "Cannot handle Scan APDU"; - return -1; - } - break; - case Z_APDU_extendedServicesRequest: - if (assoc->init->bend_esrequest) - res = process_ESRequest(assoc, req, &fd); - else - { - *msg = "Cannot handle Extended Services APDU"; - return -1; - } - break; - case Z_APDU_sortRequest: - if (assoc->init->bend_sort) - res = process_sortRequest(assoc, req, &fd); - else - { - *msg = "Cannot handle Sort APDU"; - return -1; - } - break; - case Z_APDU_close: - process_close(assoc, req); - return 0; - case Z_APDU_deleteResultSetRequest: - if (assoc->init->bend_delete) - res = process_deleteRequest(assoc, req, &fd); - else - { - *msg = "Cannot handle Delete APDU"; - return -1; - } - break; - case Z_APDU_segmentRequest: - if (assoc->init->bend_segment) - { - res = process_segmentRequest (assoc, req); - } - else - { - *msg = "Cannot handle Segment APDU"; - return -1; - } - break; - default: - *msg = "Bad APDU received"; - return -1; - } - if (res) - { - yaz_log(LOG_DEBUG, " result immediately available"); - retval = process_z_response(assoc, req, res); - } - else if (fd < 0) - { - yaz_log(LOG_DEBUG, " result unavailble"); - retval = 0; - } - else /* no result yet - one will be provided later */ - { - IOCHAN chan; - - /* Set up an I/O handler for the fd supplied by the backend */ - - yaz_log(LOG_DEBUG, " establishing handler for result"); - req->state = REQUEST_PENDING; - if (!(chan = iochan_create(fd, backend_response, EVENT_INPUT))) - abort(); - iochan_setdata(chan, assoc); - retval = 0; - } - return retval; -} - -/* - * Handle message from the backend. - */ -void backend_response(IOCHAN i, int event) -{ - association *assoc = (association *)iochan_getdata(i); - request *req = request_head(&assoc->incoming); - Z_APDU *res; - int fd; - - yaz_log(LOG_DEBUG, "backend_response"); - assert(assoc && req && req->state != REQUEST_IDLE); - /* determine what it is we're waiting for */ - switch (req->apdu_request->which) - { - case Z_APDU_searchRequest: - res = response_searchRequest(assoc, req, 0, &fd); break; -#if 0 - case Z_APDU_presentRequest: - res = response_presentRequest(assoc, req, 0, &fd); break; - case Z_APDU_scanRequest: - res = response_scanRequest(assoc, req, 0, &fd); break; -#endif - default: - yaz_log(LOG_WARN, "Serious programmer's lapse or bug"); - abort(); - } - if ((res && process_z_response(assoc, req, res) < 0) || fd < 0) - { - yaz_log(LOG_LOG, "Fatal error when talking to backend"); - do_close(assoc, Z_Close_systemProblem, 0); - iochan_destroy(i); - return; - } - else if (!res) /* no result yet - try again later */ - { - yaz_log(LOG_DEBUG, " no result yet"); - iochan_setfd(i, fd); /* in case fd has changed */ - } -} - -/* - * Encode response, and transfer the request structure to the outgoing queue. - */ -static int process_gdu_response(association *assoc, request *req, Z_GDU *res) -{ - odr_setbuf(assoc->encode, req->response, req->size_response, 1); - - if (assoc->print && !z_GDU(assoc->print, &res, 0, 0)) - { - yaz_log(LOG_WARN, "ODR print error: %s", - odr_errmsg(odr_geterror(assoc->print))); - odr_reset(assoc->print); - } - if (!z_GDU(assoc->encode, &res, 0, 0)) - { - yaz_log(LOG_WARN, "ODR error when encoding PDU: %s [element %s]", - odr_errmsg(odr_geterror(assoc->decode)), - odr_getelement(assoc->decode)); - request_release(req); - return -1; - } - req->response = odr_getbuf(assoc->encode, &req->len_response, - &req->size_response); - odr_setbuf(assoc->encode, 0, 0, 0); /* don'txfree if we abort later */ - odr_reset(assoc->encode); - req->state = REQUEST_IDLE; - request_enq(&assoc->outgoing, req); - /* turn the work over to the ir_session handler */ - iochan_setflag(assoc->client_chan, EVENT_OUTPUT); - assoc->cs_put_mask = EVENT_OUTPUT; - /* Is there more work to be done? give that to the input handler too */ -#if 1 - if (request_head(&assoc->incoming)) - { - yaz_log (LOG_DEBUG, "more work to be done"); - iochan_setevent(assoc->client_chan, EVENT_WORK); - } -#endif - return 0; -} - -/* - * Encode response, and transfer the request structure to the outgoing queue. - */ -static int process_z_response(association *assoc, request *req, Z_APDU *res) -{ - Z_GDU *gres = (Z_GDU *) odr_malloc(assoc->encode, sizeof(*res)); - gres->which = Z_GDU_Z3950; - gres->u.z3950 = res; - - return process_gdu_response(assoc, req, gres); -} - - -/* - * Handle init request. - * At the moment, we don't check the options - * anywhere else in the code - we just try not to do anything that would - * break a naive client. We'll toss 'em into the association block when - * we need them there. - */ -static Z_APDU *process_initRequest(association *assoc, request *reqb) -{ - statserv_options_block *cb = statserv_getcontrol(); - Z_InitRequest *req = reqb->apdu_request->u.initRequest; - Z_APDU *apdu = zget_APDU(assoc->encode, Z_APDU_initResponse); - Z_InitResponse *resp = apdu->u.initResponse; - bend_initresult *binitres; - - char options[140]; - - yaz_log(LOG_LOG, "Got initRequest"); - if (req->implementationId) - yaz_log(LOG_LOG, "Id: %s", req->implementationId); - if (req->implementationName) - yaz_log(LOG_LOG, "Name: %s", req->implementationName); - if (req->implementationVersion) - yaz_log(LOG_LOG, "Version: %s", req->implementationVersion); - - assoc_init_reset(assoc); - - assoc->init->auth = req->idAuthentication; - assoc->init->referenceId = req->referenceId; - - if (ODR_MASK_GET(req->options, Z_Options_negotiationModel)) - { - Z_CharSetandLanguageNegotiation *negotiation = - yaz_get_charneg_record (req->otherInfo); - if (negotiation->which == Z_CharSetandLanguageNegotiation_proposal) - assoc->init->charneg_request = negotiation; - } - - if (!(binitres = (*cb->bend_init)(assoc->init))) - { - yaz_log(LOG_WARN, "Bad response from backend."); - return 0; - } - - assoc->backend = binitres->handle; - if ((assoc->init->bend_sort)) - yaz_log (LOG_DEBUG, "Sort handler installed"); - if ((assoc->init->bend_search)) - yaz_log (LOG_DEBUG, "Search handler installed"); - if ((assoc->init->bend_present)) - yaz_log (LOG_DEBUG, "Present handler installed"); - if ((assoc->init->bend_esrequest)) - yaz_log (LOG_DEBUG, "ESRequest handler installed"); - if ((assoc->init->bend_delete)) - yaz_log (LOG_DEBUG, "Delete handler installed"); - if ((assoc->init->bend_scan)) - yaz_log (LOG_DEBUG, "Scan handler installed"); - if ((assoc->init->bend_segment)) - yaz_log (LOG_DEBUG, "Segment handler installed"); - - resp->referenceId = req->referenceId; - *options = '\0'; - /* let's tell the client what we can do */ - if (ODR_MASK_GET(req->options, Z_Options_search)) - { - ODR_MASK_SET(resp->options, Z_Options_search); - strcat(options, "srch"); - } - if (ODR_MASK_GET(req->options, Z_Options_present)) - { - ODR_MASK_SET(resp->options, Z_Options_present); - strcat(options, " prst"); - } - if (ODR_MASK_GET(req->options, Z_Options_delSet) && - assoc->init->bend_delete) - { - ODR_MASK_SET(resp->options, Z_Options_delSet); - strcat(options, " del"); - } - if (ODR_MASK_GET(req->options, Z_Options_extendedServices) && - assoc->init->bend_esrequest) - { - ODR_MASK_SET(resp->options, Z_Options_extendedServices); - strcat (options, " extendedServices"); - } - if (ODR_MASK_GET(req->options, Z_Options_namedResultSets)) - { - ODR_MASK_SET(resp->options, Z_Options_namedResultSets); - strcat(options, " namedresults"); - } - if (ODR_MASK_GET(req->options, Z_Options_scan) && assoc->init->bend_scan) - { - ODR_MASK_SET(resp->options, Z_Options_scan); - strcat(options, " scan"); - } - if (ODR_MASK_GET(req->options, Z_Options_concurrentOperations)) - { - ODR_MASK_SET(resp->options, Z_Options_concurrentOperations); - strcat(options, " concurrop"); - } - if (ODR_MASK_GET(req->options, Z_Options_sort) && assoc->init->bend_sort) - { - ODR_MASK_SET(resp->options, Z_Options_sort); - strcat(options, " sort"); - } - - if (ODR_MASK_GET(req->options, Z_Options_negotiationModel) - && assoc->init->charneg_response) - { - Z_OtherInformation **p; - Z_OtherInformationUnit *p0; - - yaz_oi_APDU(apdu, &p); - - if ((p0=yaz_oi_update(p, assoc->encode, NULL, 0, 0))) { - ODR_MASK_SET(resp->options, Z_Options_negotiationModel); - - p0->which = Z_OtherInfo_externallyDefinedInfo; - p0->information.externallyDefinedInfo = - assoc->init->charneg_response; - } - ODR_MASK_SET(resp->options, Z_Options_negotiationModel); - strcat(options, " negotiation"); - } - - if (ODR_MASK_GET(req->protocolVersion, Z_ProtocolVersion_1)) - { - ODR_MASK_SET(resp->protocolVersion, Z_ProtocolVersion_1); - assoc->version = 2; /* 1 & 2 are equivalent */ - } - if (ODR_MASK_GET(req->protocolVersion, Z_ProtocolVersion_2)) - { - ODR_MASK_SET(resp->protocolVersion, Z_ProtocolVersion_2); - assoc->version = 2; - } - if (ODR_MASK_GET(req->protocolVersion, Z_ProtocolVersion_3)) - { - ODR_MASK_SET(resp->protocolVersion, Z_ProtocolVersion_3); - assoc->version = 3; - } - - yaz_log(LOG_LOG, "Negotiated to v%d: %s", assoc->version, options); - assoc->maximumRecordSize = *req->maximumRecordSize; - if (assoc->maximumRecordSize > control_block->maxrecordsize) - assoc->maximumRecordSize = control_block->maxrecordsize; - assoc->preferredMessageSize = *req->preferredMessageSize; - if (assoc->preferredMessageSize > assoc->maximumRecordSize) - assoc->preferredMessageSize = assoc->maximumRecordSize; - - resp->preferredMessageSize = &assoc->preferredMessageSize; - resp->maximumRecordSize = &assoc->maximumRecordSize; - - resp->implementationName = "GFS/YAZ"; - - if (assoc->init->implementation_id) - { - char *nv = (char *) - odr_malloc (assoc->encode, - strlen(assoc->init->implementation_id) + 10 + - strlen(resp->implementationId)); - sprintf (nv, "%s / %s", - resp->implementationId, assoc->init->implementation_id); - resp->implementationId = nv; - } - if (assoc->init->implementation_name) - { - char *nv = (char *) - odr_malloc (assoc->encode, - strlen(assoc->init->implementation_name) + 10 + - strlen(resp->implementationName)); - sprintf (nv, "%s / %s", - resp->implementationName, assoc->init->implementation_name); - resp->implementationName = nv; - } - if (assoc->init->implementation_version) - { - char *nv = (char *) - odr_malloc (assoc->encode, - strlen(assoc->init->implementation_version) + 10 + - strlen(resp->implementationVersion)); - sprintf (nv, "YAZ %s / %s", - resp->implementationVersion, - assoc->init->implementation_version); - resp->implementationVersion = nv; - } - - if (binitres->errcode) - { - yaz_log(LOG_LOG, "Connection rejected by backend."); - *resp->result = 0; - assoc->state = ASSOC_DEAD; - resp->userInformationField = init_diagnostics(assoc->encode, - binitres->errcode, - binitres->errstring); - } - else - assoc->state = ASSOC_UP; - return apdu; -} - -/* - * Diagnostic in default format, to be returned as either a surrogate - * or non-surrogate diagnostic in the context of an open session, or - * as User-information when an Init is refused. - */ -static Z_DefaultDiagFormat *justdiag(ODR odr, int error, char *addinfo) -{ - int *err = odr_intdup(odr, error); - Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *) - odr_malloc (odr, sizeof(*dr)); - - yaz_log(LOG_LOG, "[%d] %s%s%s", error, diagbib1_str(error), - addinfo ? " -- " : "", addinfo ? addinfo : ""); - - dr->diagnosticSetId = - yaz_oidval_to_z3950oid (odr, CLASS_DIAGSET, VAL_BIB1); - dr->condition = err; - dr->which = Z_DefaultDiagFormat_v2Addinfo; - dr->u.v2Addinfo = odr_strdup (odr, addinfo ? addinfo : ""); - return dr; -} - -/* - * Set the specified `errcode' and `errstring' into a UserInfo-1 - * external to be returned to the client in accordance with Z35.90 - * Implementor Agreement 5 (Returning diagnostics in an InitResponse): - * http://lcweb.loc.gov/z3950/agency/agree/initdiag.html - */ -static Z_External *init_diagnostics(ODR odr, int error, char *addinfo) -{ - Z_External *x, *x2; - oident oid; - Z_OtherInformation *u; - Z_OtherInformationUnit *l; - Z_DiagnosticFormat *d; - Z_DiagnosticFormat_s *e; - - x = (Z_External*) odr_malloc(odr, sizeof *x); - x->descriptor = 0; - x->indirect_reference = 0; - oid.proto = PROTO_Z3950; - oid.oclass = CLASS_USERINFO; - oid.value = VAL_USERINFO1; - x->direct_reference = odr_oiddup(odr, oid_getoidbyent(&oid)); - x->which = Z_External_userInfo1; - - u = odr_malloc(odr, sizeof *u); - x->u.userInfo1 = u; - u->num_elements = 1; - u->list = (Z_OtherInformationUnit**) odr_malloc(odr, sizeof *u->list); - u->list[0] = (Z_OtherInformationUnit*) odr_malloc(odr, sizeof *u->list[0]); - l = u->list[0]; - l->category = 0; - l->which = Z_OtherInfo_externallyDefinedInfo; - - x2 = (Z_External*) odr_malloc(odr, sizeof *x); - l->information.externallyDefinedInfo = x2; - x2->descriptor = 0; - x2->indirect_reference = 0; - oid.oclass = CLASS_DIAGSET; - oid.value = VAL_DIAG1; - x2->direct_reference = odr_oiddup(odr, oid_getoidbyent(&oid)); - x2->which = Z_External_diag1; - - d = (Z_DiagnosticFormat*) odr_malloc(odr, sizeof *d); - x2->u.diag1 = d; - d->num = 1; - d->elements = (Z_DiagnosticFormat_s**) odr_malloc (odr, sizeof *d->elements); - d->elements[0] = (Z_DiagnosticFormat_s*) odr_malloc (odr, sizeof *d->elements[0]); - e = d->elements[0]; - - e->which = Z_DiagnosticFormat_s_defaultDiagRec; - e->u.defaultDiagRec = justdiag(odr, error, addinfo); - return x; -} - -/* - * nonsurrogate diagnostic record. - */ -static Z_Records *diagrec(association *assoc, int error, char *addinfo) -{ - Z_Records *rec = (Z_Records *) - odr_malloc (assoc->encode, sizeof(*rec)); - rec->which = Z_Records_NSD; - rec->u.nonSurrogateDiagnostic = justdiag(assoc->encode, error, addinfo); - return rec; -} - -/* - * surrogate diagnostic. - */ -static Z_NamePlusRecord *surrogatediagrec(association *assoc, char *dbname, - int error, char *addinfo) -{ - Z_NamePlusRecord *rec = (Z_NamePlusRecord *) - odr_malloc (assoc->encode, sizeof(*rec)); - Z_DiagRec *drec = (Z_DiagRec *)odr_malloc (assoc->encode, sizeof(*drec)); - - yaz_log(LOG_DEBUG, "SurrogateDiagnotic: %d -- %s", error, addinfo); - rec->databaseName = dbname; - rec->which = Z_NamePlusRecord_surrogateDiagnostic; - rec->u.surrogateDiagnostic = drec; - drec->which = Z_DiagRec_defaultFormat; - drec->u.defaultFormat = justdiag(assoc->encode, error, addinfo); - - return rec; -} - -/* - * multiple nonsurrogate diagnostics. - */ -static Z_DiagRecs *diagrecs(association *assoc, int error, char *addinfo) -{ - Z_DiagRecs *recs = (Z_DiagRecs *)odr_malloc (assoc->encode, sizeof(*recs)); - int *err = odr_intdup(assoc->encode, error); - Z_DiagRec **recp = (Z_DiagRec **)odr_malloc (assoc->encode, sizeof(*recp)); - Z_DiagRec *drec = (Z_DiagRec *)odr_malloc (assoc->encode, sizeof(*drec)); - Z_DefaultDiagFormat *rec = (Z_DefaultDiagFormat *) - odr_malloc (assoc->encode, sizeof(*rec)); - - yaz_log(LOG_DEBUG, "DiagRecs: %d -- %s", error, addinfo ? addinfo : ""); - - recs->num_diagRecs = 1; - recs->diagRecs = recp; - recp[0] = drec; - drec->which = Z_DiagRec_defaultFormat; - drec->u.defaultFormat = rec; - - rec->diagnosticSetId = - yaz_oidval_to_z3950oid (assoc->encode, CLASS_DIAGSET, VAL_BIB1); - rec->condition = err; - - rec->which = Z_DefaultDiagFormat_v2Addinfo; - rec->u.v2Addinfo = odr_strdup (assoc->encode, addinfo ? addinfo : ""); - return recs; -} - -static Z_Records *pack_records(association *a, char *setname, int start, - int *num, Z_RecordComposition *comp, - int *next, int *pres, oid_value format, - Z_ReferenceId *referenceId, - int *oid) -{ - int recno, total_length = 0, toget = *num, dumped_records = 0; - Z_Records *records = - (Z_Records *) odr_malloc (a->encode, sizeof(*records)); - Z_NamePlusRecordList *reclist = - (Z_NamePlusRecordList *) odr_malloc (a->encode, sizeof(*reclist)); - Z_NamePlusRecord **list = - (Z_NamePlusRecord **) odr_malloc (a->encode, sizeof(*list) * toget); - - records->which = Z_Records_DBOSD; - records->u.databaseOrSurDiagnostics = reclist; - reclist->num_records = 0; - reclist->records = list; - *pres = Z_PRES_SUCCESS; - *num = 0; - *next = 0; - - yaz_log(LOG_LOG, "Request to pack %d+%d+%s", start, toget, setname); - yaz_log(LOG_DEBUG, "pms=%d, mrs=%d", a->preferredMessageSize, - a->maximumRecordSize); - for (recno = start; reclist->num_records < toget; recno++) - { - bend_fetch_rr freq; - Z_NamePlusRecord *thisrec; - int this_length = 0; - /* - * we get the number of bytes allocated on the stream before any - * allocation done by the backend - this should give us a reasonable - * idea of the total size of the data so far. - */ - total_length = odr_total(a->encode) - dumped_records; - freq.errcode = 0; - freq.errstring = 0; - freq.basename = 0; - freq.len = 0; - freq.record = 0; - freq.last_in_set = 0; - freq.setname = setname; - freq.surrogate_flag = 0; - freq.number = recno; - freq.comp = comp; - freq.request_format = format; - freq.request_format_raw = oid; - freq.output_format = format; - freq.output_format_raw = 0; - freq.stream = a->encode; - freq.print = a->print; - freq.referenceId = referenceId; - freq.schema = 0; - (*a->init->bend_fetch)(a->backend, &freq); - /* backend should be able to signal whether error is system-wide - or only pertaining to current record */ - if (freq.errcode) - { - if (!freq.surrogate_flag) - { - char s[20]; - *pres = Z_PRES_FAILURE; - /* for 'present request out of range', - set addinfo to record position if not set */ - if (freq.errcode == 13 && freq.errstring == 0) - { - sprintf (s, "%d", recno); - freq.errstring = s; - } - return diagrec(a, freq.errcode, freq.errstring); - } - reclist->records[reclist->num_records] = - surrogatediagrec(a, freq.basename, freq.errcode, - freq.errstring); - reclist->num_records++; - *next = freq.last_in_set ? 0 : recno + 1; - continue; - } - if (freq.len >= 0) - this_length = freq.len; - else - this_length = odr_total(a->encode) - total_length; - yaz_log(LOG_DEBUG, " fetched record, len=%d, total=%d", - this_length, total_length); - if (this_length + total_length > a->preferredMessageSize) - { - /* record is small enough, really */ - if (this_length <= a->preferredMessageSize) - { - yaz_log(LOG_DEBUG, " Dropped last normal-sized record"); - *pres = Z_PRES_PARTIAL_2; - break; - } - /* record can only be fetched by itself */ - if (this_length < a->maximumRecordSize) - { - yaz_log(LOG_DEBUG, " Record > prefmsgsz"); - if (toget > 1) - { - yaz_log(LOG_DEBUG, " Dropped it"); - reclist->records[reclist->num_records] = - surrogatediagrec(a, freq.basename, 16, 0); - reclist->num_records++; - *next = freq.last_in_set ? 0 : recno + 1; - dumped_records += this_length; - continue; - } - } - else /* too big entirely */ - { - yaz_log(LOG_LOG, "Record > maxrcdsz this=%d max=%d", this_length, a->maximumRecordSize); - reclist->records[reclist->num_records] = - surrogatediagrec(a, freq.basename, 17, 0); - reclist->num_records++; - *next = freq.last_in_set ? 0 : recno + 1; - dumped_records += this_length; - continue; - } - } - - if (!(thisrec = (Z_NamePlusRecord *) - odr_malloc(a->encode, sizeof(*thisrec)))) - return 0; - if (!(thisrec->databaseName = (char *)odr_malloc(a->encode, - strlen(freq.basename) + 1))) - return 0; - strcpy(thisrec->databaseName, freq.basename); - thisrec->which = Z_NamePlusRecord_databaseRecord; - - if (freq.output_format_raw) - { - struct oident *ident = oid_getentbyoid(freq.output_format_raw); - freq.output_format = ident->value; - } - thisrec->u.databaseRecord = z_ext_record(a->encode, freq.output_format, - freq.record, freq.len); - if (!thisrec->u.databaseRecord) - return 0; - reclist->records[reclist->num_records] = thisrec; - reclist->num_records++; - *next = freq.last_in_set ? 0 : recno + 1; - } - *num = reclist->num_records; - return records; -} - -static Z_APDU *process_searchRequest(association *assoc, request *reqb, - int *fd) -{ - Z_SearchRequest *req = reqb->apdu_request->u.searchRequest; - bend_search_rr *bsrr = - (bend_search_rr *)nmem_malloc (reqb->request_mem, sizeof(*bsrr)); - - yaz_log(LOG_LOG, "Got SearchRequest."); - bsrr->fd = fd; - bsrr->request = reqb; - bsrr->association = assoc; - bsrr->referenceId = req->referenceId; - save_referenceId (reqb, bsrr->referenceId); - - yaz_log (LOG_LOG, "ResultSet '%s'", req->resultSetName); - if (req->databaseNames) - { - int i; - for (i = 0; i < req->num_databaseNames; i++) - yaz_log (LOG_LOG, "Database '%s'", req->databaseNames[i]); - } - yaz_log_zquery(req->query); - - if (assoc->init->bend_search) - { - bsrr->setname = req->resultSetName; - bsrr->replace_set = *req->replaceIndicator; - bsrr->num_bases = req->num_databaseNames; - bsrr->basenames = req->databaseNames; - bsrr->query = req->query; - bsrr->stream = assoc->encode; - bsrr->decode = assoc->decode; - bsrr->print = assoc->print; - bsrr->errcode = 0; - bsrr->hits = 0; - bsrr->errstring = NULL; - bsrr->search_info = NULL; - (assoc->init->bend_search)(assoc->backend, bsrr); - if (!bsrr->request) - return 0; - } - return response_searchRequest(assoc, reqb, bsrr, fd); -} - -int bend_searchresponse(void *handle, bend_search_rr *bsrr) {return 0;} - -/* - * Prepare a searchresponse based on the backend results. We probably want - * to look at making the fetching of records nonblocking as well, but - * so far, we'll keep things simple. - * If bsrt is null, that means we're called in response to a communications - * event, and we'll have to get the response for ourselves. - */ -static Z_APDU *response_searchRequest(association *assoc, request *reqb, - bend_search_rr *bsrt, int *fd) -{ - Z_SearchRequest *req = reqb->apdu_request->u.searchRequest; - Z_APDU *apdu = (Z_APDU *)odr_malloc (assoc->encode, sizeof(*apdu)); - Z_SearchResponse *resp = (Z_SearchResponse *) - odr_malloc (assoc->encode, sizeof(*resp)); - int *nulint = odr_intdup (assoc->encode, 0); - bool_t *sr = odr_intdup(assoc->encode, 1); - int *next = odr_intdup(assoc->encode, 0); - int *none = odr_intdup(assoc->encode, Z_RES_NONE); - - apdu->which = Z_APDU_searchResponse; - apdu->u.searchResponse = resp; - resp->referenceId = req->referenceId; - resp->additionalSearchInfo = 0; - resp->otherInfo = 0; - *fd = -1; - if (!bsrt && !bend_searchresponse(assoc->backend, bsrt)) - { - yaz_log(LOG_FATAL, "Bad result from backend"); - return 0; - } - else if (bsrt->errcode) - { - resp->records = diagrec(assoc, bsrt->errcode, bsrt->errstring); - resp->resultCount = nulint; - resp->numberOfRecordsReturned = nulint; - resp->nextResultSetPosition = nulint; - resp->searchStatus = nulint; - resp->resultSetStatus = none; - resp->presentStatus = 0; - } - else - { - int *toget = odr_intdup(assoc->encode, 0); - int *presst = odr_intdup(assoc->encode, 0); - Z_RecordComposition comp, *compp = 0; - - yaz_log (LOG_LOG, "resultCount: %d", bsrt->hits); - - resp->records = 0; - resp->resultCount = &bsrt->hits; - - comp.which = Z_RecordComp_simple; - /* how many records does the user agent want, then? */ - if (bsrt->hits <= *req->smallSetUpperBound) - { - *toget = bsrt->hits; - if ((comp.u.simple = req->smallSetElementSetNames)) - compp = ∁ - } - else if (bsrt->hits < *req->largeSetLowerBound) - { - *toget = *req->mediumSetPresentNumber; - if (*toget > bsrt->hits) - *toget = bsrt->hits; - if ((comp.u.simple = req->mediumSetElementSetNames)) - compp = ∁ - } - else - *toget = 0; - - if (*toget && !resp->records) - { - oident *prefformat; - oid_value form; - - if (!(prefformat = oid_getentbyoid(req->preferredRecordSyntax))) - form = VAL_NONE; - else - form = prefformat->value; - resp->records = pack_records(assoc, req->resultSetName, 1, - toget, compp, next, presst, form, req->referenceId, - req->preferredRecordSyntax); - if (!resp->records) - return 0; - resp->numberOfRecordsReturned = toget; - resp->nextResultSetPosition = next; - resp->searchStatus = sr; - resp->resultSetStatus = 0; - resp->presentStatus = presst; - } - else - { - if (*resp->resultCount) - *next = 1; - resp->numberOfRecordsReturned = nulint; - resp->nextResultSetPosition = next; - resp->searchStatus = sr; - resp->resultSetStatus = 0; - resp->presentStatus = 0; - } - } - resp->additionalSearchInfo = bsrt->search_info; - return apdu; -} - -/* - * Maybe we got a little over-friendly when we designed bend_fetch to - * get only one record at a time. Some backends can optimise multiple-record - * fetches, and at any rate, there is some overhead involved in - * all that selecting and hopping around. Problem is, of course, that the - * frontend can't know ahead of time how many records it'll need to - * fill the negotiated PDU size. Annoying. Segmentation or not, Z/SR - * is downright lousy as a bulk data transfer protocol. - * - * To start with, we'll do the fetching of records from the backend - * in one operation: To save some trips in and out of the event-handler, - * and to simplify the interface to pack_records. At any rate, asynch - * operation is more fun in operations that have an unpredictable execution - * speed - which is normally more true for search than for present. - */ -static Z_APDU *process_presentRequest(association *assoc, request *reqb, - int *fd) -{ - Z_PresentRequest *req = reqb->apdu_request->u.presentRequest; - oident *prefformat; - oid_value form; - Z_APDU *apdu; - Z_PresentResponse *resp; - int *next; - int *num; - - yaz_log(LOG_LOG, "Got PresentRequest."); - - if (!(prefformat = oid_getentbyoid(req->preferredRecordSyntax))) - form = VAL_NONE; - else - form = prefformat->value; - resp = (Z_PresentResponse *)odr_malloc (assoc->encode, sizeof(*resp)); - resp->records = 0; - resp->presentStatus = odr_intdup(assoc->encode, 0); - if (assoc->init->bend_present) - { - bend_present_rr *bprr = (bend_present_rr *) - nmem_malloc (reqb->request_mem, sizeof(*bprr)); - bprr->setname = req->resultSetId; - bprr->start = *req->resultSetStartPoint; - bprr->number = *req->numberOfRecordsRequested; - bprr->format = form; - bprr->comp = req->recordComposition; - bprr->referenceId = req->referenceId; - bprr->stream = assoc->encode; - bprr->print = assoc->print; - bprr->request = reqb; - bprr->association = assoc; - bprr->errcode = 0; - bprr->errstring = NULL; - (*assoc->init->bend_present)(assoc->backend, bprr); - - if (!bprr->request) - return 0; - if (bprr->errcode) - { - resp->records = diagrec(assoc, bprr->errcode, bprr->errstring); - *resp->presentStatus = Z_PRES_FAILURE; - } - } - apdu = (Z_APDU *)odr_malloc (assoc->encode, sizeof(*apdu)); - next = odr_intdup(assoc->encode, 0); - num = odr_intdup(assoc->encode, 0); - - apdu->which = Z_APDU_presentResponse; - apdu->u.presentResponse = resp; - resp->referenceId = req->referenceId; - resp->otherInfo = 0; - - if (!resp->records) - { - *num = *req->numberOfRecordsRequested; - resp->records = - pack_records(assoc, req->resultSetId, *req->resultSetStartPoint, - num, req->recordComposition, next, resp->presentStatus, - form, req->referenceId, req->preferredRecordSyntax); - } - if (!resp->records) - return 0; - resp->numberOfRecordsReturned = num; - resp->nextResultSetPosition = next; - - return apdu; -} - -/* - * Scan was implemented rather in a hurry, and with support for only the basic - * elements of the service in the backend API. Suggestions are welcome. - */ -static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd) -{ - Z_ScanRequest *req = reqb->apdu_request->u.scanRequest; - Z_APDU *apdu = (Z_APDU *)odr_malloc (assoc->encode, sizeof(*apdu)); - Z_ScanResponse *res = (Z_ScanResponse *) - odr_malloc (assoc->encode, sizeof(*res)); - int *scanStatus = odr_intdup(assoc->encode, Z_Scan_failure); - int *numberOfEntriesReturned = odr_intdup(assoc->encode, 0); - Z_ListEntries *ents = (Z_ListEntries *) - odr_malloc (assoc->encode, sizeof(*ents)); - Z_DiagRecs *diagrecs_p = NULL; - oident *attset; - bend_scan_rr *bsrr = (bend_scan_rr *) - odr_malloc (assoc->encode, sizeof(*bsrr)); - struct scan_entry *save_entries; - - yaz_log(LOG_LOG, "Got ScanRequest"); - - apdu->which = Z_APDU_scanResponse; - apdu->u.scanResponse = res; - res->referenceId = req->referenceId; - - /* if step is absent, set it to 0 */ - res->stepSize = odr_intdup(assoc->encode, 0); - if (req->stepSize) - *res->stepSize = *req->stepSize; - - res->scanStatus = scanStatus; - res->numberOfEntriesReturned = numberOfEntriesReturned; - res->positionOfTerm = 0; - res->entries = ents; - ents->num_entries = 0; - ents->entries = NULL; - ents->num_nonsurrogateDiagnostics = 0; - ents->nonsurrogateDiagnostics = NULL; - res->attributeSet = 0; - res->otherInfo = 0; - - if (req->databaseNames) - { - int i; - for (i = 0; i < req->num_databaseNames; i++) - yaz_log (LOG_LOG, "Database '%s'", req->databaseNames[i]); - } - bsrr->num_bases = req->num_databaseNames; - bsrr->basenames = req->databaseNames; - bsrr->num_entries = *req->numberOfTermsRequested; - bsrr->term = req->termListAndStartPoint; - bsrr->referenceId = req->referenceId; - bsrr->stream = assoc->encode; - bsrr->print = assoc->print; - bsrr->step_size = res->stepSize; - bsrr->entries = 0; - /* Note that version 2.0 of YAZ and older did not set entries .. - We do now. And when we do it's easier to extend the scan entry - We know that if the scan handler did set entries, it will - not know of new member display_term. - */ - if (bsrr->num_entries > 0) - { - int i; - bsrr->entries = odr_malloc(assoc->decode, sizeof(*bsrr->entries) * - bsrr->num_entries); - for (i = 0; inum_entries; i++) - { - bsrr->entries[i].term = 0; - bsrr->entries[i].occurrences = 0; - bsrr->entries[i].errcode = 0; - bsrr->entries[i].errstring = 0; - bsrr->entries[i].display_term = 0; - } - } - save_entries = bsrr->entries; /* save it so we can compare later */ - - if (req->attributeSet && - (attset = oid_getentbyoid(req->attributeSet)) && - (attset->oclass == CLASS_ATTSET || attset->oclass == CLASS_GENERAL)) - bsrr->attributeset = attset->value; - else - bsrr->attributeset = VAL_NONE; - log_scan_term (req->termListAndStartPoint, bsrr->attributeset); - bsrr->term_position = req->preferredPositionInResponse ? - *req->preferredPositionInResponse : 1; - ((int (*)(void *, bend_scan_rr *)) - (*assoc->init->bend_scan))(assoc->backend, bsrr); - if (bsrr->errcode) - diagrecs_p = diagrecs(assoc, bsrr->errcode, bsrr->errstring); - else - { - int i; - Z_Entry **tab = (Z_Entry **) - odr_malloc (assoc->encode, sizeof(*tab) * bsrr->num_entries); - - if (bsrr->status == BEND_SCAN_PARTIAL) - *scanStatus = Z_Scan_partial_5; - else - *scanStatus = Z_Scan_success; - ents->entries = tab; - ents->num_entries = bsrr->num_entries; - res->numberOfEntriesReturned = &ents->num_entries; - res->positionOfTerm = &bsrr->term_position; - for (i = 0; i < bsrr->num_entries; i++) - { - Z_Entry *e; - Z_TermInfo *t; - Odr_oct *o; - - tab[i] = e = (Z_Entry *)odr_malloc(assoc->encode, sizeof(*e)); - if (bsrr->entries[i].occurrences >= 0) - { - e->which = Z_Entry_termInfo; - e->u.termInfo = t = (Z_TermInfo *) - odr_malloc(assoc->encode, sizeof(*t)); - t->suggestedAttributes = 0; - t->displayTerm = 0; - if (save_entries == bsrr->entries && - bsrr->entries[i].display_term) - { - /* the entries was NOT set by the handler. So it's - safe to test for new member display_term. It is - NULL'ed by us. - */ - t->displayTerm = odr_strdup(assoc->encode, - bsrr->entries[i].display_term); - } - t->alternativeTerm = 0; - t->byAttributes = 0; - t->otherTermInfo = 0; - t->globalOccurrences = &bsrr->entries[i].occurrences; - t->term = (Z_Term *) - odr_malloc(assoc->encode, sizeof(*t->term)); - t->term->which = Z_Term_general; - t->term->u.general = o = - (Odr_oct *)odr_malloc(assoc->encode, sizeof(Odr_oct)); - o->buf = (unsigned char *) - odr_malloc(assoc->encode, o->len = o->size = - strlen(bsrr->entries[i].term)); - memcpy(o->buf, bsrr->entries[i].term, o->len); - yaz_log(LOG_DEBUG, " term #%d: '%s' (%d)", i, - bsrr->entries[i].term, bsrr->entries[i].occurrences); - } - else - { - Z_DiagRecs *drecs = diagrecs (assoc, - bsrr->entries[i].errcode, - bsrr->entries[i].errstring); - assert (drecs->num_diagRecs == 1); - e->which = Z_Entry_surrogateDiagnostic; - assert (drecs->diagRecs[0]); - e->u.surrogateDiagnostic = drecs->diagRecs[0]; - } - } - } - if (diagrecs_p) - { - ents->num_nonsurrogateDiagnostics = diagrecs_p->num_diagRecs; - ents->nonsurrogateDiagnostics = diagrecs_p->diagRecs; - } - return apdu; -} - -static Z_APDU *process_sortRequest(association *assoc, request *reqb, - int *fd) -{ - Z_SortRequest *req = reqb->apdu_request->u.sortRequest; - Z_SortResponse *res = (Z_SortResponse *) - odr_malloc (assoc->encode, sizeof(*res)); - bend_sort_rr *bsrr = (bend_sort_rr *) - odr_malloc (assoc->encode, sizeof(*bsrr)); - - Z_APDU *apdu = (Z_APDU *)odr_malloc (assoc->encode, sizeof(*apdu)); - - yaz_log(LOG_LOG, "Got SortRequest."); - - bsrr->num_input_setnames = req->num_inputResultSetNames; - bsrr->input_setnames = req->inputResultSetNames; - bsrr->referenceId = req->referenceId; - bsrr->output_setname = req->sortedResultSetName; - bsrr->sort_sequence = req->sortSequence; - bsrr->stream = assoc->encode; - bsrr->print = assoc->print; - - bsrr->sort_status = Z_SortStatus_failure; - bsrr->errcode = 0; - bsrr->errstring = 0; - - (*assoc->init->bend_sort)(assoc->backend, bsrr); - - res->referenceId = bsrr->referenceId; - res->sortStatus = odr_intdup(assoc->encode, bsrr->sort_status); - res->resultSetStatus = 0; - if (bsrr->errcode) - { - Z_DiagRecs *dr = diagrecs (assoc, bsrr->errcode, bsrr->errstring); - res->diagnostics = dr->diagRecs; - res->num_diagnostics = dr->num_diagRecs; - } - else - { - res->num_diagnostics = 0; - res->diagnostics = 0; - } - res->resultCount = 0; - res->otherInfo = 0; - - apdu->which = Z_APDU_sortResponse; - apdu->u.sortResponse = res; - return apdu; -} - -static Z_APDU *process_deleteRequest(association *assoc, request *reqb, - int *fd) -{ - Z_DeleteResultSetRequest *req = - reqb->apdu_request->u.deleteResultSetRequest; - Z_DeleteResultSetResponse *res = (Z_DeleteResultSetResponse *) - odr_malloc (assoc->encode, sizeof(*res)); - bend_delete_rr *bdrr = (bend_delete_rr *) - odr_malloc (assoc->encode, sizeof(*bdrr)); - Z_APDU *apdu = (Z_APDU *)odr_malloc (assoc->encode, sizeof(*apdu)); - - yaz_log(LOG_LOG, "Got DeleteRequest."); - - bdrr->num_setnames = req->num_resultSetList; - bdrr->setnames = req->resultSetList; - bdrr->stream = assoc->encode; - bdrr->print = assoc->print; - bdrr->function = *req->deleteFunction; - bdrr->referenceId = req->referenceId; - bdrr->statuses = 0; - if (bdrr->num_setnames > 0) - { - int i; - bdrr->statuses = (int*) - odr_malloc(assoc->encode, sizeof(*bdrr->statuses) * - bdrr->num_setnames); - for (i = 0; i < bdrr->num_setnames; i++) - bdrr->statuses[i] = 0; - } - (*assoc->init->bend_delete)(assoc->backend, bdrr); - - res->referenceId = req->referenceId; - - res->deleteOperationStatus = odr_intdup(assoc->encode,bdrr->delete_status); - - res->deleteListStatuses = 0; - if (bdrr->num_setnames > 0) - { - int i; - res->deleteListStatuses = (Z_ListStatuses *) - odr_malloc(assoc->encode, sizeof(*res->deleteListStatuses)); - res->deleteListStatuses->num = bdrr->num_setnames; - res->deleteListStatuses->elements = - (Z_ListStatus **) - odr_malloc (assoc->encode, - sizeof(*res->deleteListStatuses->elements) * - bdrr->num_setnames); - for (i = 0; inum_setnames; i++) - { - res->deleteListStatuses->elements[i] = - (Z_ListStatus *) - odr_malloc (assoc->encode, - sizeof(**res->deleteListStatuses->elements)); - res->deleteListStatuses->elements[i]->status = bdrr->statuses+i; - res->deleteListStatuses->elements[i]->id = - odr_strdup (assoc->encode, bdrr->setnames[i]); - - } - } - res->numberNotDeleted = 0; - res->bulkStatuses = 0; - res->deleteMessage = 0; - res->otherInfo = 0; - - apdu->which = Z_APDU_deleteResultSetResponse; - apdu->u.deleteResultSetResponse = res; - return apdu; -} - -static void process_close(association *assoc, request *reqb) -{ - Z_Close *req = reqb->apdu_request->u.close; - static char *reasons[] = - { - "finished", - "shutdown", - "systemProblem", - "costLimit", - "resources", - "securityViolation", - "protocolError", - "lackOfActivity", - "peerAbort", - "unspecified" - }; - - yaz_log(LOG_LOG, "Got Close, reason %s, message %s", - reasons[*req->closeReason], req->diagnosticInformation ? - req->diagnosticInformation : "NULL"); - if (assoc->version < 3) /* to make do_force respond with close */ - assoc->version = 3; - do_close_req(assoc, Z_Close_finished, - "Association terminated by client", reqb); -} - -void save_referenceId (request *reqb, Z_ReferenceId *refid) -{ - if (refid) - { - reqb->len_refid = refid->len; - reqb->refid = (char *)nmem_malloc (reqb->request_mem, refid->len); - memcpy (reqb->refid, refid->buf, refid->len); - } - else - { - reqb->len_refid = 0; - reqb->refid = NULL; - } -} - -void bend_request_send (bend_association a, bend_request req, Z_APDU *res) -{ - process_z_response (a, req, res); -} - -bend_request bend_request_mk (bend_association a) -{ - request *nreq = request_get (&a->outgoing); - nreq->request_mem = nmem_create (); - return nreq; -} - -Z_ReferenceId *bend_request_getid (ODR odr, bend_request req) -{ - Z_ReferenceId *id; - if (!req->refid) - return 0; - id = (Odr_oct *)odr_malloc (odr, sizeof(*odr)); - id->buf = (unsigned char *)odr_malloc (odr, req->len_refid); - id->len = id->size = req->len_refid; - memcpy (id->buf, req->refid, req->len_refid); - return id; -} - -void bend_request_destroy (bend_request *req) -{ - nmem_destroy((*req)->request_mem); - request_release(*req); - *req = NULL; -} - -int bend_backend_respond (bend_association a, bend_request req) -{ - char *msg; - int r; - r = process_z_request (a, req, &msg); - if (r < 0) - yaz_log (LOG_WARN, "%s", msg); - return r; -} - -void bend_request_setdata(bend_request r, void *p) -{ - r->clientData = p; -} - -void *bend_request_getdata(bend_request r) -{ - return r->clientData; -} - -static Z_APDU *process_segmentRequest (association *assoc, request *reqb) -{ - bend_segment_rr req; - - req.segment = reqb->apdu_request->u.segmentRequest; - req.stream = assoc->encode; - req.decode = assoc->decode; - req.print = assoc->print; - req.association = assoc; - - (*assoc->init->bend_segment)(assoc->backend, &req); - - return 0; -} - -static Z_APDU *process_ESRequest(association *assoc, request *reqb, int *fd) -{ - bend_esrequest_rr esrequest; - - Z_ExtendedServicesRequest *req = - reqb->apdu_request->u.extendedServicesRequest; - Z_APDU *apdu = zget_APDU(assoc->encode, Z_APDU_extendedServicesResponse); - - Z_ExtendedServicesResponse *resp = apdu->u.extendedServicesResponse; - - yaz_log(LOG_DEBUG,"inside Process esRequest"); - - esrequest.esr = reqb->apdu_request->u.extendedServicesRequest; - esrequest.stream = assoc->encode; - esrequest.decode = assoc->decode; - esrequest.print = assoc->print; - esrequest.errcode = 0; - esrequest.errstring = NULL; - esrequest.request = reqb; - esrequest.association = assoc; - esrequest.taskPackage = 0; - esrequest.referenceId = req->referenceId; - - (*assoc->init->bend_esrequest)(assoc->backend, &esrequest); - - /* If the response is being delayed, return NULL */ - if (esrequest.request == NULL) - return(NULL); - - resp->referenceId = req->referenceId; - - if (esrequest.errcode == -1) - { - /* Backend service indicates request will be processed */ - yaz_log(LOG_DEBUG,"Request could be processed...Accepted !"); - *resp->operationStatus = Z_ExtendedServicesResponse_accepted; - } - else if (esrequest.errcode == 0) - { - /* Backend service indicates request will be processed */ - yaz_log(LOG_DEBUG,"Request could be processed...Done !"); - *resp->operationStatus = Z_ExtendedServicesResponse_done; - } - else - { - Z_DiagRecs *diagRecs = diagrecs (assoc, esrequest.errcode, - esrequest.errstring); - - /* Backend indicates error, request will not be processed */ - yaz_log(LOG_DEBUG,"Request could not be processed...failure !"); - *resp->operationStatus = Z_ExtendedServicesResponse_failure; - resp->num_diagnostics = diagRecs->num_diagRecs; - resp->diagnostics = diagRecs->diagRecs; - } - /* Do something with the members of bend_extendedservice */ - if (esrequest.taskPackage) - resp->taskPackage = z_ext_record (assoc->encode, VAL_EXTENDED, - (const char *) esrequest.taskPackage, - -1); - yaz_log(LOG_DEBUG,"Send the result apdu"); - return apdu; -} - diff --git a/server/session.h b/server/session.h deleted file mode 100644 index 4254cd2..0000000 --- a/server/session.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: session.h,v 1.29 2003-02-17 21:23:31 adam Exp $ - */ - -#ifndef SESSION_H -#define SESSION_H - -#include -#include -#include -#include -#include -#include "eventl.h" - -typedef enum { - REQUEST_IDLE, /* the request is just sitting in the queue */ - REQUEST_PENDING /* operation pending (b'end processing or network I/O*/ - /* this list will have more elements when acc/res control is added */ -} request_state; - -typedef struct request -{ - int len_refid; /* length of referenceid */ - char *refid; /* referenceid */ - request_state state; - - Z_GDU *gdu_request; /* Current request */ - Z_APDU *apdu_request; /* Current Z39.50 request */ - NMEM request_mem; /* memory handle for request */ - - int size_response; /* size of buffer */ - int len_response; /* length of encoded data */ - char *response; /* encoded data waiting for transmission */ - - void *clientData; - struct request *next; - struct request_q *q; -} request; - -typedef struct request_q -{ - request *head; - request *tail; - request *list; - int num; -} request_q; - -/* - * association state. - */ -typedef enum -{ - ASSOC_NEW, /* not initialized yet */ - ASSOC_UP, /* normal operation */ - ASSOC_DEAD /* dead. Close if input arrives */ -} association_state; - -typedef struct association -{ - IOCHAN client_chan; /* event-loop control */ - COMSTACK client_link; /* communication handle */ - ODR decode; /* decoding stream */ - ODR encode; /* encoding stream */ - ODR print; /* printing stream (for -a) */ - char *encode_buffer; /* temporary buffer for encoded data */ - int encoded_len; /* length of encoded data */ - char *input_buffer; /* input buffer (allocated by comstack) */ - int input_buffer_len; /* length (size) of buffer */ - int input_apdu_len; /* length of current incoming APDU */ - oid_proto proto; /* protocol (PROTO_Z3950/PROTO_SR) */ - void *backend; /* backend handle */ - request_q incoming; /* Q of incoming PDUs */ - request_q outgoing; /* Q of outgoing data buffers (enc. PDUs) */ - association_state state; - - /* session parameters */ - int preferredMessageSize; - int maximumRecordSize; - int version; /* highest version-bit set (2 or 3) */ - - unsigned cs_get_mask; - unsigned cs_put_mask; - unsigned cs_accept_mask; - - struct bend_initrequest *init; -} association; - -association *create_association(IOCHAN channel, COMSTACK link); -void destroy_association(association *h); -void ir_session(IOCHAN h, int event); - -void request_enq(request_q *q, request *r); -request *request_head(request_q *q); -request *request_deq(request_q *q); -request *request_deq_x(request_q *q, request *r); -void request_initq(request_q *q); -void request_delq(request_q *q); -request *request_get(request_q *q); -void request_release(request *r); - -int statserv_must_terminate(void); - -#endif diff --git a/server/statserv.c b/server/statserv.c deleted file mode 100644 index 4e3db64..0000000 --- a/server/statserv.c +++ /dev/null @@ -1,961 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * NT threaded server code by - * Chas Woodfield, Fretwell Downing Informatics. - * - * $Id: statserv.c,v 1.98 2003-03-03 19:57:35 adam Exp $ - */ - -#include -#include -#ifdef WIN32 -#include -#include -#include -#include "service.h" -#else -#include -#include -#endif - -#if YAZ_POSIX_THREADS -#include -#elif YAZ_GNU_THREADS -#include -#endif - -#include -#include -#include - -#include -#include -#include -#ifdef USE_XTIMOSI -#include -#endif -#include -#include "eventl.h" -#include "session.h" -#include - -static IOCHAN pListener = NULL; - -static char *me = "statserver"; -/* - * default behavior. - */ -int check_options(int argc, char **argv); -statserv_options_block control_block = { - 1, /* dynamic mode */ - 0, /* threaded mode */ - 0, /* one shot (single session) */ - LOG_DEFAULT_LEVEL, /* log level */ - "", /* no PDUs */ - "", /* diagnostic output to stderr */ - "tcp:@:9999", /* default listener port */ - PROTO_Z3950, /* default application protocol */ - 15, /* idle timeout (minutes) */ - 1024*1024, /* maximum PDU size (approx.) to allow */ - "default-config", /* configuration name to pass to backend */ - "", /* set user id */ - 0, /* bend_start handler */ - 0, /* bend_stop handler */ - check_options, /* Default routine, for checking the run-time arguments */ - check_ip_tcpd, - "", - 0, /* default value for inet deamon */ - 0, /* handle (for service, etc) */ - 0, /* bend_init handle */ - 0, /* bend_close handle */ -#ifdef WIN32 - "Z39.50 Server", /* NT Service Name */ - "Server", /* NT application Name */ - "", /* NT Service Dependencies */ - "Z39.50 Server", /* NT Service Display Name */ -#endif /* WIN32 */ - 0 /* SOAP handlers */ -}; - -static int max_sessions = 0; - -/* - * handle incoming connect requests. - * The dynamic mode is a bit tricky mostly because we want to avoid - * doing all of the listening and accepting in the parent - it's - * safer that way. - */ -#ifdef WIN32 - -typedef struct _ThreadList ThreadList; - -struct _ThreadList -{ - HANDLE hThread; - IOCHAN pIOChannel; - ThreadList *pNext; -}; - -static ThreadList *pFirstThread; -static CRITICAL_SECTION Thread_CritSect; -static BOOL bInitialized = FALSE; - -static void ThreadList_Initialize() -{ - /* Initialize the critical Sections */ - InitializeCriticalSection(&Thread_CritSect); - - /* Set the first thraed */ - pFirstThread = NULL; - - /* we have been initialized */ - bInitialized = TRUE; -} - -static void statserv_add(HANDLE hThread, IOCHAN pIOChannel) -{ - /* Only one thread can go through this section at a time */ - EnterCriticalSection(&Thread_CritSect); - - { - /* Lets create our new object */ - ThreadList *pNewThread = (ThreadList *)malloc(sizeof(ThreadList)); - pNewThread->hThread = hThread; - pNewThread->pIOChannel = pIOChannel; - pNewThread->pNext = pFirstThread; - pFirstThread = pNewThread; - - /* Lets let somebody else create a new object now */ - LeaveCriticalSection(&Thread_CritSect); - } -} - -void statserv_remove(IOCHAN pIOChannel) -{ - /* Only one thread can go through this section at a time */ - EnterCriticalSection(&Thread_CritSect); - - { - ThreadList *pCurrentThread = pFirstThread; - ThreadList *pNextThread; - ThreadList *pPrevThread =NULL; - - /* Step through alll the threads */ - for (; pCurrentThread != NULL; pCurrentThread = pNextThread) - { - /* We only need to compare on the IO Channel */ - if (pCurrentThread->pIOChannel == pIOChannel) - { - /* We have found the thread we want to delete */ - /* First of all reset the next pointers */ - if (pPrevThread == NULL) - pFirstThread = pCurrentThread->pNext; - else - pPrevThread->pNext = pCurrentThread->pNext; - - /* All we need todo now is delete the memory */ - free(pCurrentThread); - - /* No need to look at any more threads */ - pNextThread = NULL; - } - else - { - /* We need to look at another thread */ - pNextThread = pCurrentThread->pNext; - pPrevThread = pCurrentThread; - } - } - - /* Lets let somebody else remove an object now */ - LeaveCriticalSection(&Thread_CritSect); - } -} - -/* WIN32 statserv_closedown */ -void statserv_closedown() -{ - /* Shouldn't do anything if we are not initialized */ - if (bInitialized) - { - int iHandles = 0; - HANDLE *pThreadHandles = NULL; - - /* We need to stop threads adding and removing while we */ - /* start the closedown process */ - EnterCriticalSection(&Thread_CritSect); - - { - /* We have exclusive access to the thread stuff now */ - /* Y didn't i use a semaphore - Oh well never mind */ - ThreadList *pCurrentThread = pFirstThread; - - /* Before we do anything else, we need to shutdown the listener */ - if (pListener != NULL) - iochan_destroy(pListener); - - for (; pCurrentThread != NULL; pCurrentThread = pCurrentThread->pNext) - { - /* Just destroy the IOCHAN, that should do the trick */ - iochan_destroy(pCurrentThread->pIOChannel); - closesocket(pCurrentThread->pIOChannel->fd); - - /* Keep a running count of our handles */ - iHandles++; - } - - if (iHandles > 0) - { - HANDLE *pCurrentHandle ; - - /* Allocate the thread handle array */ - pThreadHandles = (HANDLE *)malloc(sizeof(HANDLE) * iHandles); - pCurrentHandle = pThreadHandles; - - for (pCurrentThread = pFirstThread; - pCurrentThread != NULL; - pCurrentThread = pCurrentThread->pNext, pCurrentHandle++) - { - /* Just the handle */ - *pCurrentHandle = pCurrentThread->hThread; - } - } - - /* We can now leave the critical section */ - LeaveCriticalSection(&Thread_CritSect); - } - - /* Now we can really do something */ - if (iHandles > 0) - { - logf (LOG_LOG, "waiting for %d to die", iHandles); - /* This will now wait, until all the threads close */ - WaitForMultipleObjects(iHandles, pThreadHandles, TRUE, INFINITE); - - /* Free the memory we allocated for the handle array */ - free(pThreadHandles); - } - - if (control_block.bend_stop) - (*control_block.bend_stop)(&control_block); - /* No longer require the critical section, since all threads are dead */ - DeleteCriticalSection(&Thread_CritSect); - } -} - -void __cdecl event_loop_thread (IOCHAN iochan) -{ - event_loop (&iochan); -} - -/* WIN32 listener */ -static void listener(IOCHAN h, int event) -{ - COMSTACK line = (COMSTACK) iochan_getdata(h); - association *newas; - int res; - HANDLE newHandle; - - if (event == EVENT_INPUT) - { - if ((res = cs_listen(line, 0, 0)) < 0) - { - yaz_log(LOG_FATAL, "cs_listen failed"); - return; - } - else if (res == 1) - return; - yaz_log(LOG_DEBUG, "listen ok"); - iochan_setevent(h, EVENT_OUTPUT); - iochan_setflags(h, EVENT_OUTPUT | EVENT_EXCEPT); /* set up for acpt */ - } - else if (event == EVENT_OUTPUT) - { - COMSTACK new_line = cs_accept(line); - IOCHAN new_chan; - char *a = NULL; - - if (!new_line) - { - yaz_log(LOG_FATAL, "Accept failed."); - iochan_setflags(h, EVENT_INPUT | EVENT_EXCEPT); - return; - } - yaz_log(LOG_DEBUG, "Accept ok"); - - if (!(new_chan = iochan_create(cs_fileno(new_line), ir_session, - EVENT_INPUT))) - { - yaz_log(LOG_FATAL, "Failed to create iochan"); - iochan_destroy(h); - return; - } - - yaz_log(LOG_DEBUG, "Creating association"); - if (!(newas = create_association(new_chan, new_line))) - { - yaz_log(LOG_FATAL, "Failed to create new assoc."); - iochan_destroy(h); - return; - } - newas->cs_get_mask = EVENT_INPUT; - newas->cs_put_mask = 0; - newas->cs_accept_mask = 0; - - yaz_log(LOG_DEBUG, "Setting timeout %d", control_block.idle_timeout); - iochan_setdata(new_chan, newas); - iochan_settimeout(new_chan, 60); - - /* Now what we need todo is create a new thread with this iochan as - the parameter */ - newHandle = (HANDLE) _beginthread(event_loop_thread, 0, new_chan); - if (newHandle == (HANDLE) -1) - { - - yaz_log(LOG_FATAL|LOG_ERRNO, "Failed to create new thread."); - iochan_destroy(h); - return; - } - /* We successfully created the thread, so add it to the list */ - statserv_add(newHandle, new_chan); - - yaz_log(LOG_DEBUG, "Created new thread, id = %ld iochan %p",(long) newHandle, new_chan); - iochan_setflags(h, EVENT_INPUT | EVENT_EXCEPT); /* reset listener */ - } - else - { - yaz_log(LOG_FATAL, "Bad event on listener."); - iochan_destroy(h); - return; - } -} - -int statserv_must_terminate(void) -{ - return 0; -} - -#else /* ! WIN32 */ - -static int term_flag = 0; -/* To save having an #ifdef in event_loop we need to - define this empty function -*/ -int statserv_must_terminate(void) -{ - return term_flag; -} - -void statserv_remove(IOCHAN pIOChannel) -{ -} - -void statserv_closedown() -{ - IOCHAN p; - - if (control_block.bend_stop) - (*control_block.bend_stop)(&control_block); - for (p = pListener; p; p = p->next) - { - iochan_destroy(p); - } -} - -void sigterm(int sig) -{ - term_flag = 1; -} - -static void *new_session (void *vp); -static int no_sessions = 0; - -/* UNIX listener */ -static void listener(IOCHAN h, int event) -{ - COMSTACK line = (COMSTACK) iochan_getdata(h); - static int hand[2]; - static int child = 0; - int res; - - if (event == EVENT_INPUT) - { - if (control_block.dynamic && !child) - { - int res; - - ++no_sessions; - if (pipe(hand) < 0) - { - yaz_log(LOG_FATAL|LOG_ERRNO, "pipe"); - iochan_destroy(h); - return; - } - if ((res = fork()) < 0) - { - yaz_log(LOG_FATAL|LOG_ERRNO, "fork"); - iochan_destroy(h); - return; - } - else if (res == 0) /* child */ - { - char nbuf[100]; - IOCHAN pp; - - close(hand[0]); - child = 1; - for (pp = pListener; pp; pp = iochan_getnext(pp)) - { - if (pp != h) - { - COMSTACK l = (COMSTACK)iochan_getdata(pp); - cs_close(l); - iochan_destroy(pp); - } - } - sprintf(nbuf, "%s(%d)", me, getpid()); - yaz_log_init(control_block.loglevel, nbuf, 0); - /* ensure that bend_stop is not called when each child exits - - only for the main process .. - */ - control_block.bend_stop = 0; - } - else /* parent */ - { - close(hand[1]); - /* wait for child to take the call */ - for (;;) - { - char dummy[1]; - int res; - - if ((res = read(hand[0], dummy, 1)) < 0 && - yaz_errno() != EINTR) - { - yaz_log(LOG_FATAL|LOG_ERRNO, "handshake read"); - return; - } - else if (res >= 0) - break; - } - yaz_log(LOG_DEBUG, "P: Child has taken the call"); - close(hand[0]); - return; - } - } - if ((res = cs_listen_check(line, 0, 0, control_block.check_ip, - control_block.daemon_name)) < 0) - { - yaz_log(LOG_WARN|LOG_ERRNO, "cs_listen failed"); - return; - } - else if (res == 1) - return; - yaz_log(LOG_DEBUG, "listen ok"); - iochan_setevent(h, EVENT_OUTPUT); - iochan_setflags(h, EVENT_OUTPUT | EVENT_EXCEPT); /* set up for acpt */ - } - /* in dynamic mode, only the child ever comes down here */ - else if (event == EVENT_OUTPUT) - { - COMSTACK new_line = cs_accept(line); - - if (!new_line) - { - yaz_log(LOG_FATAL, "Accept failed."); - iochan_setflags(h, EVENT_INPUT | EVENT_EXCEPT); /* reset listener */ - return; - } - yaz_log(LOG_DEBUG, "accept ok"); - if (control_block.dynamic) - { - IOCHAN pp; - /* close our half of the listener socket */ - for (pp = pListener; pp; pp = iochan_getnext(pp)) - { - COMSTACK l = (COMSTACK)iochan_getdata(pp); - cs_close(l); - iochan_destroy(pp); - } - /* release dad */ - yaz_log(LOG_DEBUG, "Releasing parent"); - close(hand[1]); - } - else - { - iochan_setflags(h, EVENT_INPUT | EVENT_EXCEPT); /* reset listener */ - ++no_sessions; - } -#if YAZ_POSIX_THREADS - if (control_block.threads) - { - pthread_t child_thread; - pthread_create (&child_thread, 0, new_session, new_line); - pthread_detach (child_thread); - } - else - new_session(new_line); -#elif YAZ_GNU_THREADS - if (control_block.threads) - { - pth_attr_t attr; - pth_t child_thread; - - attr = pth_attr_new (); - pth_attr_set (attr, PTH_ATTR_JOINABLE, FALSE); - pth_attr_set (attr, PTH_ATTR_STACK_SIZE, 32*1024); - pth_attr_set (attr, PTH_ATTR_NAME, "session"); - yaz_log (LOG_LOG, "pth_spawn begin"); - child_thread = pth_spawn (attr, new_session, new_line); - yaz_log (LOG_LOG, "pth_spawn finish"); - pth_attr_destroy (attr); - } - else - new_session(new_line); -#else - new_session(new_line); -#endif - } - else if (event == EVENT_TIMEOUT) - { - yaz_log(LOG_LOG, "Shutting down listener."); - iochan_destroy(h); - } - else - { - yaz_log(LOG_FATAL, "Bad event on listener."); - iochan_destroy(h); - } -} - -static void *new_session (void *vp) -{ - char *a; - association *newas; - IOCHAN new_chan; - COMSTACK new_line = (COMSTACK) vp; - - unsigned cs_get_mask, cs_accept_mask, mask = - ((new_line->io_pending & CS_WANT_WRITE) ? EVENT_OUTPUT : 0) | - ((new_line->io_pending & CS_WANT_READ) ? EVENT_INPUT : 0); - - if (mask) - { - cs_accept_mask = mask; /* accept didn't complete */ - cs_get_mask = 0; - } - else - { - cs_accept_mask = 0; /* accept completed. */ - cs_get_mask = mask = EVENT_INPUT; - } - - if (!(new_chan = iochan_create(cs_fileno(new_line), ir_session, mask))) - { - yaz_log(LOG_FATAL, "Failed to create iochan"); - return 0; - } - if (!(newas = create_association(new_chan, new_line))) - { - yaz_log(LOG_FATAL, "Failed to create new assoc."); - return 0; - } - newas->cs_accept_mask = cs_accept_mask; - newas->cs_get_mask = cs_get_mask; - - iochan_setdata(new_chan, newas); - iochan_settimeout(new_chan, 60); -#if 1 - a = cs_addrstr(new_line); -#else - a = 0; -#endif - yaz_log(LOG_LOG, "Starting session %d from %s", - no_sessions, a ? a : "[Unknown]"); - if (max_sessions && no_sessions == max_sessions) - control_block.one_shot = 1; - if (control_block.threads) - { - event_loop(&new_chan); - } - else - { - new_chan->next = pListener; - pListener = new_chan; - } - return 0; -} - -/* UNIX */ -#endif - -static void inetd_connection(int what) -{ - COMSTACK line; - IOCHAN chan; - association *assoc; - char *addr; - - if ((line = cs_createbysocket(0, tcpip_type, 0, what))) - { - if ((chan = iochan_create(cs_fileno(line), ir_session, EVENT_INPUT))) - { - if ((assoc = create_association(chan, line))) - { - iochan_setdata(chan, assoc); - iochan_settimeout(chan, 60); - addr = cs_addrstr(line); - yaz_log(LOG_LOG, "Inetd association from %s", - addr ? addr : "[UNKNOWN]"); - assoc->cs_get_mask = EVENT_INPUT; - } - else - { - yaz_log(LOG_FATAL, "Failed to create association structure"); - } - chan->next = pListener; - pListener = chan; - } - else - { - yaz_log(LOG_FATAL, "Failed to create iochan"); - } - } - else - { - yaz_log(LOG_ERRNO|LOG_FATAL, "Failed to create comstack on socket 0"); - } -} - -/* - * Set up a listening endpoint, and give it to the event-handler. - */ -static int add_listener(char *where, int what) -{ - COMSTACK l; - void *ap; - IOCHAN lst = NULL; - const char *mode; - - if (control_block.dynamic) - mode = "dynamic"; - else if (control_block.threads) - mode = "threaded"; - else - mode = "static"; - - yaz_log(LOG_LOG, "Adding %s %s listener on %s", mode, - what == PROTO_SR ? "SR" : "Z3950", where); - - l = cs_create_host(where, 0, &ap); - if (!l) - { - yaz_log(LOG_FATAL|LOG_ERRNO, "Failed to listen on %s", where); - return -1; - } - if (cs_bind(l, ap, CS_SERVER) < 0) - { - yaz_log(LOG_FATAL|LOG_ERRNO, "Failed to bind to %s", where); - cs_close (l); - return -1; - } - if (!(lst = iochan_create(cs_fileno(l), listener, EVENT_INPUT | - EVENT_EXCEPT))) - { - yaz_log(LOG_FATAL|LOG_ERRNO, "Failed to create IOCHAN-type"); - cs_close (l); - return -1; - } - iochan_setdata(lst, l); - - /* Ensure our listener chain is setup properly */ - lst->next = pListener; - pListener = lst; - return 0; /* OK */ -} - -#ifndef WIN32 -/* UNIX only (for windows we don't need to catch the signals) */ -static void catchchld(int num) -{ - while (waitpid(-1, 0, WNOHANG) > 0) - ; - signal(SIGCHLD, catchchld); -} -#endif - -statserv_options_block *statserv_getcontrol(void) -{ - static statserv_options_block cb; - - memcpy(&cb, &control_block, sizeof(cb)); - return &cb; -} - -void statserv_setcontrol(statserv_options_block *block) -{ - memcpy(&control_block, block, sizeof(*block)); -} - -static void statserv_reset(void) -{ -} - -int statserv_start(int argc, char **argv) -{ - int ret; - -#ifdef WIN32 - /* We need to initialize the thread list */ - ThreadList_Initialize(); -/* WIN32 */ -#endif - -#ifdef WIN32 - if ((me = strrchr (argv[0], '\\'))) - me++; - else - me = argv[0]; -#else - me = argv[0]; -#endif - if (control_block.options_func(argc, argv)) - return(1); - - if (control_block.bend_start) - (*control_block.bend_start)(&control_block); -#ifdef WIN32 - yaz_log (LOG_LOG, "Starting server %s", me); -#else -/* UNIX */ - if (control_block.inetd) - inetd_connection(control_block.default_proto); - else - { - yaz_log (LOG_LOG, "Starting server %s pid=%d", me, getpid()); -#if 0 - sigset_t sigs_to_block; - - sigemptyset(&sigs_to_block); - sigaddset (&sigs_to_block, SIGTERM); - pthread_sigmask (SIG_BLOCK, &sigs_to_block, 0); - /* missing... */ -#endif - if (control_block.dynamic) - signal(SIGCHLD, catchchld); - } - signal (SIGPIPE, SIG_IGN); - signal (SIGTERM, sigterm); - if (*control_block.setuid) - { - struct passwd *pw; - - if (!(pw = getpwnam(control_block.setuid))) - { - yaz_log(LOG_FATAL, "%s: Unknown user", control_block.setuid); - return(1); - } - if (setuid(pw->pw_uid) < 0) - { - yaz_log(LOG_FATAL|LOG_ERRNO, "setuid"); - exit(1); - } - } -/* UNIX */ -#endif - - - if ((pListener == NULL) && *control_block.default_listen) - add_listener(control_block.default_listen, - control_block.default_proto); - - if (pListener == NULL) - ret = 1; - else - { - yaz_log(LOG_LOG, "Entering event loop."); - ret = event_loop(&pListener); - } - return ret; -} - -int check_options(int argc, char **argv) -{ - int ret = 0, r; - char *arg; - - while ((ret = options("1a:iszSTl:v:u:c:w:t:k:d:D:", argv, argc, &arg)) != -2) - { - switch (ret) - { - case 0: - if (add_listener(arg, control_block.default_proto)) - return 1; /* failed to create listener */ - break; - case '1': - control_block.one_shot = 1; - control_block.dynamic = 0; - break; - case 'z': - control_block.default_proto = PROTO_Z3950; - break; - case 's': - fprintf (stderr, "%s: SR protocol no longer supported\n", me); - exit (1); - break; - case 'S': - control_block.dynamic = 0; - break; - case 'T': -#if YAZ_POSIX_THREADS - control_block.dynamic = 0; - control_block.threads = 1; -#elif YAZ_GNU_THREADS - control_block.dynamic = 0; - control_block.threads = 1; -#else - fprintf(stderr, "%s: Threaded mode not available.\n", me); - return 1; -#endif - break; - case 'l': - strcpy(control_block.logfile, arg ? arg : ""); - yaz_log_init(control_block.loglevel, me, control_block.logfile); - break; - case 'v': - control_block.loglevel = yaz_log_mask_str(arg); - yaz_log_init(control_block.loglevel, me, control_block.logfile); - break; - case 'a': - strcpy(control_block.apdufile, arg ? arg : ""); - break; - case 'u': - strcpy(control_block.setuid, arg ? arg : ""); - break; - case 'c': - strcpy(control_block.configname, arg ? arg : ""); - break; - case 'd': - strcpy(control_block.daemon_name, arg ? arg : ""); - break; - case 't': - if (!arg || !(r = atoi(arg))) - { - fprintf(stderr, "%s: Specify positive timeout for -t.\n", me); - return(1); - } - control_block.idle_timeout = r; - break; - case 'k': - if (!arg || !(r = atoi(arg))) - { - fprintf(stderr, "%s: Specify positive size for -k.\n", me); - return(1); - } - control_block.maxrecordsize = r * 1024; - break; - case 'i': - control_block.inetd = 1; - break; - case 'w': - if (chdir(arg)) - { - perror(arg); - return 1; - } - break; - case 'D': - max_sessions = atoi(arg); - break; - default: - fprintf(stderr, "Usage: %s [ -a -v " - " -l -u -c -t " - " -k -d " - " -ziST1 -w ... ]\n", me); - return 1; - } - } - return 0; -} - -#ifdef WIN32 -typedef struct _Args -{ - char **argv; - int argc; -} Args; - -static Args ArgDetails; - -/* name of the executable */ -#define SZAPPNAME "server" - -/* list of service dependencies - "dep1\0dep2\0\0" */ -#define SZDEPENDENCIES "" - -int statserv_main(int argc, char **argv, - bend_initresult *(*bend_init)(bend_initrequest *r), - void (*bend_close)(void *handle)) -{ - statserv_options_block *cb = statserv_getcontrol(); - - cb->bend_init = bend_init; - cb->bend_close = bend_close; - - statserv_setcontrol(cb); - - /* Lets setup the Arg structure */ - ArgDetails.argc = argc; - ArgDetails.argv = argv; - - /* Now setup the service with the service controller */ - SetupService(argc, argv, &ArgDetails, SZAPPNAME, - cb->service_name, /* internal service name */ - cb->service_display_name, /* displayed name */ - SZDEPENDENCIES); - return 0; -} - -int StartAppService(void *pHandle, int argc, char **argv) -{ - /* Initializes the App */ - return 1; -} - -void RunAppService(void *pHandle) -{ - Args *pArgs = (Args *)pHandle; - - /* Starts the app running */ - statserv_start(pArgs->argc, pArgs->argv); -} - -void StopAppService(void *pHandle) -{ - /* Stops the app */ - statserv_closedown(); - statserv_reset(); -} -/* WIN32 */ -#else -/* UNIX */ -int statserv_main(int argc, char **argv, - bend_initresult *(*bend_init)(bend_initrequest *r), - void (*bend_close)(void *handle)) -{ - int ret; - statserv_options_block *cb = statserv_getcontrol(); - - cb->bend_init = bend_init; - cb->bend_close = bend_close; - - statserv_setcontrol(cb); - ret = statserv_start (argc, argv); - statserv_closedown (); - statserv_reset(); - return ret; -} -#endif diff --git a/server/tcpdchk.c b/server/tcpdchk.c deleted file mode 100644 index 35c53aa..0000000 --- a/server/tcpdchk.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 1995-2000, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: tcpdchk.c,v $ - * Revision 1.5 2000-02-28 11:20:06 adam - * Using autoconf. New definitions: YAZ_BEGIN_CDECL/YAZ_END_CDECL. - * - * Revision 1.4 1999/11/30 13:47:12 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.3 1999/08/27 09:40:32 adam - * Renamed logf function to yaz_log. Removed VC++ project files. - * - * Revision 1.2 1999/04/20 09:56:48 adam - * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). - * Modified all encoders/decoders to reflect this change. - * - * Revision 1.1 1999/04/16 14:45:55 adam - * Added interface for tcpd wrapper for access control. - * - */ - -#include -#include - -#include -#include - -#if HAVE_TCPD_H -#include -#include - - -int allow_severity = LOG_INFO; -int deny_severity = LOG_WARNING; - -#ifdef LOG_DEBUG -#undef LOG_DEBUG -#endif -#ifdef LOG_WARN -#undef LOG_WARN -#endif - -#endif - -#include -#include - -int check_ip_tcpd(void *cd, const char *addr, int len, int type) -{ - const char *daemon_name = (const char *) cd; - - if (type == AF_INET) - { - if (daemon_name && *daemon_name) - { -#if HAVE_TCPD_H - struct request_info request_info; - int i; -#endif - char *host_name = 0, *host_addr = 0; - struct hostent *host; - - struct sockaddr_in *addr_in = (struct sockaddr_in *) addr; - - if ((host = gethostbyaddr((char*)&addr_in->sin_addr, - sizeof(addr_in->sin_addr), - AF_INET))) - host_name = (char*) host->h_name; - host_addr = inet_ntoa(addr_in->sin_addr); -#if HAVE_TCPD_H - if (host_addr) - request_init(&request_info, RQ_DAEMON, daemon_name, - RQ_CLIENT_NAME, host_name, - RQ_CLIENT_SIN, addr_in, - RQ_CLIENT_ADDR, host_addr, 0); - else - request_init(&request_info, RQ_DAEMON, daemon_name, - RQ_CLIENT_SIN, addr_in, - RQ_CLIENT_ADDR, host_addr, 0); - i = hosts_access(&request_info); - if (!i) - { - yaz_log (LOG_DEBUG, "access denied from %s", - host_name ? host_name : host_addr); - return 1; - } - yaz_log (LOG_DEBUG, "access granted from %s", - host_name ? host_name : host_addr); -#endif - } - } - return 0; -} - diff --git a/src/.cvsignore b/src/.cvsignore new file mode 100644 index 0000000..f69fe03 --- /dev/null +++ b/src/.cvsignore @@ -0,0 +1,13 @@ +Makefile.in +Makefile +.deps +.libs +*.o +*.lo +*.la +zes-*.c +z-*.c +item-req.c +ill-core.c +marc8.c +cql.c diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..9295705 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,167 @@ +## Copyright (C) 1994-2003, Index Data +## All rights reserved. +## $Id: Makefile.am,v 1.1 2003-10-27 12:21:30 adam Exp $ + +if ISTHR +thrlib=libyazthread.la +endif + +if ISSSL +ssllib=libyazssl.la +endif + +YAZ_VERSION_INFO=2:0:0 + +lib_LTLIBRARIES = libyaz.la $(thrlib) $(ssllib) + +TESTS = $(check_PROGRAMS) + +tabdatadir = $(pkgdatadir)/z39.50 +tabdata_DATA=datetime.asn esupdate.asn univres.asn z3950v3.asn z.tcl \ + esadmin.asn charneg-3.asn mterm2.asn oclcui.asn + +illdatadir=$(pkgdatadir)/ill +illdata_DATA=ill9702.asn item-req.asn ill.tcl + +EXTRA_DIST=$(tabdata_DATA) $(illdata_DATA) \ + charconv.tcl charconv.sgm charconv_cjk.xml + +YAZCOMP = $(top_srcdir)/util/yaz-asncomp +YAZCOMPLINE = $(YAZCOMP) -d z.tcl -i yaz -I../include $(YCFLAGS) + +AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) +AM_YFLAGS=-p cql_ +THREADED_FLAGS = @CFLAGSTHREADS@ + +# MARC8 conversion is generated from charconv.sgm +marc8.c: charconv.sgm charconv.tcl + cd $(srcdir); ./charconv.tcl -p marc8 -s 50 charconv.sgm -o marc8.c + +libyaz_la_SOURCES=version.c options.c log.c marcdisp.c oid.c wrbuf.c \ + nmemsdup.c xmalloc.c readconf.c tpath.c nmem.c matchstr.c atoin.c \ + siconv.c marc8.c \ + odr_bool.c ber_bool.c ber_len.c ber_tag.c odr_util.c \ + odr_null.c ber_null.c odr_int.c ber_int.c odr_tag.c odr_cons.c \ + odr_seq.c odr_oct.c ber_oct.c odr_bit.c ber_bit.c odr_oid.c \ + ber_oid.c odr_use.c odr_choice.c odr_any.c ber_any.c odr.c odr_mem.c \ + dumpber.c odr_enum.c odr-priv.h \ + comstack.c tcpip.c waislen.c unix.c \ + z-accdes1.c z-accform1.c z-acckrb1.c z-core.c \ + z-diag1.c z-espec1.c z-estask.c z-exp.c z-grs.c z-mterm2.c z-opac.c \ + z-uifr1.c z-rrf1.c z-rrf2.c z-sum.c z-sutrs.c z-oclcui.c\ + zes-expi.c zes-exps.c zes-order.c zes-pquery.c zes-psched.c \ + zes-pset.c zes-update0.c z-date.c z-univ.c zes-update.c zes-admin.c \ + z-charneg.c \ + prt-ext.c \ + ill-core.c item-req.c ill-get.c \ + zget.c yaz-ccl.c diagbib1.c logrpn.c \ + otherinfo.c pquery.c sortspec.c z3950oid.c charneg.c \ + zoom-c.c zoom-opt.c zoom-p.h grs1disp.c zgdu.c soap.c srw.c opacdisp.c \ + cclfind.c ccltoken.c cclerrms.c cclqual.c cclptree.c \ + cclqfile.c cclstr.c \ + cql.y cqlstdio.c cqltransform.c cqlutil.c xcqlutil.c cqlstring.c \ + cqlstrer.c lexer.h \ + eventl.c seshigh.c statserv.c requestq.c tcpdchk.c \ + eventl.h service.c service.h session.h +libyaz_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO) + +libyazthread_la_SOURCES= +libyazthread_la_LIBADD=thr-nmem.lo thr-statserv.lo thr-eventl.lo +libyazthread_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO) + +libyazssl_la_SOURCES= +libyazssl_la_LIBADD=ssl-comstack.lo ssl-tcpip.lo +libyazssl_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO) + +# Rules for Z39.50 V3 +$(srcdir)/z-accdes1.c \ +$(srcdir)/z-accform1.c \ +$(srcdir)/z-acckrb1.c \ +$(srcdir)/z-core.c \ +$(srcdir)/z-diag1.c \ +$(srcdir)/z-espec1.c \ +$(srcdir)/z-estask.c \ +$(srcdir)/z-exp.c \ +$(srcdir)/z-grs.c \ +$(srcdir)/z-opac.c \ +$(srcdir)/z-uifr1.c \ +$(srcdir)/z-rrf1.c \ +$(srcdir)/z-rrf2.c \ +$(srcdir)/z-sum.c \ +$(srcdir)/z-sutrs.c \ +$(srcdir)/zes-expi.c \ +$(srcdir)/zes-exps.c \ +$(srcdir)/zes-order.c \ +$(srcdir)/zes-pquery.c \ +$(srcdir)/zes-psched.c \ +$(srcdir)/zes-pset.c \ +$(srcdir)/zes-update0.c \ +$(top_srcdir)/include/z-accdes1.h \ +$(top_srcdir)/include/z-core.h: \ +$(srcdir)/z.tcl $(srcdir)/z3950v3.asn $(YAZCOMP) + cd $(srcdir); $(YAZCOMPLINE) z3950v3.asn + +# Date extension +$(srcdir)/z-date.c \ +$(top_srcdir)/include/yaz/z-date.h: $(srcdir)/z.tcl $(srcdir)/datetime.asn $(YAZCOMP) + cd $(srcdir); $(YAZCOMPLINE) datetime.asn + +# UNIverse extension +$(srcdir)/z-univ.c \ +$(top_srcdir)/include/yaz/z-univ.h: \ +$(srcdir)/z.tcl $(srcdir)/univres.asn $(YAZCOMP) + cd $(srcdir); $(YAZCOMPLINE) univres.asn + +# New Update extended service +$(srcdir)/zes-update.c \ +$(top_srcdir)/include/yaz/zes-update.h: \ +$(srcdir)/z.tcl $(srcdir)/esupdate.asn $(YAZCOMP) + cd $(srcdir); $(YAZCOMPLINE) esupdate.asn + +# Admin extended service +$(srcdir)/zes-admin.c \ +$(top_srcdir)/include/yaz/zes-admin.h: \ +$(srcdir)/z.tcl $(srcdir)/esadmin.asn $(YAZCOMP) + cd $(srcdir); $(YAZCOMPLINE) esadmin.asn + +# Charset negotiation +$(srcdir)/z-charneg.c: $(srcdir)/z.tcl $(srcdir)/charneg-3.asn + cd $(srcdir); $(YAZCOMPLINE) $(YCFLAGS) charneg-3.asn + +# UserInfoFormat-multipleSearchTerms-2 +$(srcdir)/z-mterm2.c: $(srcdir)/z.tcl $(srcdir)/mterm2.asn + cd $(srcdir); $(YAZCOMPLINE) mterm2.asn + +# UserInfoFormat-multipleSearchTerms-2 +$(srcdir)/z-oclcui.c: $(srcdir)/z.tcl $(srcdir)/oclcui.asn + cd $(srcdir); $(YAZCOMPLINE) oclcui.asn + +# ILL protocol +$(srcdir)/ill-core.c \ +$(top_srcdir)/include/yaz/ill-core.h: \ +$(srcdir)/ill.tcl $(srcdir)/ill9702.asn $(YAZCOMP) + cd $(srcdir); $(YAZCOMP) -d ill.tcl -i yaz -I ../include $(YCFLAGS) ill9702.asn + +# Item Request +$(srcdir)/item-req.c \ +$(top_srcdir)/include/yaz/item-req.h: \ +$(srcdir)/ill.tcl $(srcdir)/item-req.asn $(YAZCOMP) + cd $(srcdir); $(YAZCOMP) -d ill.tcl -i yaz -I ../include $(YCFLAGS) item-req.asn + +# Threaded versions of objects. +thr-nmem.lo: nmem.c + $(LTCOMPILE) $(THREADED_FLAGS) -c $(srcdir)/nmem.c -o thr-nmem.lo + +thr-statserv.lo: statserv.c + $(LTCOMPILE) $(THREADED_FLAGS) -c $(srcdir)/statserv.c -o thr-statserv.lo +thr-eventl.lo: eventl.c + $(LTCOMPILE) $(THREADED_FLAGS) -c $(srcdir)/eventl.c -o thr-eventl.lo + +# SSL versions of objects. +ssl-comstack.lo: comstack.c + $(LTCOMPILE) $(SSL_FLAGS) -c $(srcdir)/comstack.c -o ssl-comstack.lo + +ssl-tcpip.lo: tcpip.c + $(LTCOMPILE) $(SSL_FLAGS) -c $(srcdir)/tcpip.c -o ssl-tcpip.lo + + diff --git a/src/atoin.c b/src/atoin.c new file mode 100644 index 0000000..1bc5947 --- /dev/null +++ b/src/atoin.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1997-2003, Index Data + * See the file LICENSE for details. + * + * $Id: atoin.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +int atoi_n (const char *buf, int len) +{ + int val = 0; + + while (--len >= 0) + { + if (isdigit (*buf)) + val = val*10 + (*buf - '0'); + buf++; + } + return val; +} + diff --git a/src/ber_any.c b/src/ber_any.c new file mode 100644 index 0000000..c28ebb5 --- /dev/null +++ b/src/ber_any.c @@ -0,0 +1,152 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * + * $Id: ber_any.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include "odr-priv.h" + +int ber_any(ODR o, Odr_any **p) +{ + int res; + + switch (o->direction) + { + case ODR_DECODE: + if ((res = completeBER(o->bp, odr_max(o))) <= 0) /* FIX THIS */ + { + odr_seterror(o, OPROTO, 2); + return 0; + } + (*p)->buf = (unsigned char *)odr_malloc(o, res); + memcpy((*p)->buf, o->bp, res); + (*p)->len = (*p)->size = res; + o->bp += res; + return 1; + case ODR_ENCODE: + if (odr_write(o, (*p)->buf, (*p)->len) < 0) + return 0; + return 1; + default: odr_seterror(o, OOTHER, 3); return 0; + } +} + +#define BER_ANY_DEBUG 0 + +/* + * Return length of BER-package or 0. + */ +int completeBER_n(const unsigned char *buf, int len, int level) +{ + int res, ll, zclass, tag, cons; + const unsigned char *b = buf; + int bad = 0; + + if (len > 5000000 || level > 1000) + { + bad = 1; +#if BER_ANY_DEBUG + yaz_log(LOG_LOG, "completeBER lev=%d len=%d", level, len); +#endif + if (level > 1000) + return -2; + } + if (len < 2) + return 0; + if (!buf[0] && !buf[1]) + return -2; + if ((res = ber_dectag(b, &zclass, &tag, &cons, len)) <= 0) + return 0; +#if 0 +/* removed, since ber_dectag never reads that far .. */ + if (res > len) + return 0; +#endif + b += res; + len -= res; + assert (len >= 0); + res = ber_declen(b, &ll, len); + if (res == -2) + { +#if BER_ANY_DEBUG + if (bad) + yaz_log(LOG_LOG, "<<<<<<<<< return1 lev=%d res=%d", level, res); +#endif + return -1; /* error */ + } + if (res == -1) + { +#if BER_ANY_DEBUG + if (bad) + yaz_log(LOG_LOG, "<<<<<<<<< return3 lev=%d res=-1", level); +#endif + return 0; /* incomplete length */ + } + if (ll > 5000000) + { +#if BER_ANY_DEBUG + if (bad) + yaz_log(LOG_LOG, "<<<<<<<<< return2 lev=%d len=%d res=%d ll=%d", + level, len, res, ll); +#endif + return -1; /* error */ + } +#if 0 +/* no longer necessary, since ber_declen never reads that far (returns -1) */ + if (res > len) + { + if (bad) + yaz_log(LOG_LOG, "<<<<<<<<< return4 lev=%d res=%d len=%d", + level, res, len); + return 0; + } +#endif + b += res; + len -= res; + if (ll >= 0) + { /* definite length */ +#if BER_ANY_DEBUG + if (bad && len < ll) + yaz_log(LOG_LOG, "<<<<<<<<< return5 lev=%d len=%d ll=%d", + level, len, ll); +#endif + return (len >= ll ? ll + (b-buf) : 0); + } + /* indefinite length */ + if (!cons) + { /* if primitive, it's an error */ +#if BER_ANY_DEBUG + yaz_log(LOG_LOG, "<<<<<<<<< return6 lev=%d ll=%d len=%d res=%d", + level, ll, len, res); +#endif + return -1; /* error */ + } + /* constructed - cycle through children */ + while (len >= 2) + { + if (b[0] == 0 && b[1] == 0) + break; + if (!(res = completeBER_n(b, len, level+1))) + return 0; + if (res == -1) + return -1; + b += res; + len -= res; + } + if (len < 2) + return 0; + return (b - buf) + 2; +} + +int completeBER(const unsigned char *buf, int len) +{ + int res = completeBER_n(buf, len, 0); + if (res < 0) + return len; + return res; +} diff --git a/src/ber_bit.c b/src/ber_bit.c new file mode 100644 index 0000000..38260f0 --- /dev/null +++ b/src/ber_bit.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: ber_bit.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + * + */ +#if HAVE_CONFIG_H +#include +#endif + +#include "odr-priv.h" + +int ber_bitstring(ODR o, Odr_bitmask *p, int cons) +{ + int res, len; + const unsigned char *base; + + switch (o->direction) + { + case ODR_DECODE: + if ((res = ber_declen(o->bp, &len, odr_max(o))) < 0) + { + odr_seterror(o, OPROTO, 4); + return 0; + } + o->bp += res; + if (cons) /* fetch component strings */ + { + base = o->bp; + while (odp_more_chunks(o, base, len)) + if (!odr_bitstring(o, &p, 0, 0)) + return 0; + return 1; + } + /* primitive bitstring */ + if (len < 0) + { + odr_seterror(o, OOTHER, 5); + return 0; + } + if (len == 0) + return 1; + if (len - 1 > ODR_BITMASK_SIZE) + { + odr_seterror(o, OOTHER, 6); + return 0; + } + if (len > odr_max(o)) + { + odr_seterror(o, OOTHER, 7); + return 0; + } + o->bp++; /* silently ignore the unused-bits field */ + len--; + memcpy(p->bits + p->top + 1, o->bp, len); + p->top += len; + o->bp += len; + return 1; + case ODR_ENCODE: + if ((res = ber_enclen(o, p->top + 2, 5, 0)) < 0) + return 0; + if (odr_putc(o, 0) < 0) /* no unused bits here */ + return 0; + if (p->top < 0) + return 1; + if (odr_write(o, p->bits, p->top + 1) < 0) + return 0; + return 1; + case ODR_PRINT: + return 1; + default: + odr_seterror(o, OOTHER, 8); + return 0; + } +} diff --git a/src/ber_bool.c b/src/ber_bool.c new file mode 100644 index 0000000..2e4cca3 --- /dev/null +++ b/src/ber_bool.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: ber_bool.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include "odr-priv.h" + +int ber_boolean(ODR o, int *val) +{ + int res, len; + + switch (o->direction) + { + case ODR_ENCODE: + if (ber_enclen(o, 1, 1, 1) != 1) + return 0; + if (odr_putc(o, *val) < 0) + return 0; +#ifdef ODR_DEBUG + fprintf(stderr, "[val=%d]\n", *val); +#endif + return 1; + case ODR_DECODE: + if ((res = ber_declen(o->bp, &len, odr_max(o))) < 0) + { + odr_seterror(o, OPROTO, 9); + return 0; + } + o->bp+= res; + if (len != 1 || odr_max(o) < len) + { + odr_seterror(o, OPROTO, 10); + return 0; + } + *val = *o->bp; + o->bp++; +#ifdef ODR_DEBUG + fprintf(stderr, "[val=%d]\n", *val); +#endif + return 1; + case ODR_PRINT: + return 1; + default: odr_seterror(o, OOTHER, 11); return 0; + } +} diff --git a/src/ber_int.c b/src/ber_int.c new file mode 100644 index 0000000..7b1aba8 --- /dev/null +++ b/src/ber_int.c @@ -0,0 +1,105 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: ber_int.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include + +#ifdef WIN32 +#include +#else +#include +#include +#endif + +#include "odr-priv.h" + +static int ber_encinteger(ODR o, int val); +static int ber_decinteger(const unsigned char *buf, int *val, int max); + +int ber_integer(ODR o, int *val) +{ + int res; + + switch (o->direction) + { + case ODR_DECODE: + if ((res = ber_decinteger(o->bp, val, odr_max(o))) <= 0) + { + odr_seterror(o, OPROTO, 50); + return 0; + } + o->bp += res; + return 1; + case ODR_ENCODE: + if ((res = ber_encinteger(o, *val)) < 0) + return 0; + return 1; + case ODR_PRINT: return 1; + default: odr_seterror(o, OOTHER, 51); return 0; + } +} + +/* + * Returns: number of bytes written or -1 for error (out of bounds). + */ +int ber_encinteger(ODR o, int val) +{ + int a, len; + union { int i; unsigned char c[sizeof(int)]; } tmp; + + tmp.i = htonl(val); /* ensure that that we're big-endian */ + for (a = 0; a < (int) sizeof(int) - 1; a++) /* skip superfluous octets */ + if (!((tmp.c[a] == 0 && !(tmp.c[a+1] & 0X80)) || + (tmp.c[a] == 0XFF && (tmp.c[a+1] & 0X80)))) + break; + len = sizeof(int) - a; + if (ber_enclen(o, len, 1, 1) != 1) + return -1; + if (odr_write(o, (unsigned char*) tmp.c + a, len) < 0) + return -1; +#ifdef ODR_DEBUG + fprintf(stderr, "[val=%d]", val); +#endif + return 0; +} + +/* + * Returns: Number of bytes read or 0 if no match, -1 if error. + */ +int ber_decinteger(const unsigned char *buf, int *val, int max) +{ + const unsigned char *b = buf; + unsigned char fill; + int res, len, remains; + union { int i; unsigned char c[sizeof(int)]; } tmp; + + if ((res = ber_declen(b, &len, max)) < 0) + return -1; + if (len+res > max || len < 0) /* out of bounds or indefinite encoding */ + return -1; + if (len > (int) sizeof(int)) /* let's be reasonable, here */ + return -1; + b+= res; + + remains = sizeof(int) - len; + memcpy(tmp.c + remains, b, len); + if (*b & 0X80) + fill = 0XFF; + else + fill = 0X00; + memset(tmp.c, fill, remains); + *val = ntohl(tmp.i); + + b += len; +#ifdef ODR_DEBUG + fprintf(stderr, "[val=%d]", *val); +#endif + return b - buf; +} diff --git a/src/ber_len.c b/src/ber_len.c new file mode 100644 index 0000000..bb4c08a --- /dev/null +++ b/src/ber_len.c @@ -0,0 +1,133 @@ +/* + * Copyright (C) 1995-2003, Index Data. + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: ber_len.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include "odr-priv.h" + +/* + * Encode BER length octets. If exact, lenlen is the exact desired + * encoding size, else, lenlen is the max available space. Len < 0 = + * Indefinite encoding. + * Returns: >0 success, number of bytes encoded. + * Returns: =0 success, indefinite start-marker set. 1 byte encoded. + * Returns: -1 failure, out of bounds. + */ +int ber_enclen(ODR o, int len, int lenlen, int exact) +{ + unsigned char octs[sizeof(int)]; + int n = 0; + int lenpos, end; + +#ifdef ODR_DEBUG + fprintf(stderr, "[len=%d]", len); +#endif + if (len < 0) /* Indefinite */ + { + if (odr_putc(o, 0x80) < 0) + return 0; +#ifdef ODR_DEBUG + fprintf(stderr, "[indefinite]"); +#endif + return 0; + } + if (len <= 127 && (lenlen == 1 || !exact)) /* definite short form */ + { + if (odr_putc(o, (unsigned char) len) < 0) + return 0; + return 1; + } + if (lenlen == 1) + { + if (odr_putc(o, 0x80) < 0) + return 0; + return 0; + } + /* definite long form */ + do + { + octs[n++] = len; + len >>= 8; + } + while (len); + if (n >= lenlen) + return -1; + lenpos = odr_tell(o); /* remember length-of-length position */ + if (odr_putc(o, 0) < 0) /* dummy */ + return 0; + if (exact) + while (n < --lenlen) /* pad length octets */ + if (odr_putc(o, 0) < 0) + return 0; + while (n--) + if (odr_putc(o, octs[n]) < 0) + return 0; + /* set length of length */ + end = odr_tell(o); + odr_seek(o, ODR_S_SET, lenpos); + if (odr_putc(o, (end - lenpos - 1) | 0X80) < 0) + return 0; + odr_seek(o, ODR_S_END, 0); + return odr_tell(o) - lenpos; +} + +/* + * Decode BER length octets. Returns + * > 0 : number of bytes read + * -1 : not enough room to read bytes within max bytes + * -2 : other error + * + * After return: + * len = -1 indefinite length. + * len >= 0 definite length + */ +int ber_declen(const unsigned char *buf, int *len, int max) +{ + const unsigned char *b = buf; + int n; + + if (max < 1) + return -1; + if (*b == 0X80) /* Indefinite */ + { + *len = -1; +#ifdef ODR_DEBUG + fprintf(stderr, "[len=%d]", *len); +#endif + return 1; + } + if (!(*b & 0X80)) /* Definite short form */ + { + *len = (int) *b; +#ifdef ODR_DEBUG + fprintf(stderr, "[len=%d]", *len); +#endif + return 1; + } + if (*b == 0XFF) /* reserved value */ + return -2; + /* indefinite long form */ + n = *b & 0X7F; + if (n >= max) + return -1; + *len = 0; + b++; + while (--n >= 0) + { + *len <<= 8; + *len |= *(b++); + } + if (*len < 0) + return -2; +#ifdef ODR_DEBUG + fprintf(stderr, "[len=%d]", *len); +#endif + return (b - buf); +} diff --git a/src/ber_null.c b/src/ber_null.c new file mode 100644 index 0000000..b0db7f3 --- /dev/null +++ b/src/ber_null.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: ber_null.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include "odr-priv.h" + +/* + * BER-en/decoder for NULL type. + */ +int ber_null(ODR o) +{ + switch (o->direction) + { + case ODR_ENCODE: + if (odr_putc(o, 0X00) < 0) + return 0; +#ifdef ODR_DEBUG + fprintf(stderr, "[NULL]\n"); +#endif + return 1; + case ODR_DECODE: + if (odr_max(o) < 1) + { + odr_seterror(o, OPROTO, 39); + return 0; + } + if (*(o->bp++) != 0X00) + { + odr_seterror(o, OPROTO, 12); + return 0; + } +#ifdef ODR_DEBUG + fprintf(stderr, "[NULL]\n"); +#endif + return 1; + case ODR_PRINT: return 1; + default: odr_seterror(o, OOTHER, 13); return 0; + } +} diff --git a/src/ber_oct.c b/src/ber_oct.c new file mode 100644 index 0000000..133a64b --- /dev/null +++ b/src/ber_oct.c @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: ber_oct.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include "odr-priv.h" + +int ber_octetstring(ODR o, Odr_oct *p, int cons) +{ + int res, len; + const unsigned char *base; + unsigned char *c; + + switch (o->direction) + { + case ODR_DECODE: + if ((res = ber_declen(o->bp, &len, odr_max(o))) < 0) + { + odr_seterror(o, OPROTO, 14); + return 0; + } + o->bp += res; + if (cons) /* fetch component strings */ + { + base = o->bp; + while (odp_more_chunks(o, base, len)) + if (!odr_octetstring(o, &p, 0, 0)) + return 0; + return 1; + } + /* primitive octetstring */ + if (len < 0) + { + odr_seterror(o, OOTHER, 15); + return 0; + } + if (len > odr_max(o)) + { + odr_seterror(o, OOTHER, 16); + return 0; + } + if (len + 1 > p->size - p->len) + { + c = (unsigned char *)odr_malloc(o, p->size += len + 1); + if (p->len) + memcpy(c, p->buf, p->len); + p->buf = c; + } + if (len) + memcpy(p->buf + p->len, o->bp, len); + p->len += len; + o->bp += len; + /* the final null is really not part of the buffer, but */ + /* it helps somes applications that assumes C strings */ + if (len) + p->buf[p->len] = '\0'; + return 1; + case ODR_ENCODE: + if ((res = ber_enclen(o, p->len, 5, 0)) < 0) + return 0; + if (p->len == 0) + return 1; + if (odr_write(o, p->buf, p->len) < 0) + return 0; + return 1; + case ODR_PRINT: return 1; + default: odr_seterror(o, OOTHER, 17); return 0; + } +} diff --git a/src/ber_oid.c b/src/ber_oid.c new file mode 100644 index 0000000..276b49b --- /dev/null +++ b/src/ber_oid.c @@ -0,0 +1,113 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: ber_oid.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include "odr-priv.h" + +int ber_oidc(ODR o, Odr_oid *p) +{ + int len, lenp, end; + int pos, n, res, id; + unsigned char octs[8]; + + switch (o->direction) + { + case ODR_DECODE: + if ((res = ber_declen(o->bp, &len, odr_max(o))) < 1) + { + odr_seterror(o, OPROTO, 18); + return 0; + } + if (len < 0) + { + odr_seterror(o, OPROTO, 19); + return 0; + } + o->bp += res; + if (len == 0) + { + *p = -1; + return 1; + } + if (len > odr_max(o)) + { + odr_seterror(o, OPROTO, 20); + return 0; + } + p[0] = *o->bp / 40; + if (p[0] > 2) + p[0] = 2; + p[1] = *o->bp - p[0] * 40; + o->bp++; + pos = 2; + len--; + while (len) + { + p[pos] = 0; + do + { + if (!len) + { + odr_seterror(o, OPROTO, 21); + return 0; + } + p[pos] <<= 7; + p[pos] |= *o->bp & 0X7F; + len--; + } + while (*(o->bp++) & 0X80); + pos++; + } + p[pos] = -1; + return 1; + case ODR_ENCODE: + /* we'll allow ourselves the quiet luxury of only doing encodings + shorter than 127 */ + lenp = odr_tell(o); + if (odr_putc(o, 0) < 0) /* dummy */ + return 0; + if (p[0] < 0 && p[1] <= 0) + { + odr_seterror(o, ODATA, 23); + return 0; + } + for (pos = 1; p[pos] >= 0; pos++) + { + id = pos > 1 ? p[pos] : p[0] * 40 + p[1]; + n = 0; + do + { + octs[n++] = id & 0X7F; + id >>= 7; + } + while (id); + while (n--) + { + unsigned char p; + + p = octs[n] | ((n > 0) << 7); + if (odr_putc(o, p) < 0) + return 0; + } + } + end = odr_tell(o); + odr_seek(o, ODR_S_SET, lenp); + if (ber_enclen(o, (end - lenp) - 1, 1, 1) != 1) + { + odr_seterror(o, OOTHER, 52); + return 0; + } + odr_seek(o, ODR_S_END, 0); + return 1; + default: + odr_seterror(o, OOTHER, 22); + return 0; + } +} diff --git a/src/ber_tag.c b/src/ber_tag.c new file mode 100644 index 0000000..19c412f --- /dev/null +++ b/src/ber_tag.c @@ -0,0 +1,186 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: ber_tag.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include "odr-priv.h" + +/* ber_tag + * On encoding: + * if p: write tag. return 1 (success) or -1 (error). + * if !p: return 0. + * On decoding: + * if tag && zclass match up, advance pointer and return 1. set cons. + * else leave pointer unchanged. Return 0. + * + * Should perhaps be odr_tag? + */ +int ber_tag(ODR o, void *p, int zclass, int tag, int *constructed, int opt, + const char *name) +{ + struct Odr_ber_tag *odr_ber_tag = &o->op->odr_ber_tag; + int rd; + char **pp = (char **)p; + + if (o->direction == ODR_DECODE) + *pp = 0; + o->t_class = -1; + if (o->op->stackp < 0) + { + odr_seek(o, ODR_S_SET, 0); + o->top = 0; + o->bp = o->buf; + odr_ber_tag->lclass = -1; + } + switch (o->direction) + { + case ODR_ENCODE: + if (!*pp) + { + if (!opt) + { + odr_seterror(o, OREQUIRED, 24); + odr_setelement (o, name); + } + return 0; + } + if ((rd = ber_enctag(o, zclass, tag, *constructed)) < 0) + return -1; +#ifdef ODR_DEBUG + fprintf(stderr, "\n[class=%d,tag=%d,cons=%d,stackp=%d]", zclass, tag, + *constructed, o->stackp); +#endif + return 1; + + case ODR_DECODE: + if (o->op->stackp > -1 && !odr_constructed_more(o)) + { + if (!opt) + { + odr_seterror(o, OREQUIRED, 25); + odr_setelement(o, name); + } + return 0; + } + if (odr_ber_tag->lclass < 0) + { + if ((odr_ber_tag->br = + ber_dectag(o->bp, &odr_ber_tag->lclass, + &odr_ber_tag->ltag, &odr_ber_tag->lcons, + odr_max(o))) <= 0) + { + odr_seterror(o, OPROTO, 26); + odr_setelement(o, name); + return 0; + } +#ifdef ODR_DEBUG + fprintf(stderr, + "\n[class=%d,tag=%d,cons=%d,stackp=%d]", + odr_ber_tag->lclass, odr_ber_tag->ltag, + odr_ber_tag->lcons, o->stackp); +#endif + } + if (zclass == odr_ber_tag->lclass && tag == odr_ber_tag->ltag) + { + o->bp += odr_ber_tag->br; + *constructed = odr_ber_tag->lcons; + odr_ber_tag->lclass = -1; + return 1; + } + else + { + if (!opt) + { + odr_seterror(o, OREQUIRED, 27); + odr_setelement(o, name); + } + return 0; + } + case ODR_PRINT: + if (!*pp && !opt) + { + odr_seterror(o,OREQUIRED, 28); + odr_setelement(o, name); + } + return *pp != 0; + default: + odr_seterror(o, OOTHER, 29); + odr_setelement(o, name); + return 0; + } +} + +/* ber_enctag + * BER-encode a zclass/tag/constructed package (identifier octets). Return + * number of bytes encoded, or -1 if out of bounds. + */ +int ber_enctag(ODR o, int zclass, int tag, int constructed) +{ + int cons = (constructed ? 1 : 0), n = 0; + unsigned char octs[sizeof(int)], b; + + b = (zclass << 6) & 0XC0; + b |= (cons << 5) & 0X20; + if (tag <= 30) + { + b |= tag & 0X1F; + if (odr_putc(o, b) < 0) + return -1; + return 1; + } + else + { + b |= 0X1F; + if (odr_putc(o, b) < 0) + return -1; + do + { + octs[n++] = tag & 0X7F; + tag >>= 7; + } + while (tag); + while (n--) + { + unsigned char oo; + + oo = octs[n] | ((n > 0) << 7); + if (odr_putc(o, oo) < 0) + return -1; + } + return 0; + } +} + +/* ber_dectag + * Decode BER identifier octets. Return number of bytes read or -1 for error. + */ +int ber_dectag(const unsigned char *b, int *zclass, int *tag, + int *constructed, int max) +{ + int l = 1; + + if (l > max) + return -1; + + *zclass = *b >> 6; + *constructed = (*b >> 5) & 0X01; + if ((*tag = *b & 0x1F) <= 30) + return 1; + *tag = 0; + do + { + if (l >= max) + return -1; + *tag <<= 7; + *tag |= b[l] & 0X7F; + } + while (b[l++] & 0X80); + return l; +} diff --git a/src/cclerrms.c b/src/cclerrms.c new file mode 100644 index 0000000..53d4ac5 --- /dev/null +++ b/src/cclerrms.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 1995, the EUROPAGATE consortium (see below). + * + * The EUROPAGATE consortium members are: + * + * University College Dublin + * Danmarks Teknologiske Videnscenter + * An Chomhairle Leabharlanna + * Consejo Superior de Investigaciones Cientificas + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation, in whole or in part, for any purpose, is hereby granted, + * provided that: + * + * 1. This copyright and permission notice appear in all copies of the + * software and its documentation. Notices of copyright or attribution + * which appear at the beginning of any file must remain unchanged. + * + * 2. The names of EUROPAGATE or the project partners may not be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * 3. Users of this software (implementors and gateway operators) agree to + * inform the EUROPAGATE consortium of their use of the software. This + * information will be used to evaluate the EUROPAGATE project and the + * software, and to plan further developments. The consortium may use + * the information in later publications. + * + * 4. Users of this software agree to make their best efforts, when + * documenting their use of the software, to acknowledge the EUROPAGATE + * consortium, and the role played by the software in their work. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE + * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF + * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA + * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND + * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* + * Europagate, 1995 + * + * $Id: cclerrms.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + * + * Old Europagate Log: + * + * Revision 1.8 1995/05/16 09:39:25 adam + * LICENSE. + * + * Revision 1.7 1995/04/17 09:31:40 adam + * Improved handling of qualifiers. Aliases or reserved words. + * + * Revision 1.6 1995/02/23 08:31:59 adam + * Changed header. + * + * Revision 1.4 1995/02/14 16:20:54 adam + * Qualifiers are read from a file now. + * + * Revision 1.3 1995/02/14 10:25:56 adam + * The constructions 'qualifier rel term ...' implemented. + * + * Revision 1.2 1995/02/13 15:15:06 adam + * Added handling of qualifiers. Not finished yet. + * + * Revision 1.1 1995/02/13 12:35:20 adam + * First version of CCL. Qualifiers aren't handled yet. + * + */ + +#include + +static char *err_msg_array[] = { + "Ok", + "Search word expected", + "')' expected", + "Set name expected", + "Operator expected", + "Unbalanced ')'", + "Unknown qualifier", + "Qualifiers applied twice", + "'=' expected", + "Bad relation", + "Left truncation not supported", + "Both left - and right truncation not supported", + "Right truncation not supported" +}; + +/* + * ccl_err_msg: return name of CCL error + * ccl_errno: Error no. + * return: Name of error. + */ +const char *ccl_err_msg (int ccl_errno) +{ + return err_msg_array[ccl_errno]; +} diff --git a/src/cclfind.c b/src/cclfind.c new file mode 100644 index 0000000..7cad1ab --- /dev/null +++ b/src/cclfind.c @@ -0,0 +1,1114 @@ +/* + * Copyright (c) 1995, the EUROPAGATE consortium (see below). + * + * The EUROPAGATE consortium members are: + * + * University College Dublin + * Danmarks Teknologiske Videnscenter + * An Chomhairle Leabharlanna + * Consejo Superior de Investigaciones Cientificas + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation, in whole or in part, for any purpose, is hereby granted, + * provided that: + * + * 1. This copyright and permission notice appear in all copies of the + * software and its documentation. Notices of copyright or attribution + * which appear at the beginning of any file must remain unchanged. + * + * 2. The names of EUROPAGATE or the project partners may not be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * 3. Users of this software (implementors and gateway operators) agree to + * inform the EUROPAGATE consortium of their use of the software. This + * information will be used to evaluate the EUROPAGATE project and the + * software, and to plan further developments. The consortium may use + * the information in later publications. + * + * 4. Users of this software agree to make their best efforts, when + * documenting their use of the software, to acknowledge the EUROPAGATE + * consortium, and the role played by the software in their work. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE + * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF + * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA + * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND + * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* CCL find (to rpn conversion) + * Europagate, 1995 + * + * $Id: cclfind.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + * + * Old Europagate log: + * + * Revision 1.16 1996/01/08 08:41:13 adam + * Removed unused function. + * + * Revision 1.15 1995/07/20 08:14:34 adam + * Qualifiers were observed too often. Instead tokens are treated as + * qualifiers only when separated by comma. + * + * Revision 1.14 1995/05/16 09:39:26 adam + * LICENSE. + * + * Revision 1.13 1995/04/17 09:31:42 adam + * Improved handling of qualifiers. Aliases or reserved words. + * + * Revision 1.12 1995/03/20 15:27:43 adam + * Minor changes. + * + * Revision 1.11 1995/02/23 08:31:59 adam + * Changed header. + * + * Revision 1.9 1995/02/16 13:20:06 adam + * Spell fix. + * + * Revision 1.8 1995/02/14 19:59:42 adam + * Removed a syntax error. + * + * Revision 1.7 1995/02/14 19:55:10 adam + * Header files ccl.h/cclp.h are gone! They have been merged an + * moved to ../include/ccl.h. + * Node kind(s) in ccl_rpn_node have changed names. + * + * Revision 1.6 1995/02/14 16:20:55 adam + * Qualifiers are read from a file now. + * + * Revision 1.5 1995/02/14 14:12:41 adam + * Ranges for ordered qualfiers implemented (e.g. pd=1980-1990). + * + * Revision 1.4 1995/02/14 13:16:29 adam + * Left and/or right truncation implemented. + * + * Revision 1.3 1995/02/14 10:25:56 adam + * The constructions 'qualifier rel term ...' implemented. + * + * Revision 1.2 1995/02/13 15:15:07 adam + * Added handling of qualifiers. Not finished yet. + * + * Revision 1.1 1995/02/13 12:35:20 adam + * First version of CCL. Qualifiers aren't handled yet. + * + */ + +#include +#include + +#include + +/* returns type of current lookahead */ +#define KIND (cclp->look_token->kind) + +/* move one token forward */ +#define ADVANCE cclp->look_token = cclp->look_token->next + +/* + * qual_val_type: test for existance of attribute type/value pair. + * qa: Attribute array + * type: Type of attribute to search for + * value: Value of attribute to seach for + * return: 1 if found; 0 otherwise. + */ +static int qual_val_type (struct ccl_rpn_attr **qa, int type, int value, + char **attset) +{ + int i; + struct ccl_rpn_attr *q; + + if (!qa) + return 0; + for (i = 0; (q=qa[i]); i++) + while (q) + { + if (q->type == type && q->kind == CCL_RPN_ATTR_NUMERIC && + q->value.numeric == value) + { + if (attset) + *attset = q->set; + return 1; + } + q = q->next; + } + return 0; +} + +/* + * strxcat: concatenate strings. + * n: Null-terminated Destination string + * src: Source string to be appended (not null-terminated) + * len: Length of source string. + */ +static void strxcat (char *n, const char *src, int len) +{ + while (*n) + n++; + while (--len >= 0) + *n++ = *src++; + *n = '\0'; +} + +/* + * copy_token_name: Return copy of CCL token name + * tp: Pointer to token info. + * return: malloc(3) allocated copy of token name. + */ +static char *copy_token_name (struct ccl_token *tp) +{ + char *str = (char *)xmalloc (tp->len + 1); + ccl_assert (str); + memcpy (str, tp->name, tp->len); + str[tp->len] = '\0'; + return str; +} + +/* + * mk_node: Create RPN node. + * kind: Type of node. + * return: pointer to allocated node. + */ +static struct ccl_rpn_node *mk_node (int kind) +{ + struct ccl_rpn_node *p; + p = (struct ccl_rpn_node *)xmalloc (sizeof(*p)); + ccl_assert (p); + p->kind = kind; + return p; +} + +/* + * ccl_rpn_delete: Delete RPN tree. + * rpn: Pointer to tree. + */ +void ccl_rpn_delete (struct ccl_rpn_node *rpn) +{ + struct ccl_rpn_attr *attr, *attr1; + if (!rpn) + return; + switch (rpn->kind) + { + case CCL_RPN_AND: + case CCL_RPN_OR: + case CCL_RPN_NOT: + ccl_rpn_delete (rpn->u.p[0]); + ccl_rpn_delete (rpn->u.p[1]); + break; + case CCL_RPN_TERM: + xfree (rpn->u.t.term); + for (attr = rpn->u.t.attr_list; attr; attr = attr1) + { + attr1 = attr->next; + if (attr->kind == CCL_RPN_ATTR_STRING) + xfree(attr->value.str); + if (attr->set) + xfree (attr->set); + xfree (attr); + } + break; + case CCL_RPN_SET: + xfree (rpn->u.setname); + break; + case CCL_RPN_PROX: + ccl_rpn_delete (rpn->u.p[0]); + ccl_rpn_delete (rpn->u.p[1]); + break; + } + xfree (rpn); +} + +static struct ccl_rpn_node *find_spec (CCL_parser cclp, + struct ccl_rpn_attr **qa); + +static int is_term_ok (int look, int *list) +{ + for (;*list >= 0; list++) + if (look == *list) + return 1; + return 0; +} + +static struct ccl_rpn_node *search_terms (CCL_parser cclp, + struct ccl_rpn_attr **qa); + +static struct ccl_rpn_attr *add_attr_node (struct ccl_rpn_node *p, + const char *set, int type) +{ + struct ccl_rpn_attr *n; + + n = (struct ccl_rpn_attr *)xmalloc (sizeof(*n)); + ccl_assert (n); + if (set) + { + n->set = (char*) xmalloc (strlen(set)+1); + strcpy (n->set, set); + } + else + n->set = 0; + n->type = type; + n->next = p->u.t.attr_list; + p->u.t.attr_list = n; + + n->kind = CCL_RPN_ATTR_NUMERIC; + n->value.numeric = 0; + return n; +} + +/* + * add_attr_numeric: Add attribute (type/value) to RPN term node. + * p: RPN node of type term. + * type: Type of attribute + * value: Value of attribute + * set: Attribute set name + */ +static void add_attr_numeric (struct ccl_rpn_node *p, const char *set, + int type, int value) +{ + struct ccl_rpn_attr *n; + + n = add_attr_node(p, set, type); + n->kind = CCL_RPN_ATTR_NUMERIC; + n->value.numeric = value; +} + +static void add_attr_string (struct ccl_rpn_node *p, const char *set, + int type, char *value) +{ + struct ccl_rpn_attr *n; + + n = add_attr_node(p, set, type); + n->kind = CCL_RPN_ATTR_STRING; + n->value.str = xstrdup(value); +} + + +/* + * search_term: Parse CCL search term. + * cclp: CCL Parser + * qa: Qualifier attributes already applied. + * term_list: tokens we accept as terms in context + * multi: whether we accept "multiple" tokens + * return: pointer to node(s); NULL on error. + */ +static struct ccl_rpn_node *search_term_x (CCL_parser cclp, + struct ccl_rpn_attr **qa, + int *term_list, int multi) +{ + struct ccl_rpn_node *p_top = 0; + struct ccl_token *lookahead = cclp->look_token; + int and_list = 0; + int or_list = 0; + char *attset; + const char *truncation_aliases; + + truncation_aliases = + ccl_qual_search_special(cclp->bibset, "truncation"); + if (!truncation_aliases) + truncation_aliases = "?"; + + if (qual_val_type (qa, CCL_BIB1_STR, CCL_BIB1_STR_AND_LIST, 0)) + and_list = 1; + if (qual_val_type (qa, CCL_BIB1_STR, CCL_BIB1_STR_OR_LIST, 0)) + or_list = 1; + while (1) + { + struct ccl_rpn_node *p; + size_t no, i; + int no_spaces = 0; + int left_trunc = 0; + int right_trunc = 0; + int mid_trunc = 0; + int relation_value = -1; + int position_value = -1; + int structure_value = -1; + int truncation_value = -1; + int completeness_value = -1; + int len = 0; + size_t max = 200; + if (and_list || or_list || !multi) + max = 1; + + /* ignore commas when dealing with and-lists .. */ + if (and_list && lookahead && lookahead->kind == CCL_TOK_COMMA) + { + lookahead = lookahead->next; + ADVANCE; + continue; + } + /* go through each TERM token. If no truncation attribute is yet + met, then look for left/right truncation markers (?) and + set left_trunc/right_trunc/mid_trunc accordingly */ + for (no = 0; no < max && is_term_ok(lookahead->kind, term_list); no++) + { + for (i = 0; ilen; i++) + if (lookahead->name[i] == ' ') + no_spaces++; + else if (strchr(truncation_aliases, lookahead->name[i])) + { + if (no == 0 && i == 0 && lookahead->len >= 1) + left_trunc = 1; + else if (!is_term_ok(lookahead->next->kind, term_list) && + i == lookahead->len-1 && i >= 1) + right_trunc = 1; + else + mid_trunc = 1; + } + len += 1+lookahead->len; + lookahead = lookahead->next; + } + + if (len == 0) + break; /* no more terms . stop . */ + + + if (p_top) + { + if (or_list) + p = mk_node (CCL_RPN_OR); + else if (and_list) + p = mk_node (CCL_RPN_AND); + else + p = mk_node (CCL_RPN_AND); + p->u.p[0] = p_top; + p_top = p; + } + + /* create the term node, but wait a moment before adding the term */ + p = mk_node (CCL_RPN_TERM); + p->u.t.attr_list = NULL; + p->u.t.term = NULL; + + /* make the top node point to us.. */ + if (p_top) + p_top->u.p[1] = p; + else + p_top = p; + + + /* go through all attributes and add them to the attribute list */ + for (i=0; qa && qa[i]; i++) + { + struct ccl_rpn_attr *attr; + + for (attr = qa[i]; attr; attr = attr->next) + switch(attr->kind) + { + case CCL_RPN_ATTR_STRING: + add_attr_string(p, attr->set, attr->type, + attr->value.str); + break; + case CCL_RPN_ATTR_NUMERIC: + if (attr->value.numeric > 0) + { /* deal only with REAL attributes (positive) */ + switch (attr->type) + { + case CCL_BIB1_REL: + if (relation_value != -1) + continue; + relation_value = attr->value.numeric; + break; + case CCL_BIB1_POS: + if (position_value != -1) + continue; + position_value = attr->value.numeric; + break; + case CCL_BIB1_STR: + if (structure_value != -1) + continue; + structure_value = attr->value.numeric; + break; + case CCL_BIB1_TRU: + if (truncation_value != -1) + continue; + truncation_value = attr->value.numeric; + left_trunc = right_trunc = mid_trunc = 0; + break; + case CCL_BIB1_COM: + if (completeness_value != -1) + continue; + completeness_value = attr->value.numeric; + break; + } + add_attr_numeric(p, attr->set, attr->type, + attr->value.numeric); + } + } + } + /* len now holds the number of characters in the RPN term */ + /* no holds the number of CCL tokens (1 or more) */ + + if (structure_value == -1 && + qual_val_type (qa, CCL_BIB1_STR, CCL_BIB1_STR_WP, &attset)) + { /* no structure attribute met. Apply either structure attribute + WORD or PHRASE depending on number of CCL tokens */ + if (no == 1 && no_spaces == 0) + add_attr_numeric (p, attset, CCL_BIB1_STR, 2); + else + add_attr_numeric (p, attset, CCL_BIB1_STR, 1); + } + + /* make the RPN token */ + p->u.t.term = (char *)xmalloc (len); + ccl_assert (p->u.t.term); + p->u.t.term[0] = '\0'; + for (i = 0; ilook_token->name; + int src_len = cclp->look_token->len; + + if (i == 0 && left_trunc) + { + src_len--; + src_str++; + } + else if (i == no-1 && right_trunc) + src_len--; + if (src_len) + { + int len = strlen(p->u.t.term); + if (len && + !strchr("-+", *src_str) && + !strchr("-+", p->u.t.term[len-1])) + { + strcat (p->u.t.term, " "); + } + } + strxcat (p->u.t.term, src_str, src_len); + ADVANCE; + } + if (left_trunc && right_trunc) + { + if (!qual_val_type (qa, CCL_BIB1_TRU, CCL_BIB1_TRU_CAN_BOTH, + &attset)) + { + cclp->error_code = CCL_ERR_TRUNC_NOT_BOTH; + ccl_rpn_delete (p); + return NULL; + } + add_attr_numeric (p, attset, CCL_BIB1_TRU, 3); + } + else if (right_trunc) + { + if (!qual_val_type (qa, CCL_BIB1_TRU, CCL_BIB1_TRU_CAN_RIGHT, + &attset)) + { + cclp->error_code = CCL_ERR_TRUNC_NOT_RIGHT; + ccl_rpn_delete (p); + return NULL; + } + add_attr_numeric (p, attset, CCL_BIB1_TRU, 1); + } + else if (left_trunc) + { + if (!qual_val_type (qa, CCL_BIB1_TRU, CCL_BIB1_TRU_CAN_LEFT, + &attset)) + { + cclp->error_code = CCL_ERR_TRUNC_NOT_LEFT; + ccl_rpn_delete (p); + return NULL; + } + add_attr_numeric (p, attset, CCL_BIB1_TRU, 2); + } + else + { + if (qual_val_type (qa, CCL_BIB1_TRU, CCL_BIB1_TRU_CAN_NONE, + &attset)) + add_attr_numeric (p, attset, CCL_BIB1_TRU, 100); + } + if (!multi) + break; + } + if (!p_top) + cclp->error_code = CCL_ERR_TERM_EXPECTED; + return p_top; +} + +static struct ccl_rpn_node *search_term (CCL_parser cclp, + struct ccl_rpn_attr **qa) +{ + static int list[] = {CCL_TOK_TERM, CCL_TOK_COMMA, -1}; + return search_term_x(cclp, qa, list, 0); +} + +static struct ccl_rpn_node *qualifiers2 (CCL_parser cclp, + struct ccl_rpn_attr **ap) +{ + char *attset; + int rel; + + if (!qual_val_type(ap, CCL_BIB1_REL, CCL_BIB1_REL_ORDER, &attset)) + { + /* unordered relation */ + struct ccl_rpn_node *p; + if (KIND != CCL_TOK_EQ) + { + cclp->error_code = CCL_ERR_EQ_EXPECTED; + return NULL; + } + ADVANCE; + if (KIND == CCL_TOK_LP) + { + ADVANCE; + if (!(p = find_spec (cclp, ap))) + { + return NULL; + } + if (KIND != CCL_TOK_RP) + { + cclp->error_code = CCL_ERR_RP_EXPECTED; + ccl_rpn_delete (p); + return NULL; + } + ADVANCE; + } + else + p = search_terms (cclp, ap); + return p; + } + /* ordered relation ... */ + rel = 0; + if (cclp->look_token->len == 1) + { + if (cclp->look_token->name[0] == '<') + rel = 1; + else if (cclp->look_token->name[0] == '=') + rel = 3; + else if (cclp->look_token->name[0] == '>') + rel = 5; + } + else if (cclp->look_token->len == 2) + { + if (!memcmp (cclp->look_token->name, "<=", 2)) + rel = 2; + else if (!memcmp (cclp->look_token->name, ">=", 2)) + rel = 4; + else if (!memcmp (cclp->look_token->name, "<>", 2)) + rel = 6; + } + if (!rel) + cclp->error_code = CCL_ERR_BAD_RELATION; + else + { + struct ccl_rpn_node *p; + + ADVANCE; /* skip relation */ + if (KIND == CCL_TOK_TERM && + cclp->look_token->next && cclp->look_token->next->len == 1 && + cclp->look_token->next->name[0] == '-') + { + struct ccl_rpn_node *p1; + if (!(p1 = search_term (cclp, ap))) + return NULL; + ADVANCE; /* skip '-' */ + if (KIND == CCL_TOK_TERM) /* = term - term ? */ + { + struct ccl_rpn_node *p2; + + if (!(p2 = search_term (cclp, ap))) + { + ccl_rpn_delete (p1); + return NULL; + } + p = mk_node (CCL_RPN_AND); + p->u.p[0] = p1; + add_attr_numeric (p1, attset, CCL_BIB1_REL, 4); + p->u.p[1] = p2; + add_attr_numeric (p2, attset, CCL_BIB1_REL, 2); + return p; + } + else /* = term - */ + { + add_attr_numeric (p1, attset, CCL_BIB1_REL, 4); + return p1; + } + } + else if (cclp->look_token->len == 1 && + cclp->look_token->name[0] == '-') /* = - term ? */ + { + ADVANCE; + if (!(p = search_term (cclp, ap))) + return NULL; + add_attr_numeric (p, attset, CCL_BIB1_REL, 2); + return p; + } + else if (KIND == CCL_TOK_LP) + { + ADVANCE; + if (!(p = find_spec (cclp, ap))) + return NULL; + if (KIND != CCL_TOK_RP) + { + cclp->error_code = CCL_ERR_RP_EXPECTED; + ccl_rpn_delete (p); + return NULL; + } + ADVANCE; + return p; + } + else + { + if (!(p = search_terms (cclp, ap))) + return NULL; + add_attr_numeric (p, attset, CCL_BIB1_REL, rel); + return p; + } + cclp->error_code = CCL_ERR_TERM_EXPECTED; + } + return NULL; +} + +/* + * qualifiers1: Parse CCL qualifiers and search terms. + * cclp: CCL Parser + * la: Token pointer to RELATION token. + * qa: Qualifier attributes already applied. + * return: pointer to node(s); NULL on error. + */ +static struct ccl_rpn_node *qualifiers1 (CCL_parser cclp, struct ccl_token *la, + struct ccl_rpn_attr **qa) +{ + struct ccl_token *lookahead = cclp->look_token; + struct ccl_token *look_start = cclp->look_token; + struct ccl_rpn_attr **ap; + struct ccl_rpn_node *node = 0; + const char *field_str; + int no = 0; + int seq = 0; + int i; + int mode_merge = 1; +#if 0 + if (qa) + { + cclp->error_code = CCL_ERR_DOUBLE_QUAL; + return NULL; + } +#endif + for (lookahead = cclp->look_token; lookahead != la; + lookahead=lookahead->next) + no++; + if (qa) + for (i=0; qa[i]; i++) + no++; + ap = (struct ccl_rpn_attr **)xmalloc ((no ? (no+1) : 2) * sizeof(*ap)); + ccl_assert (ap); + + field_str = ccl_qual_search_special(cclp->bibset, "field"); + if (field_str) + { + if (!strcmp (field_str, "or")) + mode_merge = 0; + else if (!strcmp (field_str, "merge")) + mode_merge = 1; + } + if (!mode_merge) + { + /* consider each field separately and OR */ + lookahead = look_start; + while (lookahead != la) + { + ap[1] = 0; + seq = 0; + while ((ap[0] = ccl_qual_search (cclp, lookahead->name, + lookahead->len, seq)) != 0) + { + struct ccl_rpn_node *node_sub; + cclp->look_token = la; + + node_sub = qualifiers2(cclp, ap); + if (!node_sub) + { + ccl_rpn_delete (node); + xfree (ap); + return 0; + } + if (node) + { + struct ccl_rpn_node *node_this = mk_node(CCL_RPN_OR); + node_this->u.p[0] = node; + node_this->u.p[1] = node_sub; + node = node_this; + } + else + node = node_sub; + seq++; + } + if (seq == 0) + { + cclp->look_token = lookahead; + cclp->error_code = CCL_ERR_UNKNOWN_QUAL; + xfree (ap); + return NULL; + } + lookahead = lookahead->next; + if (lookahead->kind == CCL_TOK_COMMA) + lookahead = lookahead->next; + } + } + else + { + /* merge attributes from ALL fields - including inherited ones */ + while (1) + { + struct ccl_rpn_node *node_sub; + int found = 0; + lookahead = look_start; + for (i = 0; lookahead != la; i++) + { + ap[i] = ccl_qual_search (cclp, lookahead->name, + lookahead->len, seq); + if (ap[i]) + found++; + if (!ap[i] && seq > 0) + ap[i] = ccl_qual_search (cclp, lookahead->name, + lookahead->len, 0); + if (!ap[i]) + { + cclp->look_token = lookahead; + cclp->error_code = CCL_ERR_UNKNOWN_QUAL; + xfree (ap); + return NULL; + } + lookahead = lookahead->next; + if (lookahead->kind == CCL_TOK_COMMA) + lookahead = lookahead->next; + } + if (qa) + { + struct ccl_rpn_attr **qa0 = qa; + + while (*qa0) + ap[i++] = *qa0++; + } + ap[i] = NULL; + + if (!found) + break; + + cclp->look_token = lookahead; + + node_sub = qualifiers2(cclp, ap); + if (!node_sub) + { + ccl_rpn_delete (node); + break; + } + if (node) + { + struct ccl_rpn_node *node_this = mk_node(CCL_RPN_OR); + node_this->u.p[0] = node; + node_this->u.p[1] = node_sub; + node = node_this; + } + else + node = node_sub; + seq++; + } + } + xfree (ap); + return node; +} + + +/* + * search_terms: Parse CCL search terms - including proximity. + * cclp: CCL Parser + * qa: Qualifier attributes already applied. + * return: pointer to node(s); NULL on error. + */ +static struct ccl_rpn_node *search_terms (CCL_parser cclp, + struct ccl_rpn_attr **qa) +{ + static int list[] = { + CCL_TOK_TERM, CCL_TOK_COMMA,CCL_TOK_EQ, CCL_TOK_REL, CCL_TOK_SET, -1}; + struct ccl_rpn_node *p1, *p2, *pn; + p1 = search_term_x (cclp, qa, list, 1); + if (!p1) + return NULL; + while (1) + { + if (KIND == CCL_TOK_PROX) + { + struct ccl_rpn_node *p_prox = 0; + /* ! word order specified */ + /* % word order not specified */ + p_prox = mk_node(CCL_RPN_TERM); + p_prox->u.t.term = (char *) xmalloc(cclp->look_token->len); + memcpy(p_prox->u.t.term, cclp->look_token->name, + cclp->look_token->len); + p_prox->u.t.term[cclp->look_token->len] = 0; + p_prox->u.t.attr_list = 0; + + ADVANCE; + p2 = search_term_x (cclp, qa, list, 1); + if (!p2) + { + ccl_rpn_delete (p1); + return NULL; + } + pn = mk_node (CCL_RPN_PROX); + pn->u.p[0] = p1; + pn->u.p[1] = p2; + pn->u.p[2] = p_prox; + p1 = pn; + } + else if (is_term_ok(KIND, list)) + { + p2 = search_term_x (cclp, qa, list, 1); + if (!p2) + { + ccl_rpn_delete (p1); + return NULL; + } + pn = mk_node (CCL_RPN_PROX); + pn->u.p[0] = p1; + pn->u.p[1] = p2; + pn->u.p[2] = 0; + p1 = pn; + } + else + break; + } + return p1; +} + +/* + * search_elements: Parse CCL search elements + * cclp: CCL Parser + * qa: Qualifier attributes already applied. + * return: pointer to node(s); NULL on error. + */ +static struct ccl_rpn_node *search_elements (CCL_parser cclp, + struct ccl_rpn_attr **qa) +{ + struct ccl_rpn_node *p1; + struct ccl_token *lookahead; + if (KIND == CCL_TOK_LP) + { + ADVANCE; + p1 = find_spec (cclp, qa); + if (!p1) + return NULL; + if (KIND != CCL_TOK_RP) + { + cclp->error_code = CCL_ERR_RP_EXPECTED; + ccl_rpn_delete (p1); + return NULL; + } + ADVANCE; + return p1; + } + else if (KIND == CCL_TOK_SET) + { + ADVANCE; + if (KIND == CCL_TOK_EQ) + ADVANCE; + if (KIND != CCL_TOK_TERM) + { + cclp->error_code = CCL_ERR_SETNAME_EXPECTED; + return NULL; + } + p1 = mk_node (CCL_RPN_SET); + p1->u.setname = copy_token_name (cclp->look_token); + ADVANCE; + return p1; + } + lookahead = cclp->look_token; + + while (lookahead->kind==CCL_TOK_TERM) + { + lookahead = lookahead->next; + if (lookahead->kind == CCL_TOK_REL || lookahead->kind == CCL_TOK_EQ) + return qualifiers1 (cclp, lookahead, qa); + if (lookahead->kind != CCL_TOK_COMMA) + break; + lookahead = lookahead->next; + } + if (qa) + return search_terms (cclp, qa); + else + { + struct ccl_rpn_attr *qa[2]; + struct ccl_rpn_node *node = 0; + int seq; + lookahead = cclp->look_token; + + qa[1] = 0; + for(seq = 0; ;seq++) + { + struct ccl_rpn_node *node_sub; + qa[0] = ccl_qual_search(cclp, "term", 4, seq); + if (!qa[0]) + break; + + cclp->look_token = lookahead; + + node_sub = search_terms (cclp, qa); + if (!node_sub) + { + ccl_rpn_delete (node); + return 0; + } + if (node) + { + struct ccl_rpn_node *node_this = mk_node(CCL_RPN_OR); + node_this->u.p[0] = node; + node_this->u.p[1] = node_sub; + node_this->u.p[2] = 0; + node = node_this; + } + else + node = node_sub; + } + if (!node) + node = search_terms (cclp, 0); + return node; + } +} + +/* + * find_spec: Parse CCL find specification + * cclp: CCL Parser + * qa: Qualifier attributes already applied. + * return: pointer to node(s); NULL on error. + */ +static struct ccl_rpn_node *find_spec (CCL_parser cclp, + struct ccl_rpn_attr **qa) +{ + struct ccl_rpn_node *p1, *p2, *pn; + if (!(p1 = search_elements (cclp, qa))) + return NULL; + while (1) + { + switch (KIND) + { + case CCL_TOK_AND: + ADVANCE; + p2 = search_elements (cclp, qa); + if (!p2) + { + ccl_rpn_delete (p1); + return NULL; + } + pn = mk_node (CCL_RPN_AND); + pn->u.p[0] = p1; + pn->u.p[1] = p2; + pn->u.p[2] = 0; + p1 = pn; + continue; + case CCL_TOK_OR: + ADVANCE; + p2 = search_elements (cclp, qa); + if (!p2) + { + ccl_rpn_delete (p1); + return NULL; + } + pn = mk_node (CCL_RPN_OR); + pn->u.p[0] = p1; + pn->u.p[1] = p2; + pn->u.p[2] = 0; + p1 = pn; + continue; + case CCL_TOK_NOT: + ADVANCE; + p2 = search_elements (cclp, qa); + if (!p2) + { + ccl_rpn_delete (p1); + return NULL; + } + pn = mk_node (CCL_RPN_NOT); + pn->u.p[0] = p1; + pn->u.p[1] = p2; + pn->u.p[2] = 0; + p1 = pn; + continue; + } + break; + } + return p1; +} + +struct ccl_rpn_node *ccl_parser_find (CCL_parser cclp, struct ccl_token *list) +{ + struct ccl_rpn_node *p; + + + + cclp->look_token = list; + p = find_spec (cclp, NULL); + if (p && KIND != CCL_TOK_EOL) + { + if (KIND == CCL_TOK_RP) + cclp->error_code = CCL_ERR_BAD_RP; + else + cclp->error_code = CCL_ERR_OP_EXPECTED; + ccl_rpn_delete (p); + p = NULL; + } + cclp->error_pos = cclp->look_token->name; + if (p) + cclp->error_code = CCL_ERR_OK; + else + cclp->error_code = cclp->error_code; + return p; +} + +/* + * ccl_find: Parse CCL find - token representation + * bibset: Bibset to be used for the parsing + * list: List of tokens + * error: Pointer to integer. Holds error no. on completion. + * pos: Pointer to char position. Holds approximate error position. + * return: RPN tree on successful completion; NULL otherwise. + */ +struct ccl_rpn_node *ccl_find (CCL_bibset bibset, struct ccl_token *list, + int *error, const char **pos) +{ + struct ccl_rpn_node *p; + CCL_parser cclp = ccl_parser_create (); + + cclp->bibset = bibset; + + p = ccl_parser_find (cclp, list); + + *error = cclp->error_code; + *pos = cclp->error_pos; + + ccl_parser_destroy (cclp); + + return p; +} + +/* + * ccl_find_str: Parse CCL find - string representation + * bibset: Bibset to be used for the parsing + * str: String to be parsed + * error: Pointer to integer. Holds error no. on completion. + * pos: Pointer to char position. Holds approximate error position. + * return: RPN tree on successful completion; NULL otherwise. + */ +struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str, + int *error, int *pos) +{ + CCL_parser cclp = ccl_parser_create (); + struct ccl_token *list; + struct ccl_rpn_node *p; + + cclp->bibset = bibset; + + list = ccl_parser_tokenize (cclp, str); + p = ccl_parser_find (cclp, list); + + *error = cclp->error_code; + if (*error) + *pos = cclp->error_pos - str; + ccl_parser_destroy (cclp); + ccl_token_del (list); + return p; +} diff --git a/src/cclptree.c b/src/cclptree.c new file mode 100644 index 0000000..1c36a03 --- /dev/null +++ b/src/cclptree.c @@ -0,0 +1,271 @@ +/* + * Copyright (c) 1995, the EUROPAGATE consortium (see below). + * + * The EUROPAGATE consortium members are: + * + * University College Dublin + * Danmarks Teknologiske Videnscenter + * An Chomhairle Leabharlanna + * Consejo Superior de Investigaciones Cientificas + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation, in whole or in part, for any purpose, is hereby granted, + * provided that: + * + * 1. This copyright and permission notice appear in all copies of the + * software and its documentation. Notices of copyright or attribution + * which appear at the beginning of any file must remain unchanged. + * + * 2. The names of EUROPAGATE or the project partners may not be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * 3. Users of this software (implementors and gateway operators) agree to + * inform the EUROPAGATE consortium of their use of the software. This + * information will be used to evaluate the EUROPAGATE project and the + * software, and to plan further developments. The consortium may use + * the information in later publications. + * + * 4. Users of this software agree to make their best efforts, when + * documenting their use of the software, to acknowledge the EUROPAGATE + * consortium, and the role played by the software in their work. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE + * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF + * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA + * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND + * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* CCL print rpn tree - infix notation + * Europagate, 1995 + * + * $Id: cclptree.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + * + * Old Europagate Log: + * + * Revision 1.6 1995/05/16 09:39:26 adam + * LICENSE. + * + * Revision 1.5 1995/02/23 08:31:59 adam + * Changed header. + * + * Revision 1.3 1995/02/15 17:42:16 adam + * Minor changes of the api of this module. FILE* argument added + * to ccl_pr_tree. + * + * Revision 1.2 1995/02/14 19:55:11 adam + * Header files ccl.h/cclp.h are gone! They have been merged an + * moved to ../include/ccl.h. + * Node kind(s) in ccl_rpn_node have changed names. + * + * Revision 1.1 1995/02/14 10:25:56 adam + * The constructions 'qualifier rel term ...' implemented. + * + */ + +#include +#include +#include + +#include + +void fprintSpaces(int indent,FILE * fd_out) +{ + char buf[100]; + sprintf(buf,"%%%d.s",indent); + fprintf(fd_out,buf," "); +} + +void ccl_pr_tree_as_qrpn(struct ccl_rpn_node *rpn, FILE *fd_out, int indent) +{ + if(indent>0) fprintSpaces(indent,fd_out); + switch (rpn->kind) + { + case CCL_RPN_TERM: + if (rpn->u.t.attr_list) + { + struct ccl_rpn_attr *attr; + for (attr = rpn->u.t.attr_list; attr; attr = attr->next) + { + if (attr->set) + fprintf(fd_out, "@attr %s", attr->set); + else + fprintf(fd_out, "@attr "); + switch(attr->kind) + { + case CCL_RPN_ATTR_NUMERIC: + fprintf (fd_out, "%d=%d ", attr->type, + attr->value.numeric); + break; + case CCL_RPN_ATTR_STRING: + fprintf (fd_out, "%d=%s ", attr->type, + attr->value.str); + } + } + } + fprintf (fd_out, "\"%s\"\n", rpn->u.t.term); + break; + case CCL_RPN_AND: + fprintf (fd_out, "@and \n"); + ccl_pr_tree_as_qrpn (rpn->u.p[0], fd_out,indent+2); + ccl_pr_tree_as_qrpn (rpn->u.p[1], fd_out,indent+2); + break; + case CCL_RPN_OR: + fprintf (fd_out, "@or \n"); + ccl_pr_tree_as_qrpn (rpn->u.p[0], fd_out,indent+2); + ccl_pr_tree_as_qrpn (rpn->u.p[1], fd_out,indent+2); + break; + case CCL_RPN_NOT: + fprintf (fd_out, "@not "); + ccl_pr_tree_as_qrpn (rpn->u.p[0], fd_out,indent+2); + ccl_pr_tree_as_qrpn (rpn->u.p[1], fd_out,indent+2); + break; + case CCL_RPN_SET: + fprintf (fd_out, "set=%s ", rpn->u.setname); + break; + case CCL_RPN_PROX: + if (rpn->u.p[2] && rpn->u.p[2]->kind == CCL_RPN_TERM) + { + const char *cp = rpn->u.p[2]->u.t.term; + /* exlusion distance ordered relation which-code unit-code */ + if (*cp == '!') + { + /* word order specified */ + if (isdigit(cp[1])) + fprintf(fd_out, "@prox 0 %s 1 2 known 2", cp+1); + else + fprintf(fd_out, "@prox 0 1 1 2 known 2"); + } + else if (*cp == '%') + { + /* word order not specified */ + if (isdigit(cp[1])) + fprintf(fd_out, "@prox 0 %s 0 2 known 2", cp+1); + else + fprintf(fd_out, "@prox 0 1 0 2 known 2"); + } + } + ccl_pr_tree_as_qrpn (rpn->u.p[0], fd_out,indent+2); + ccl_pr_tree_as_qrpn (rpn->u.p[1], fd_out,indent+2); + break; + default: + fprintf(stderr,"Internal Error Unknown ccl_rpn node type %d\n",rpn->kind); + } +} + + +void ccl_pr_tree (struct ccl_rpn_node *rpn, FILE *fd_out) +{ + ccl_pr_tree_as_qrpn(rpn,fd_out,0); +} + + +static void ccl_pquery_complex (WRBUF w, struct ccl_rpn_node *p) +{ + switch (p->kind) + { + case CCL_RPN_AND: + wrbuf_puts(w, "@and "); + break; + case CCL_RPN_OR: + wrbuf_puts(w, "@or "); + break; + case CCL_RPN_NOT: + wrbuf_puts(w, "@not "); + break; + case CCL_RPN_PROX: + if (p->u.p[2] && p->u.p[2]->kind == CCL_RPN_TERM) + { + const char *cp = p->u.p[2]->u.t.term; + /* exlusion distance ordered relation which-code unit-code */ + if (*cp == '!') + { + /* word order specified */ + if (isdigit(cp[1])) + wrbuf_printf(w, "@prox 0 %s 1 2 k 2 ", cp+1); + else + wrbuf_printf(w, "@prox 0 1 1 2 k 2 "); + } + else if (*cp == '%') + { + /* word order not specified */ + if (isdigit(cp[1])) + wrbuf_printf(w, "@prox 0 %s 0 2 k 2 ", cp+1); + else + wrbuf_printf(w, "@prox 0 1 0 2 k 2 "); + } + } + else + wrbuf_puts(w, "@prox 0 2 0 1 k 2 "); + break; + default: + wrbuf_puts(w, "@ bad op (unknown) "); + } + ccl_pquery(w, p->u.p[0]); + ccl_pquery(w, p->u.p[1]); +} + +void ccl_pquery (WRBUF w, struct ccl_rpn_node *p) +{ + struct ccl_rpn_attr *att; + const char *cp; + + switch (p->kind) + { + case CCL_RPN_AND: + case CCL_RPN_OR: + case CCL_RPN_NOT: + case CCL_RPN_PROX: + ccl_pquery_complex (w, p); + break; + case CCL_RPN_SET: + wrbuf_puts (w, "@set "); + wrbuf_puts (w, p->u.setname); + wrbuf_puts (w, " "); + break; + case CCL_RPN_TERM: + for (att = p->u.t.attr_list; att; att = att->next) + { + char tmpattr[128]; + wrbuf_puts (w, "@attr "); + if (att->set) + { + wrbuf_puts (w, att->set); + wrbuf_puts (w, " "); + } + switch(att->kind) + { + case CCL_RPN_ATTR_NUMERIC: + sprintf(tmpattr, "%d=%d ", att->type, att->value.numeric); + wrbuf_puts (w, tmpattr); + break; + case CCL_RPN_ATTR_STRING: + sprintf(tmpattr, "%d=", att->type); + wrbuf_puts (w, tmpattr); + wrbuf_puts(w, att->value.str); + wrbuf_puts (w, " "); + break; + } + } + for (cp = p->u.t.term; *cp; cp++) + { + if (*cp == ' ' || *cp == '\\') + wrbuf_putc (w, '\\'); + wrbuf_putc (w, *cp); + } + wrbuf_puts (w, " "); + break; + } +} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + */ diff --git a/src/cclqfile.c b/src/cclqfile.c new file mode 100644 index 0000000..b562bac --- /dev/null +++ b/src/cclqfile.c @@ -0,0 +1,262 @@ +/* + * Copyright (c) 1995, the EUROPAGATE consortium (see below). + * + * The EUROPAGATE consortium members are: + * + * University College Dublin + * Danmarks Teknologiske Videnscenter + * An Chomhairle Leabharlanna + * Consejo Superior de Investigaciones Cientificas + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation, in whole or in part, for any purpose, is hereby granted, + * provided that: + * + * 1. This copyright and permission notice appear in all copies of the + * software and its documentation. Notices of copyright or attribution + * which appear at the beginning of any file must remain unchanged. + * + * 2. The names of EUROPAGATE or the project partners may not be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * 3. Users of this software (implementors and gateway operators) agree to + * inform the EUROPAGATE consortium of their use of the software. This + * information will be used to evaluate the EUROPAGATE project and the + * software, and to plan further developments. The consortium may use + * the information in later publications. + * + * 4. Users of this software agree to make their best efforts, when + * documenting their use of the software, to acknowledge the EUROPAGATE + * consortium, and the role played by the software in their work. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE + * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF + * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA + * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND + * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* CCL qualifiers + * Europagate, 1995 + * + * $Id: cclqfile.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + * + * Old Europagate Log: + * + * Revision 1.3 1995/05/16 09:39:26 adam + * LICENSE. + * + * Revision 1.2 1995/05/11 14:03:56 adam + * Changes in the reading of qualifier(s). New function: ccl_qual_fitem. + * New variable ccl_case_sensitive, which controls whether reserved + * words and field names are case sensitive or not. + * + * Revision 1.1 1995/04/17 09:31:45 adam + * Improved handling of qualifiers. Aliases or reserved words. + * + */ + +#include +#include +#include + +#include + +void ccl_qual_field (CCL_bibset bibset, const char *cp, const char *qual_name) +{ + char qual_spec[128]; + int type_ar[128]; + int value_ar[128]; + char *svalue_ar[128]; + char *attsets[128]; + int pair_no = 0; + + while (pair_no < 128) + { + char *qual_value, *qual_type; + char *split, *setp; + int no_scan = 0; + + if (sscanf (cp, "%100s%n", qual_spec, &no_scan) < 1) + break; + + if (!(split = strchr (qual_spec, '='))) + { + /* alias specification .. */ + if (pair_no == 0) + { + ccl_qual_add_combi (bibset, qual_name, cp); + return; + } + break; + } + /* [set,]type=value ... */ + cp += no_scan; + + *split++ = '\0'; + + setp = strchr (qual_spec, ','); + if (setp) + { + /* set,type=value ... */ + *setp++ = '\0'; + qual_type = setp; + } + else + { + /* type=value ... */ + qual_type = qual_spec; + } + while (pair_no < 128) + { + int type, value; + + qual_value = split; + if ((split = strchr (qual_value, ','))) + *split++ = '\0'; + + value = 0; + switch (qual_type[0]) + { + case 'u': + case 'U': + type = CCL_BIB1_USE; + break; + case 'r': + case 'R': + type = CCL_BIB1_REL; + if (!ccl_stricmp (qual_value, "o")) + value = CCL_BIB1_REL_ORDER; + break; + case 'p': + case 'P': + type = CCL_BIB1_POS; + break; + case 's': + case 'S': + type = CCL_BIB1_STR; + if (!ccl_stricmp (qual_value, "pw")) + value = CCL_BIB1_STR_WP; + if (!ccl_stricmp (qual_value, "al")) + value = CCL_BIB1_STR_AND_LIST; + if (!ccl_stricmp (qual_value, "ol")) + value = CCL_BIB1_STR_OR_LIST; + break; + case 't': + case 'T': + type = CCL_BIB1_TRU; + if (!ccl_stricmp (qual_value, "l")) + value = CCL_BIB1_TRU_CAN_LEFT; + else if (!ccl_stricmp (qual_value, "r")) + value = CCL_BIB1_TRU_CAN_RIGHT; + else if (!ccl_stricmp (qual_value, "b")) + value = CCL_BIB1_TRU_CAN_BOTH; + else if (!ccl_stricmp (qual_value, "n")) + value = CCL_BIB1_TRU_CAN_NONE; + break; + case 'c': + case 'C': + type = CCL_BIB1_COM; + break; + default: + type = atoi (qual_type); + } + + type_ar[pair_no] = type; + + if (value) + { + value_ar[pair_no] = value; + svalue_ar[pair_no] = 0; + } + else if (*qual_value >= '0' && *qual_value <= '9') + { + value_ar[pair_no] = atoi (qual_value); + svalue_ar[pair_no] = 0; + } + else + { + size_t len; + if (split) + len = split - qual_value; + else + len = strlen(qual_value); + svalue_ar[pair_no] = xmalloc(len+1); + memcpy(svalue_ar[pair_no], qual_value, len); + svalue_ar[pair_no][len] = '\0'; + } + if (setp) + { + attsets[pair_no] = (char*) xmalloc (strlen(qual_spec)+1); + strcpy (attsets[pair_no], qual_spec); + } + else + attsets[pair_no] = 0; + pair_no++; + if (!split) + break; + } + } + ccl_qual_add_set (bibset, qual_name, pair_no, type_ar, value_ar, svalue_ar, + attsets); +} + +void ccl_qual_fitem (CCL_bibset bibset, const char *cp, const char *qual_name) +{ + if (*qual_name == '@') + ccl_qual_add_special(bibset, qual_name+1, cp); + else + ccl_qual_field(bibset, cp, qual_name); +} + +/* + * ccl_qual_file: Read bibset definition from file. + * bibset: Bibset + * inf: FILE pointer. + * + * Each line format is: + * = = .... + * Where is name of qualifier; + * = is a attribute definition pair where is one of: + * u(use), r(relation), p(position), t(truncation), c(completeness) + * or plain integer. + * is an integer or special pseudo-value. + */ +void ccl_qual_file (CCL_bibset bibset, FILE *inf) +{ + char line[256]; + char *cp, *cp1; + char qual_name[128]; + + while (fgets (line, 255, inf)) + { + int no_scan = 0; + + cp = line; + if (*cp == '#') + continue; /* ignore lines starting with # */ + if (sscanf (cp, "%100s%n", qual_name, &no_scan) < 1) + continue; /* also ignore empty lines */ + cp += no_scan; + cp1 = strchr(cp, '#'); + if (cp1) + *cp1 = '\0'; + ccl_qual_fitem (bibset, cp, qual_name); + } +} + +int ccl_qual_fname (CCL_bibset bibset, const char *fname) +{ + FILE *inf; + inf = fopen (fname, "r"); + if (!inf) + return -1; + ccl_qual_file (bibset, inf); + fclose (inf); + return 0; +} diff --git a/src/cclqual.c b/src/cclqual.c new file mode 100644 index 0000000..b68f70d --- /dev/null +++ b/src/cclqual.c @@ -0,0 +1,371 @@ +/* + * Copyright (c) 1995, the EUROPAGATE consortium (see below). + * + * The EUROPAGATE consortium members are: + * + * University College Dublin + * Danmarks Teknologiske Videnscenter + * An Chomhairle Leabharlanna + * Consejo Superior de Investigaciones Cientificas + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation, in whole or in part, for any purpose, is hereby granted, + * provided that: + * + * 1. This copyright and permission notice appear in all copies of the + * software and its documentation. Notices of copyright or attribution + * which appear at the beginning of any file must remain unchanged. + * + * 2. The names of EUROPAGATE or the project partners may not be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * 3. Users of this software (implementors and gateway operators) agree to + * inform the EUROPAGATE consortium of their use of the software. This + * information will be used to evaluate the EUROPAGATE project and the + * software, and to plan further developments. The consortium may use + * the information in later publications. + * + * 4. Users of this software agree to make their best efforts, when + * documenting their use of the software, to acknowledge the EUROPAGATE + * consortium, and the role played by the software in their work. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE + * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF + * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA + * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND + * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* CCL qualifiers + * Europagate, 1995 + * + * $Id: cclqual.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + * + * Old Europagate Log: + * + * Revision 1.9 1995/05/16 09:39:27 adam + * LICENSE. + * + * Revision 1.8 1995/05/11 14:03:57 adam + * Changes in the reading of qualifier(s). New function: ccl_qual_fitem. + * New variable ccl_case_sensitive, which controls whether reserved + * words and field names are case sensitive or not. + * + * Revision 1.7 1995/04/17 09:31:46 adam + * Improved handling of qualifiers. Aliases or reserved words. + * + * Revision 1.6 1995/02/23 08:32:00 adam + * Changed header. + * + * Revision 1.4 1995/02/14 19:55:12 adam + * Header files ccl.h/cclp.h are gone! They have been merged an + * moved to ../include/ccl.h. + * Node kind(s) in ccl_rpn_node have changed names. + * + * Revision 1.3 1995/02/14 16:20:56 adam + * Qualifiers are read from a file now. + * + * Revision 1.2 1995/02/14 10:25:56 adam + * The constructions 'qualifier rel term ...' implemented. + * + * Revision 1.1 1995/02/13 15:15:07 adam + * Added handling of qualifiers. Not finished yet. + * + */ + +#include +#include +#include + +#include + +/* Definition of CCL_bibset pointer */ +struct ccl_qualifiers { + struct ccl_qualifier *list; + struct ccl_qualifier_special *special; +}; + + +/* CCL Qualifier special */ +struct ccl_qualifier_special { + char *name; + char *value; + struct ccl_qualifier_special *next; +}; + + +static struct ccl_qualifier *ccl_qual_lookup (CCL_bibset b, + const char *n, size_t len) +{ + struct ccl_qualifier *q; + for (q = b->list; q; q = q->next) + if (len == strlen(q->name) && !memcmp (q->name, n, len)) + break; + return q; +} + + +void ccl_qual_add_special (CCL_bibset bibset, const char *n, const char *v) +{ + struct ccl_qualifier_special *p; + const char *pe; + + for (p = bibset->special; p && strcmp(p->name, n); p = p->next) + ; + if (p) + xfree (p->value); + else + { + p = (struct ccl_qualifier_special *) xmalloc (sizeof(*p)); + p->name = ccl_strdup (n); + p->value = 0; + p->next = bibset->special; + bibset->special = p; + } + while (strchr(" \t", *v)) + ++v; + for (pe = v + strlen(v); pe != v; --pe) + if (!strchr(" \n\r\t", pe[-1])) + break; + p->value = (char*) xmalloc (pe - v + 1); + if (pe - v) + memcpy (p->value, v, pe - v); + p->value[pe - v] = '\0'; +} + +static int next_token(const char **cpp, const char **dst) +{ + int len = 0; + const char *cp = *cpp; + while (*cp && strchr(" \r\n\t\f", *cp)) + cp++; + if (dst) + *dst = cp; + len = 0; + while (*cp && !strchr(" \r\n\t\f", *cp)) + { + cp++; + len++; + } + *cpp = cp; + return len; +} + +void ccl_qual_add_combi (CCL_bibset b, const char *n, const char *names) +{ + const char *cp, *cp1; + int i, len; + struct ccl_qualifier *q; + for (q = b->list; q && strcmp(q->name, n); q = q->next) + ; + if (q) + return ; + q = (struct ccl_qualifier *) xmalloc (sizeof(*q)); + q->name = ccl_strdup (n); + q->attr_list = 0; + q->next = b->list; + b->list = q; + + cp = names; + for (i = 0; next_token(&cp, 0); i++) + ; + q->no_sub = i; + q->sub = (struct ccl_qualifier **) xmalloc (sizeof(*q->sub) * + (1+q->no_sub)); + cp = names; + for (i = 0; (len = next_token(&cp, &cp1)); i++) + { + q->sub[i] = ccl_qual_lookup (b, cp1, len); + } +} + +/* + * ccl_qual_add: Add qualifier to Bibset. If qualifier already + * exists, then attributes are appendend to old + * definition. + * name: name of qualifier + * no: No of attribute type/value pairs. + * pairs: Attributes. pairs[0] first type, pair[1] first value, + * ... pair[2*no-2] last type, pair[2*no-1] last value. + */ + +void ccl_qual_add_set (CCL_bibset b, const char *name, int no, + int *type_ar, int *value_ar, char **svalue_ar, + char **attsets) +{ + struct ccl_qualifier *q; + struct ccl_rpn_attr **attrp; + + ccl_assert (b); + for (q = b->list; q; q = q->next) + if (!strcmp (name, q->name)) + break; + if (!q) + { + struct ccl_qualifier *new_qual = + (struct ccl_qualifier *)xmalloc (sizeof(*new_qual)); + ccl_assert (new_qual); + + new_qual->next = b->list; + b->list = new_qual; + + new_qual->name = ccl_strdup (name); + attrp = &new_qual->attr_list; + + new_qual->no_sub = 0; + new_qual->sub = 0; + } + else + { + if (q->sub) /* suspect.. */ + xfree (q->sub); + attrp = &q->attr_list; + while (*attrp) + attrp = &(*attrp)->next; + } + while (--no >= 0) + { + struct ccl_rpn_attr *attr; + + attr = (struct ccl_rpn_attr *)xmalloc (sizeof(*attr)); + ccl_assert (attr); + attr->set = *attsets++; + attr->type = *type_ar++; + if (*svalue_ar) + { + attr->kind = CCL_RPN_ATTR_STRING; + attr->value.str = *svalue_ar; + } + else + { + attr->kind = CCL_RPN_ATTR_NUMERIC; + attr->value.numeric = *value_ar; + } + svalue_ar++; + value_ar++; + *attrp = attr; + attrp = &attr->next; + } + *attrp = NULL; +} + +/* + * ccl_qual_mk: Make new (empty) bibset. + * return: empty bibset. + */ +CCL_bibset ccl_qual_mk (void) +{ + CCL_bibset b = (CCL_bibset)xmalloc (sizeof(*b)); + ccl_assert (b); + b->list = NULL; + b->special = NULL; + return b; +} + +/* + * ccl_qual_rm: Delete bibset. + * b: pointer to bibset + */ +void ccl_qual_rm (CCL_bibset *b) +{ + struct ccl_qualifier *q, *q1; + struct ccl_qualifier_special *sp, *sp1; + + if (!*b) + return; + for (q = (*b)->list; q; q = q1) + { + struct ccl_rpn_attr *attr, *attr1; + + for (attr = q->attr_list; attr; attr = attr1) + { + attr1 = attr->next; + if (attr->set) + xfree(attr->set); + if (attr->kind == CCL_RPN_ATTR_STRING) + xfree(attr->value.str); + xfree (attr); + } + q1 = q->next; + xfree (q->name); + if (q->sub) + xfree (q->sub); + xfree (q); + } + for (sp = (*b)->special; sp; sp = sp1) + { + sp1 = sp->next; + xfree (sp->name); + xfree (sp->value); + xfree (sp); + } + xfree (*b); + *b = NULL; +} + +/* + * ccl_qual_search: Search for qualifier in bibset. + * b: Bibset + * name: Name of qualifier to search for (need no null-termination) + * len: Length of name. + * return: Attribute info. NULL if not found. + */ +struct ccl_rpn_attr *ccl_qual_search (CCL_parser cclp, + const char *name, size_t len, + int seq) +{ + struct ccl_qualifier *q; + const char *aliases; + int case_sensitive = cclp->ccl_case_sensitive; + + ccl_assert (cclp); + if (!cclp->bibset) + return NULL; + + aliases = ccl_qual_search_special(cclp->bibset, "case"); + if (aliases) + case_sensitive = atoi(aliases); + + for (q = cclp->bibset->list; q; q = q->next) + if (strlen(q->name) == len) + { + if (case_sensitive) + { + if (!memcmp (name, q->name, len)) + break; + } + else + { + if (!ccl_memicmp (name, q->name, len)) + break; + } + } + if (q) + { + if (q->attr_list && seq == 0) + return q->attr_list; + if (seq < q->no_sub && q->sub[seq]) + { + return q->sub[seq]->attr_list; + } + } + return 0; +} + +const char *ccl_qual_search_special (CCL_bibset b, + const char *name) +{ + struct ccl_qualifier_special *q; + if (!b) + return 0; + for (q = b->special; q && strcmp(q->name, name); q = q->next) + ; + if (q) + return q->value; + return 0; +} diff --git a/src/cclstr.c b/src/cclstr.c new file mode 100644 index 0000000..d7d76f9 --- /dev/null +++ b/src/cclstr.c @@ -0,0 +1,110 @@ +/* + * Copyright (c) 1995, the EUROPAGATE consortium (see below). + * + * The EUROPAGATE consortium members are: + * + * University College Dublin + * Danmarks Teknologiske Videnscenter + * An Chomhairle Leabharlanna + * Consejo Superior de Investigaciones Cientificas + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation, in whole or in part, for any purpose, is hereby granted, + * provided that: + * + * 1. This copyright and permission notice appear in all copies of the + * software and its documentation. Notices of copyright or attribution + * which appear at the beginning of any file must remain unchanged. + * + * 2. The names of EUROPAGATE or the project partners may not be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * 3. Users of this software (implementors and gateway operators) agree to + * inform the EUROPAGATE consortium of their use of the software. This + * information will be used to evaluate the EUROPAGATE project and the + * software, and to plan further developments. The consortium may use + * the information in later publications. + * + * 4. Users of this software agree to make their best efforts, when + * documenting their use of the software, to acknowledge the EUROPAGATE + * consortium, and the role played by the software in their work. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE + * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF + * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA + * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND + * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* CCL string compare utilities + * Europagate, 1995 + * + * $Id: cclstr.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + * + * Old Europagate Log: + * + * Revision 1.3 1996/01/24 10:11:19 adam + * Added include of stdlib.h. + * + * Revision 1.2 1995/05/16 09:39:27 adam + * LICENSE. + * + * Revision 1.1 1995/05/11 14:03:57 adam + * Changes in the reading of qualifier(s). New function: ccl_qual_fitem. + * New variable ccl_case_sensitive, which controls whether reserved + * words and field names are case sensitive or not. + * + */ +#include +#include +#include + +#include + +static int ccli_toupper (int c) +{ + return toupper (c); +} + +int (*ccl_toupper)(int c) = NULL; + +int ccl_stricmp (const char *s1, const char *s2) +{ + if (!ccl_toupper) + ccl_toupper = ccli_toupper; + while (*s1 && *s2) + { + int c1, c2; + c1 = (*ccl_toupper)(*s1); + c2 = (*ccl_toupper)(*s2); + if (c1 != c2) + return c1 - c2; + s1++; + s2++; + } + return (*ccl_toupper)(*s1) - (*ccl_toupper)(*s2); +} + +int ccl_memicmp (const char *s1, const char *s2, size_t n) +{ + if (!ccl_toupper) + ccl_toupper = ccli_toupper; + while (1) + { + int c1, c2; + + c1 = (*ccl_toupper)(*s1); + c2 = (*ccl_toupper)(*s2); + if (n <= 1 || c1 != c2) + return c1 - c2; + s1++; + s2++; + --n; + } +} + diff --git a/src/ccltoken.c b/src/ccltoken.c new file mode 100644 index 0000000..70bc47d --- /dev/null +++ b/src/ccltoken.c @@ -0,0 +1,426 @@ +/* + * Copyright (c) 1995, the EUROPAGATE consortium (see below). + * + * The EUROPAGATE consortium members are: + * + * University College Dublin + * Danmarks Teknologiske Videnscenter + * An Chomhairle Leabharlanna + * Consejo Superior de Investigaciones Cientificas + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation, in whole or in part, for any purpose, is hereby granted, + * provided that: + * + * 1. This copyright and permission notice appear in all copies of the + * software and its documentation. Notices of copyright or attribution + * which appear at the beginning of any file must remain unchanged. + * + * 2. The names of EUROPAGATE or the project partners may not be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * 3. Users of this software (implementors and gateway operators) agree to + * inform the EUROPAGATE consortium of their use of the software. This + * information will be used to evaluate the EUROPAGATE project and the + * software, and to plan further developments. The consortium may use + * the information in later publications. + * + * 4. Users of this software agree to make their best efforts, when + * documenting their use of the software, to acknowledge the EUROPAGATE + * consortium, and the role played by the software in their work. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE + * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF + * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA + * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND + * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* CCL - lexical analysis + * Europagate, 1995 + * + * $Id: ccltoken.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + * + * Old Europagate Log: + * + * Revision 1.10 1995/07/11 12:28:31 adam + * New function: ccl_token_simple (split into simple tokens) and + * ccl_token_del (delete tokens). + * + * Revision 1.9 1995/05/16 09:39:28 adam + * LICENSE. + * + * Revision 1.8 1995/05/11 14:03:57 adam + * Changes in the reading of qualifier(s). New function: ccl_qual_fitem. + * New variable ccl_case_sensitive, which controls whether reserved + * words and field names are case sensitive or not. + * + * Revision 1.7 1995/04/19 12:11:24 adam + * Minor change. + * + * Revision 1.6 1995/04/17 09:31:48 adam + * Improved handling of qualifiers. Aliases or reserved words. + * + * Revision 1.5 1995/02/23 08:32:00 adam + * Changed header. + * + * Revision 1.3 1995/02/15 17:42:16 adam + * Minor changes of the api of this module. FILE* argument added + * to ccl_pr_tree. + * + * Revision 1.2 1995/02/14 19:55:13 adam + * Header files ccl.h/cclp.h are gone! They have been merged an + * moved to ../include/ccl.h. + * Node kind(s) in ccl_rpn_node have changed names. + * + * Revision 1.1 1995/02/13 12:35:21 adam + * First version of CCL. Qualifiers aren't handled yet. + * + */ + +#include +#include +#include + +#include + +/* + * token_cmp: Compare token with keyword(s) + * kw: Keyword list. Each keyword is separated by space. + * token: CCL token. + * return: 1 if token string matches one of the keywords in list; + * 0 otherwise. + */ +static int token_cmp (CCL_parser cclp, const char *kw, struct ccl_token *token) +{ + const char *cp1 = kw; + const char *cp2; + const char *aliases; + int case_sensitive = cclp->ccl_case_sensitive; + + aliases = ccl_qual_search_special(cclp->bibset, "case"); + if (aliases) + case_sensitive = atoi(aliases); + if (!kw) + return 0; + while ((cp2 = strchr (cp1, ' '))) + { + if (token->len == (size_t) (cp2-cp1)) + { + if (case_sensitive) + { + if (!memcmp (cp1, token->name, token->len)) + return 1; + } + else + { + if (!ccl_memicmp (cp1, token->name, token->len)) + return 1; + } + } + cp1 = cp2+1; + } + if (case_sensitive) + return token->len == strlen(cp1) + && !memcmp (cp1, token->name, token->len); + return token->len == strlen(cp1) && + !ccl_memicmp (cp1, token->name, token->len); +} + +/* + * ccl_token_simple: tokenize CCL raw tokens + */ +struct ccl_token *ccl_token_simple (const char *command) +{ + const char *cp = command; + struct ccl_token *first = NULL; + struct ccl_token *last = NULL; + + while (1) + { + while (*cp && strchr (" \t\r\n", *cp)) + { + cp++; + continue; + } + if (!first) + { + first = last = (struct ccl_token *)xmalloc (sizeof (*first)); + ccl_assert (first); + last->prev = NULL; + } + else + { + last->next = (struct ccl_token *)xmalloc (sizeof(*first)); + ccl_assert (last->next); + last->next->prev = last; + last = last->next; + } + last->next = NULL; + last->name = cp; + last->len = 1; + switch (*cp++) + { + case '\0': + last->kind = CCL_TOK_EOL; + return first; + case '\"': + last->kind = CCL_TOK_TERM; + last->name = cp; + last->len = 0; + while (*cp && *cp != '\"') + { + cp++; + ++ last->len; + } + if (*cp == '\"') + cp++; + break; + default: + while (*cp && !strchr (" \t\n\r", *cp)) + { + cp++; + ++ last->len; + } + last->kind = CCL_TOK_TERM; + } + } + return first; +} + + +/* + * ccl_tokenize: tokenize CCL command string. + * return: CCL token list. + */ +struct ccl_token *ccl_parser_tokenize (CCL_parser cclp, const char *command) +{ + const char *aliases; + const char *cp = command; + struct ccl_token *first = NULL; + struct ccl_token *last = NULL; + + while (1) + { + while (*cp && strchr (" \t\r\n", *cp)) + { + cp++; + continue; + } + if (!first) + { + first = last = (struct ccl_token *)xmalloc (sizeof (*first)); + ccl_assert (first); + last->prev = NULL; + } + else + { + last->next = (struct ccl_token *)xmalloc (sizeof(*first)); + ccl_assert (last->next); + last->next->prev = last; + last = last->next; + } + last->next = NULL; + last->name = cp; + last->len = 1; + switch (*cp++) + { + case '\0': + last->kind = CCL_TOK_EOL; + return first; + case '(': + last->kind = CCL_TOK_LP; + break; + case ')': + last->kind = CCL_TOK_RP; + break; + case ',': + last->kind = CCL_TOK_COMMA; + break; + case '%': + case '!': + last->kind = CCL_TOK_PROX; + while (isdigit(*cp)) + { + ++ last->len; + cp++; + } + break; + case '>': + case '<': + case '=': + if (*cp == '=' || *cp == '<' || *cp == '>') + { + cp++; + last->kind = CCL_TOK_REL; + ++ last->len; + } + else if (cp[-1] == '=') + last->kind = CCL_TOK_EQ; + else + last->kind = CCL_TOK_REL; + break; + case '\"': + last->kind = CCL_TOK_TERM; + last->name = cp; + last->len = 0; + while (*cp && *cp != '\"') + { + cp++; + ++ last->len; + } + if (*cp == '\"') + cp++; + break; + default: + if (!strchr ("(),%!><= \t\n\r", cp[-1])) + { + while (*cp && !strchr ("(),%!><= \t\n\r", *cp)) + { + cp++; + ++ last->len; + } + } + last->kind = CCL_TOK_TERM; + + aliases = ccl_qual_search_special(cclp->bibset, "and"); + if (!aliases) + aliases = cclp->ccl_token_and; + if (token_cmp (cclp, aliases, last)) + last->kind = CCL_TOK_AND; + + aliases = ccl_qual_search_special(cclp->bibset, "or"); + if (!aliases) + aliases = cclp->ccl_token_or; + if (token_cmp (cclp, aliases, last)) + last->kind = CCL_TOK_OR; + + aliases = ccl_qual_search_special(cclp->bibset, "not"); + if (!aliases) + aliases = cclp->ccl_token_not; + if (token_cmp (cclp, aliases, last)) + last->kind = CCL_TOK_NOT; + + aliases = ccl_qual_search_special(cclp->bibset, "set"); + if (!aliases) + aliases = cclp->ccl_token_set; + + if (token_cmp (cclp, aliases, last)) + last->kind = CCL_TOK_SET; + } + } + return first; +} + +struct ccl_token *ccl_tokenize (const char *command) +{ + CCL_parser cclp = ccl_parser_create (); + struct ccl_token *list; + + list = ccl_parser_tokenize (cclp, command); + + ccl_parser_destroy (cclp); + return list; +} + +/* + * ccl_token_del: delete CCL tokens + */ +void ccl_token_del (struct ccl_token *list) +{ + struct ccl_token *list1; + + while (list) + { + list1 = list->next; + xfree (list); + list = list1; + } +} + +char *ccl_strdup (const char *str) +{ + int len = strlen(str); + char *p = (char*) xmalloc (len+1); + strcpy (p, str); + return p; +} + +CCL_parser ccl_parser_create (void) +{ + CCL_parser p = (CCL_parser)xmalloc (sizeof(*p)); + if (!p) + return p; + p->look_token = NULL; + p->error_code = 0; + p->error_pos = NULL; + p->bibset = NULL; + + p->ccl_token_and = ccl_strdup("and"); + p->ccl_token_or = ccl_strdup("or"); + p->ccl_token_not = ccl_strdup("not andnot"); + p->ccl_token_set = ccl_strdup("set"); + p->ccl_case_sensitive = 1; + + return p; +} + +void ccl_parser_destroy (CCL_parser p) +{ + if (!p) + return; + xfree (p->ccl_token_and); + xfree (p->ccl_token_or); + xfree (p->ccl_token_not); + xfree (p->ccl_token_set); + xfree (p); +} + +void ccl_parser_set_op_and (CCL_parser p, const char *op) +{ + if (p && op) + { + if (p->ccl_token_and) + xfree (p->ccl_token_and); + p->ccl_token_and = ccl_strdup (op); + } +} + +void ccl_parser_set_op_or (CCL_parser p, const char *op) +{ + if (p && op) + { + if (p->ccl_token_or) + xfree (p->ccl_token_or); + p->ccl_token_or = ccl_strdup (op); + } +} +void ccl_parser_set_op_not (CCL_parser p, const char *op) +{ + if (p && op) + { + if (p->ccl_token_not) + xfree (p->ccl_token_not); + p->ccl_token_not = ccl_strdup (op); + } +} +void ccl_parser_set_op_set (CCL_parser p, const char *op) +{ + if (p && op) + { + if (p->ccl_token_set) + xfree (p->ccl_token_set); + p->ccl_token_set = ccl_strdup (op); + } +} + +void ccl_parser_set_case (CCL_parser p, int case_sensitivity_flag) +{ + if (p) + p->ccl_case_sensitive = case_sensitivity_flag; +} diff --git a/src/charconv.sgm b/src/charconv.sgm new file mode 100644 index 0000000..352643c --- /dev/null +++ b/src/charconv.sgm @@ -0,0 +1,586 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Aacutelatin capital letter a with acute00C1 +aacutelatin small letter a with acute00E1 +Abreveaclatin capital letter a with breve and acute1EAE +abreveaclatin small letter a with breve and acute1EAF +Abrevedblatin capital letter a with breve and dot below1EB6 +abrevedblatin small letter a with breve and dot below1EB7 +Abrevegrlatin capital letter a with breve and grave1EB0 +abrevegrlatin small letter a with breve and grave1EB1 +Abrevehalatin capital letter a with breve and hook above1EB2 +abrevehalatin small letter a with breve and hook above1EB3 +Abrevetilatin capital letter a with breve and tilde1EB4 +abrevetilatin small letter a with breve and tilde1EB5 +Abrevelatin capital letter a with breve0102 +abrevelatin small letter a with breve0103 +Acaronlatin capital letter a with caron01CD +acaronlatin small letter a with caron01CE +Acircaclatin capital letter a with circumflex and acute1EA4 +acircaclatin small letter a with circumflex and acute1EA5 +Acircdblatin capital letter a with circumflex and dot below1EAC +acircdblatin small letter a with circumflex and dot below1EAD +acircgrlatin capital letter a with circumflex and grave1EA6 +acircgrlatin small letter a with circumflex and grave1EA7 +Acirchalatin capital letter a with circumflex and hook above1EA8 +acirchalatin small letter a with circumflex and hook above1EA9 +Acirctilatin capital letter a with circumflex and tilde1EAA +acirctilatin small letter a with circumflex and tilde1EAB +Acirclatin capital letter a with circumflex00C2 +acirclatin small letter a with circumflex00E2 +acutecombining acute accent0301 +Adotamalatin capital letter a with dot above and macron01E0 +adotamalatin small letter a with dot above and macron01E1 +Adotblatin capital letter a with dot below1EA0 +adotblatin small letter a with dot below1EA1 +Adotlatin capital letter a with dot above0226 +adotlatin small letter a with dot above0227 +Aeacutelatin capital letter ae with acute01FC +aeacutelatin small letter ae with acute01FD +AEliglatin capital letter ae00C6 +aeliglatin small letter ae00E6 +Aemacrlatin capital letter ae with macron01E2 +aemacrlatin small letter ae with macron01E3 +Agravelatin capital letter a with grave00C0 +agravelatin small letter a with grave00E0 +Ahookalatin capital letter a with hook above1EA2 +ahookalatin small letter a with hook above1EA3 +alphagreek small letter alpha03B1 +Amacrlatin capital letter a with macron0100 +amacrlatin small letter a with macron0101 +Aogonlatin capital letter a with ogonek0104 +aogonlatin small letter a with ogonek0105 +Aringaclatin capital letter a with ring above and acute01FA +aringaclatin small letter a with ring above and acute01FB +Aringlatin capital letter a with ring00C5 +aringlatin small letter a with ring00E5 +Atildelatin capital letter a with tilde00C3 +atildelatin small letter a with tilde00E3 +Aumlmalatin capital letter a with diaeresis and macron01DE +aumlmalatin small letter a with diaeresis and macron01DF +Aumllatin capital letter a with umlaut00C4 +aumllatin small letter a with umlaut00E4 +Bdotalatin capital letter b with dot above1E02 +bdotalatin small letter b with dot above1E03 +Bdotblatin capital letter b with dot below1E04 +bdotblatin small letter b with dot below1E05 +betagreek small letter beta03B2 +Bmacrblatin capital letter b with line below1E06 +bmacrblatin small letter b with line below1E07 +brevebcombining breve below032E +brevecombining breve0306 +Cacutelatin capital letter c with acute0106 +cacutelatin small letter c with acute0107 +candracombining candrabindu0310 +caroncombining caron030C +Ccaronlatin capital letter c with caron010C +ccaronlatin small letter c with caron010D +Ccedilaclatin capital letter c with cedilla and acute1E08 +ccedilaclatin small letter c with cedilla and acute1E09 +Ccedillatin capital letter c with cedilla00C7 +ccedillatin small letter c with cedilla00E7 +Ccirclatin capital letter c with circumflex0108 +ccirclatin small letter c with circumflex0109 +Cdotlatin capital letter c with dot above010A +cdotlatin small letter c with dot above010B +cedilcombining cedilla0327 +circcombining circumflex0302 +commaacombining comma above0313 +commabcombining comma below0326 +copysrsound recording copyright2117 +copycopyright sign00A9 +dblaccombining double acute accent030B +dbldotbcombining double dot below0324 +dblundercombining double low line0333 +Dcaronlatin capital letter d with caron010E +dcaronlatin small letter d with caron010F +Dcommablatin capital letter d with comma below1E10 +dcommablatin small letter d with comma below1E11 +Ddotalatin capital letter d with dot above1E0A +ddotalatin small letter d with dot above1E0B +Ddotblatin capital letter d with dot below1E0C +ddotblatin small letter d with dot below1E0D +degdegree sign00B0 +Dmacrblatin capital letter d with line below1E0E +dmacrblatin small letter d with line below1E0F +dotbcombining dot below0323 +dotcombining dot above0307 +Dstroklatin capital letter d with stroke0110 +dstroklatin small letter d with stroke0111 +Eacutelatin capital letter e with acute00C9 +eacutelatin small letter e with acute00E9 +Ebrevelatin capital letter e with breve0114 +ebrevelatin small letter e with breve0115 +Ecaronlatin capital letter e with caron011A +ecaronlatin small letter e with caron011B +Ecedilbrlatin capital letter e with cedilla and breve1E1C +ecedilbrlatin small letter e with cedilla and breve1E1D +Ecedillatin capital letter e with cedilla0228 +ecedillatin small letter e with cedilla0229 +Ecircaclatin capital letter e with circumflex and acute1EBE +ecircaclatin small letter e with circumflex and acute1EBF +Ecircdblatin capital letter e with circumflex and dot below1EC6 +ecircdblatin small letter e with circumflex and dot below1EC7 +Ecircgrlatin capital letter e with circumflex and grave1EC0 +ecircgrlatin small letter e with circumflex and grave1EC1 +Ecirchalatin capital letter e with circumflex and hook above1EC2 +ecirchalatin small letter e with circumflex and hook above1EC3 +Ecirctilatin capital letter e with circumflex and tilde1EC4 +Ecirclatin capital letter e with circumflex00CA +ecirclatin small letter e with circumflex00EA +Edotblatin capital letter e with dot below1EB8 +edotblatin small letter e with dot below1EB9 +Edotlatin capital letter e with dot above0116 +edotlatin small letter e with dot above0117 +Egravelatin capital letter e with grave00C8 +egravelatin small letter e with grave00E8 +Ehookalatin capital letter e with hook above1EBA +ehookalatin small letter e with hook above1EBB +Emacraclatin capital letter e with macron and acute1E16 +emacraclatin small letter e with macron and acute1E17 +Emacrgrlatin capital letter e with macron and grave1E14 +emacrgrlatin small letter e with macron and grave1E15 +Emacrlatin capital letter e with macron0112 +emacrlatin small letter e with macron0113 +Eogonlatin capital letter e with ogon0118 +eogonlatin small letter e with ogon0119 +ethlatin small letter eth00F0 +Etildelatin capital letter e with tilde1EBC +etildelatin small letter e with tilde1EBD +Eumllatin capital letter e with umlaut00CB +eumllatin small letter e with umlaut00EB +Fdotlatin capital letter f with dot above1E1E +fdotlatin small letter f with dot above1E1F +flatmusical flat sign266D +Gacutelatin capital letter g with acute01F4 +gacutelatin small letter g with acute01F5 +gammagreek small letter gamma03B3 +Gbrevelatin capital letter g with breve011E +gbrevelatin small letter g with breve011F +Gcaronlatin capital letter g with caron01E6 +gcaronlatin small letter g with caron01E7 +Gcedillatin capital letter g with cedilla0122 +gcedillatin small letter g with cedilla0123 +Gcirclatin capital letter g with circumflex011C +gcirclatin small letter g with circumflex011D +Gdotlatin capital letter g with dot above0120 +gdotlatin small letter g with dot above0121 +Gmacrlatin capital letter g with macron1E20 +gmacrlatin small letter g with macron1E21 +gravecombining grave accent0300 +Gstroklatin capital letter g with stroke01E4 +gstroklatin small letter g with stroke01E5 +hardsignmodifier letter double prime02BA +Hbreveblatin capital letter h with breve below1E2A +hbreveblatin small letter h with breve below1E2B +Hcaronlatin capital letter h with caron021E +hcaronlatin small letter h with caron021F +Hcedillatin capital letter h with cedilla1E28 +hcedillatin small letter h with cedilla1E29 +Hcirclatin capital letter h with circumflex0124 +hcirclatin small letter h with circumflex0125 +Hdotblatin capital letter h with dot below1E24 +hdotblatin small letter h with dot below1E25 +Hdotlatin capital letter h with dot above1E22 +hdotlatin small letter h with dot above1E23 +hlowlinelatin small letter h with low line1E96 +hookacombining hook above0309 +Hstrokelatin capital letter h with stroke0126 +hstrokelatin small letter h with stroke0127 +Humllatin capital letter h with diaeresis1E26 +humllatin small letter h with diaeresis1E27 +Iacutelatin capital letter i with acute00CD +iacutelatin small letter i with acute00ED +Ibrevelatin capital letter i with breve012C +ibrevelatin small letter i with breve012D +Icaronlatin capital letter i with caron01CF +icaronlatin small letter i with caron01D0 +Icirclatin capital letter i with circumflex00CE +icirclatin small letter i with circumflex00EE +Idotblatin capital letter i with dot below1ECA +idotblatin small letter i with dot below1ECB +Idotlatin capital letter i with dot above0130 +iexclinverted exclamation mark00A1 +Igravelatin capital letter i with grave00CC +igravelatin small letter i with grave00EC +Ihookalatin capital letter i with hook above1EC8 +ihookalatin small letter i with hook above1EC9 +Imacrlatin capital letter i with macron012A +imacrlatin small letter i with macron012B +inodotlatin small letter dotless i0131 +Iogonlatin capital letter i with ogon012E +iogonlatin small letter i with ogon012F +iquestinverted question mark00BF +Itildelatin capital letter i with tilde0128 +itildelatin small letter i with tilde0129 +Iumlaclatin capital letter i with diaeresis and acute1E2E +iumlaclatin small letter i with diaeresis and acute1E2F +Iumllatin capital letter i with umlaut00CF +iumllatin small letter i with umlaut00EF +jcaronlatin small letter j with caron01F0 +Jcirclatin capital letter j with circumflex0134 +jcirclatin small letter j with circumflex0135 +Kacutelatin capital letter k with acute1E30 +kacutelatin small letter k with acute1E31 +Kcedillatin capital letter k with cedilla0136 +kcedillatin small letter k with cedilla0137 +Kcirclatin capital letter k with circumflex01E8 +kcirclatin small letter k with circumflex01E9 +Kdotblatin capital letter k with dot below1E32 +kdotblatin small letter k with dot below1E33 +Kmacrblatin capital letter k with line below1E34 +kmacrblatin small letter k with line below1E35 +Lacutelatin capital letter l with acute0139 +lacutelatin small letter l with acute013A +Lcaronlatin capital letter l with caron013D +lcaronlatin small letter l with caron013E +Lcedillatin capital letter l with cedilla013B +lcedillatin small letter l with cedilla013C +Lcirclatin capital letter l with circumflex1E3C +lcirclatin small letter l with circumflex1E3D +ldbltilcombining double tilde left halfFE22 +Ldotbmalatin capital letter l with dot below and macron1E38 +ldotbmalatin small letter l with dot below and macron1E39 +Ldotblatin capital letter l with dot below1E36 +ldotblatin small letter l with dot below1E37 +lligcombining ligature left halfFE20 +Lmacrblatin capital letter l with line below1E3A +lmacrblatin small letter l with line below1E3B +Lmidotlatin capital letter l with middle dot013F +lmidotlatin small letter l with middle dot0140 +Lstroklatin capital letter l with stroke0141 +lstroklatin small letter l with stroke0142 +macrcombining macron0304 +Macutelatin capital letter m with acute1E3E +macutelatin small letter m with acute1E3F +Mdotblatin capital letter m with dot below1E42 +mdotblatin small letter m with dot below1E43 +Mdotlatin capital letter m with dot above1E40 +mdotlatin small letter m with dot above1E41 +middotmiddle dot00B7 +mllhringmodifier letter left half ring02BF +mlrhringmodifier letter right half ring02BE +Nacutelatin capital letter n with acute0143 +nacutelatin small letter n with acute0144 +naposlatin small letter n with apostrophe0149 +Ncaronlatin capital letter n with caron0147 +ncaronlatin small letter n with caron0148 +Ncedillatin capital letter n with cedilla0145 +ncedillatin small letter n with cedilla0146 +Ndotblatin capital letter n with dot below1E46 +ndotblatin small letter n with dot below1E47 +Ndotlatin capital letter n with dot above1E44 +ndotlatin small letter n with dot above1E45 +Ngravelatin capital letter n with grave01F8 +ngravelatin small letter n with grave01F9 +Nmacrblatin capital letter n with line below1E48 +nmacrblatin small letter n with line below1E49 +Ntildelatin capital letter n with tilde00D1 +ntildelatin small letter n with tilde00F1 +Oacutelatin capital letter o with acute00D3 +oacutelatin small letter o with acute00F3 +Obrevelatin capital letter o with breve014E +obrevelatin small letter o with breve014F +Ocaronlatin capital letter o with caron01D1 +ocaronlatin small letter o with caron01D2 +Ocircaclatin capital letter o with circumflex and acute1ED0 +ocircaclatin small letter o with circumflex and acute1ED1 +Ocircdblatin capital letter o with circumflex and dot below1ED8 +ocircdblatin small letter o with circumflex and dot below1ED9 +Ocircgrlatin capital letter o with circumflex and grave1ED2 +ocircgrlatin small letter o with circumflex and grave1ED3 +Ocirchalatin capital letter o with circumflex and hook above1ED4 +ocirchalatin small letter o with circumflex and hook above1ED5 +Ocirctilatin capital letter o with circumflex and tilde1ED6 +ocirctilatin small letter o with circumflex and tilde1ED7 +Ocirclatin capital letter o with circumflex00D4 +ocirclatin small letter o with circumflex00F4 +Odblaclatin capital letter o with double acute0150 +odblaclatin small letter o with double acute0151 +Odotamalatin capital letter o with dot above and macron0230 +odotamalatin small letter o with dot above and macron0231 +Odotalatin capital letter o with dot above022E +odotalatin small letter o with dot above022F +Odotblatin capital letter o with dot below1ECC +odotblatin small letter o with dot below1ECD +OEliglatin capital letter oe0152 +oeliglatin small letter oe0153 +ogoncombining ogonek0328 +Ogravelatin capital letter o with grave00D2 +ogravelatin small letter o with grave00F2 +Ohookalatin capital letter o with hook above1ECE +ohookalatin small letter o with hook above1ECF +Ohornaclatin capital letter o with horn and acute1EDA +Ohornaclatin capital letter u with horn and acute1EE8 +ohornaclatin small letter o with horn and acute1EDB +Ohorndblatin capital letter o with horn and dot below1EE2 +ohorndblatin small letter o with horn and dot below1EE3 +Ohorngrlatin capital letter o with horn and grave1EDC +ohorngrlatin small letter o with horn and grave1EDD +Ohornhalatin capital letter o with horn and hook above1EDE +ohornhalatin small letter o with horn and hook above1EDF +Ohorntilatin capital letter o with horn and tilde1EE0 +ohorntilatin small letter o with horn and tilde1EE1 +Ohornlatin capital letter o with horn01A0 +ohornlatin small letter o with horn01A1 +Omacraclatin capital letter o with macron and acute1E52 +omacraclatin small letter o with macron and acute1E53 +Omacrgrlatin capital letter o with macron and grave1E50 +omacrgrlatin small letter o with macron and grave1E51 +Omacrlatin capital letter o with macron014C +omacrlatin small letter o with macron014D +Oogonmalatin capital letter o with ogonek and macron01EC +oogonmalatin small letter o with ogonek and macron01ED +Oogonlatin capital letter o with ogonek01EA +oogonlatin small letter o with ogonek01EB +Oslashalatin capital letter o with stroke and acute01FE +oslashalatin small letter o with stroke and acute01FF +Oslashlatin capital letter o with stroke00D8 +oslashlatin small letter o with stroke00F8 +Otildeaclatin capital letter o with tilde and acute1E4C +otildeaclatin small letter o with tilde and acute1E4D +Otildemalatin capital letter o with tilde and macron022C +otildemalatin small letter o with tilde and macron022D +Otildeumlatin capital letter o with tilde and diaeresis1E4E +otildeumlatin small letter o with tilde and diaeresis1E4F +Otildelatin capital letter o with tilde00D5 +otildelatin small letter o with tilde00F5 +Oumlmalatin capital letter o with diaeresis and macron022A +oumlmalatin small letter o with diaeresis and macron022B +Oumllatin capital letter o with umlaut00D6 +oumllatin small letter o with umlaut00F6 +Pacutelatin capital letter p with acute1E54 +pacutelatin small letter p with acute1E55 +Pdotalatin capital letter p with dot above1E56 +pdotalatin small letter p with dot above1E57 +plusmnplus-minus sign00B1 +poundpound sign00A3 +Racutelatin capital letter r with acute0154 +racutelatin small letter r with acute0155 +Rcaronlatin capital letter r with caron0158 +rcaronlatin small letter r with caron0159 +rcedilcombining left half ring below031C +Rcedillatin capital letter r with cedilla0156 +rcedillatin small letter r with cedilla0157 +rcommaacombining comma above right0315 +rdbltilcombining double tilde right halfFE23 +Rdotalatin capital letter r with dot above1E58 +rdotalatin small letter r with dot above1E59 +Rdotblatin capital letter r with dot below1E5A +rdotblatin small letter r with dot below1E5B +regregistered sign00AE +ringbcombining ring below0325 +ringcombining ring above030A +rligcombining ligature right halfFE21 +Rmacrblatin capital letter r with line below1E5E +rmacrblatin small letter r with line below1E5F +Sacutedalatin capital letter s with acute and dot above1E64 +sacutedalatin small letter s with acute and dot above1E65 +Sacutelatin capital letter s with acute015A +sacutelatin small letter s with acute015B +Scarondalatin capital letter s with caron and dot above1E66 +scarondalatin small letter s with caron and dot above1E67 +Scaronlatin capital letter s with caron0160 +scaronlatin small letter s with caron0161 +Scedillatin capital letter s with cedil015E +scedillatin small letter s with cedil015F +Scirclatin capital letter s with circumflex015C +scirclatin small letter s with circumflex015D +scommablatin capital letter s with comma below0218 +scommablatin small letter s with comma below0219 +scriptlscript small l2113 +Sdotalatin capital letter s with dot above1E60 +sdotalatin small letter s with dot above1E61 +Sdotbdalatin capital letter s with dot below and dot above1E68 +sdotbdalatin small letter s with dot below and dot above1E69 +Sdotblatin capital letter s with dot below1E62 +sdotblatin small letter s with dot below1E63 +sharpsharp266F +softsignmodifier letter prime02B9 +sub0subscript zero2080 +sub1subscript one2081 +sub2subscript two2082 +sub3subscript three2083 +sub4subscript four2084 +sub5subscript five2085 +sub6subscript six2086 +sub7subscript seven2087 +sub8subscript eight2088 +sub9subscript nine2089 +sublparsubscript left parenthesis208D +subminussubscript minus208B +subplussubscript plus sign208A +subrparsubscript right parenthesis208E +sup0superscript zero2070 +sup1superscript one00B9 +sup2superscript two00B2 +sup3superscript three00B3 +sup4superscript four2074 +sup5superscript five2075 +sup6superscript six2076 +sup7superscript seven2077 +sup8superscript eight2078 +sup9superscript nine2079 +suplparsuperscript left parenthesis207D +supminussuperscript minus207B +supplussuperscript plus sign207A +suprparsuperscript right parenthesis207E +Tcaronlatin capital letter t with caron0164 +tcaronlatin small letter t with caron0165 +Tcedillatin capital letter t with cedilla0162 +tcedillatin small letter t with cedilla0163 +tcirctilatin small letter e with circumflex and tilde1EC5 +Tcommablatin capital letter t with comma below021A +tcommablatin small letter t with comma below021B +Tdotblatin capital letter t with dot below1E6C +tdotblatin small letter t with dot below1E6D +Tdotlatin capital letter t with dot above1E6A +tdotlatin small letter t with dot above1E6B +THORNlatin capital letter thorn00DE +thornlatin small letter thorn00FE +tildecombining tilde0303 +Tmacrblatin capital letter t with line below1E6E +tmacrblatin small letter t with line below1E6F +tumllatin small letter t with diaeresis1E97 +Uacutelatin capital letter u with acute00DA +uacutelatin small letter u with acute00FA +Ubrevelatin capital letter u with breve016C +ubrevelatin small letter u with breve016D +ucaronlatin capital letter u with caron01D3 +ucaronlatin small letter u with caron01D4 +Ucirclatin capital letter u with circumflex00DB +ucirclatin small letter u with circumflex00FB +Udblaclatin capital letter u with double acute0170 +udblaclatin small letter u with double acute0171 +udbldblatin small letter u with double dot below1E73 +Udlbdblatin capital letter u with double dot below1E72 +Udotblatin capital letter u with dot below1EE4 +udotblatin small letter u with dot below1EE5 +Ugravelatin capital letter u with grave00D9 +ugravelatin small letter u with grave00F9 +uhookalatin capital letter u with hook above1EE6 +uhookalatin small letter u with hook above1EE7 +uhornaclatin small letter u with horn and acute1EE9 +Uhorndblatin capital letter u with horn and dot below1EF0 +uhorndblatin small letter u with horn and dot below1EF1 +Uhorngrlatin capital letter u with horn and grave1EEA +uhorngrlatin small letter u with horn and grave1EEB +Uhornhalatin capital letter u with horn and hook above1EEC +uhornhalatin small letter u with horn and hook above1EED +Uhorntilatin capital letter u with horn and tilde1EEE +uhorntilatin small letter u with horn and tilde1EEF +Uhornlatin capital letter u with horn01AF +uhornlatin small letter u with horn01B0 +Umacrumlatin capital letter u with macron and diaeresis1E7A +umacrumlatin small letter u with macron and diaeresis1E7B +Umacrlatin capital letter u with macron016A +umacrlatin small letter u with macron016B +umlcombining diaeresis0308 +undercombining low line0332 +Uogonlatin capital letter u with ogon0172 +uogonlatin small letter u with ogon0173 +Uringlatin capital letter u with ring016E +uringlatin small letter u with ring016F +utildeaclatin capital letter u with tilde and acute1E78 +utildeaclatin small letter u with tilde and acute1E79 +Utildelatin capital letter u with tilde0168 +utildelatin small letter u with tilde0169 +Uumlaclatin capital letter u with diaeresis and acute01D7 +uumlaclatin small letter u with diaeresis and acute01D8 +Uumlcalatin capital letter u with diaeresis and caron01D9 +uumlcalatin small letter u with diaresis and caron01DA +Uumlgrlatin capital letter u with diaeresis and grave01DB +uumlgrlatin small letter u with diaeresis and grave01DC +Uumlmalatin capital letter u with diaeresis and macron01D5 +uumlmalatin small letter u with diaeresis and macron01D6 +Uumllatin capital letter u with umlaut00DC +uumllatin small letter u with umlaut00FC +Vdotblatin capital letter v with dot below1E7E +vdotblatin small letter v with dot below1E7F +Vtildelatin capital letter v with tilde1E7C +vtildelatin small letter v with tilde1E7D +Wacutelatin capital letter w with acute1E82 +wacutelatin small letter w with acute1E83 +Wcirclatin capital letter w with circumflex0174 +wcirclatin small letter w with circumflex0175 +wdotblatin capital letter w with dot below1E88 +wdotblatin small letter w with dot below1E89 +Wdotlatin capital letter w with dot above1E86 +wdotlatin small letter w with dot above1E87 +Wgravelatin capital letter w with grave1E80 +wgravelatin small letter w with grave1E81 +wringlatin small letter w with ring1E98 +Wumllatin capital letter w with diaeresis1E84 +wumllatin small letter w with diaeresis1E85 +Xdotlatin capital letter x with dot1E8A +xdotlatin small letter x with dot1E8B +Xumllatin capital letter x with diaeresis1E8C +xumllatin small letter x with diaeresis1E8D +Yacutelatin capital letter y with acute00DD +yacutelatin small letter y with acute00FD +Ycirclatin capital letter y with circumflex0176 +ycirclatin small letter y with circumflex0177 +Ydotblatin capital letter y with dot below1EF4 +ydotblatin small letter y with dot below1EF5 +Ydotlatin capital letter y with dot1E8E +ydotlatin small letter y with dot1E8F +Ygravelatin capital letter y with grave1EF2 +ygravelatin small letter y with grave1EF3 +Yhookalatin capital letter y with hook above1EF6 +yhookalatin small letter y with hook above1EF7 +Ymacrlatin capital letter y with macron0232 +ymacrlatin small letter y with macron0233 +yringlatin small letter y with ring1E99 +Ytildelatin capital letter y with tilde1EF8 +ytildelatin small letter y with tilde1EF9 +Yumllatin capital letter y with umlaut0178 +yumllatin small letter y with umlaut00FF +Zacutelatin capital letter z with acute0179 +zacutelatin small letter z with acute017A +Zcaronlatin capital letter z with caron017D +zcaronlatin small letter z with caron017E +Zcirclatin capital letter z with circumflex1E90 +zcirclatin small letter z with circumflex1E91 +Zdotblatin capital letter z with dot below1E92 +zdotblatin small letter z with dot below1E93 +Zdotlatin capital letter z with dot above017B +zdotlatin small letter z with dot above017C +Zlowlinelatin capital letter z with low line1E94 +zlowlinelatin small letter z with low line1E95 + diff --git a/src/charconv.tcl b/src/charconv.tcl new file mode 100755 index 0000000..7a8fc1a --- /dev/null +++ b/src/charconv.tcl @@ -0,0 +1,275 @@ +#!/bin/sh +# the next line restats using tclsh \ +exec tclsh "$0" "$@" +# +# $Id: charconv.tcl,v 1.1 2003-10-27 12:21:30 adam Exp $ + +proc usage {} { + puts {charconv.tcl: [-p prefix] [-s split] [-o ofile] file ... } + exit 1 +} + +proc ins_trie {from to} { + global trie + if {![info exists trie(no)]} { + set trie(no) 1 + set trie(size) 0 + } + incr trie(size) + ins_trie_r [split $from] $to 0 +} + +proc split_trie {this} { + global trie + set trie($this,type) d + foreach e $trie($this,content) { + set from [lindex $e 0] + set to [lindex $e 1] + + set ch [lindex $from 0] + set rest [lrange $from 1 end] + + if {[llength $rest]} { + if {![info exist trie($this,ptr,$ch)]} { + set trie($this,ptr,$ch) $trie(no) + incr trie(no) + } + ins_trie_r $rest $to $trie($this,ptr,$ch) + } else { + set trie($this,to,$ch) $to + } + } + set trie($this,content) missing +} + +proc ins_trie_r {from to this} { + global trie + + if {![info exist trie($this,type)]} { + set trie($this,type) f + } + if {$trie($this,type) == "f"} { + lappend trie($this,content) [list $from $to] + + # split ? + if {[llength $trie($this,content)] > $trie(split)} { + split_trie $this + return [ins_trie_r $from $to $this] + } + } else { + set ch [lindex $from 0] + set rest [lrange $from 1 end] + + if {[llength $rest]} { + if {![info exist trie($this,ptr,$ch)]} { + set trie($this,ptr,$ch) $trie(no) + incr trie(no) + } + ins_trie_r $rest $to $trie($this,ptr,$ch) + } else { + set trie($this,to,$ch) $to + } + } +} + +proc dump_trie {ofile} { + global trie + + set f [open $ofile w] + + puts $f "/* TRIE: size $trie(size) */" + puts $f "\#include " + puts $f { + struct yaz_iconv_trie_flat { + char *from; + int to; + }; + struct yaz_iconv_trie_dir { + struct yaz_iconv_trie *ptr; + int to; + }; + + struct yaz_iconv_trie { + struct yaz_iconv_trie_flat *flat; + struct yaz_iconv_trie_dir *dir; + }; + } + + set this $trie(no) + while { [incr this -1] >= 0 } { + puts $f "/* PAGE $this */" + if {$trie($this,type) == "f"} { + puts $f "struct yaz_iconv_trie_flat $trie(prefix)page${this}_flat\[\] = \{" + foreach m $trie($this,content) { + puts -nonewline $f " \{\"" + foreach d [lindex $m 0] { + puts -nonewline $f "\\x$d" + } + puts -nonewline $f "\", 0x[lindex $m 1]" + puts $f "\}," + } + puts $f " \{0, 0\}" + puts $f "\};" + puts $f "struct yaz_iconv_trie $trie(prefix)page${this} = \{" + puts $f " $trie(prefix)page${this}_flat, 0" + puts $f "\};" + } else { + puts $f "struct yaz_iconv_trie_dir $trie(prefix)page${this}_dir\[256\] = \{" + for {set i 0} {$i < 256} {incr i} { + puts -nonewline $f " \{" + set ch [format %02X $i] + set null 1 + if {[info exist trie($this,ptr,$ch)]} { + puts -nonewline $f "&$trie(prefix)page$trie($this,ptr,$ch), " + set null 0 + } else { + puts -nonewline $f "0, " + } + if {[info exist trie($this,to,$ch)]} { + puts -nonewline $f "0x$trie($this,to,$ch)\}" + set null 0 + } else { + puts -nonewline $f "0\}" + } + if {!$null} { + puts -nonewline $f " /* $ch */" + } + if {$i < 255} { + puts $f "," + } else { + puts $f "" + } + } + puts $f "\};" + puts $f "struct yaz_iconv_trie $trie(prefix)page${this} = \{" + puts $f " 0, $trie(prefix)page${this}_dir" + puts $f "\};" + } + } + puts $f { + static unsigned long lookup(struct yaz_iconv_trie *t, unsigned char *inp, + size_t inbytesleft, size_t *no_read) + { + if (!t || inbytesleft < 1) + return 0; + if (t->dir) + { + size_t ch = inp[0] & 0xff; + unsigned long code = + lookup(t->dir[ch].ptr, inp+1, inbytesleft-1, no_read); + if (code) + { + (*no_read)++; + return code; + } + if (t->dir[ch].to) + { + code = t->dir[ch].to; + *no_read = 1; + return code; + } + } + else + { + struct yaz_iconv_trie_flat *flat = t->flat; + while (flat->from) + { + size_t len = strlen(flat->from); + if (len <= inbytesleft) + { + if (memcmp(flat->from, inp, len) == 0) + { + *no_read = len; + return flat->to; + } + } + flat++; + } + } + return 0; + } + + } + puts $f "unsigned long yaz_$trie(prefix)_conv + (unsigned char *inp, size_t inbytesleft, size_t *no_read) + { + unsigned long code; + + code = lookup(&$trie(prefix)page0, inp, inbytesleft, no_read); + if (!code) + { + *no_read = 1; + code = *inp; + } + return code; + } + " + close $f +} + +proc readfile {fname} { + set lineno 0 + set f [open $fname r] + while {1} { + incr lineno + set cnt [gets $f line] + if {$cnt < 0} { + break + } + set hex {} + set uni {} + regexp {([0-9A-Z]*)} $line s hex uni + # puts "$lineno hex=$hex uni=$uni $line" + if {[string length $uni]} { + ins_trie $hex $uni + } + } + close $f +} + +set verbose 0 +set ifile {} +set ofile out.c +set trie(split) 40 +set trie(prefix) {} +# Parse command line +set l [llength $argv] +set i 0 +while {$i < $l} { + set arg [lindex $argv $i] + switch -glob -- $arg { + -v { + incr verbose + } + -s { + if {[string length $arg]} { + set arg [lindex $argv [incr i]] + } + set trie(split) $arg + } + -p { + if {[string length $arg]} { + set arg [lindex $argv [incr i]] + } + set trie(prefix) $arg + } + -o { + if {[string length $arg]} { + set arg [lindex $argv [incr i]] + } + set ofile $arg + } + default { + lappend ifiles $arg + } + } + incr i +} +if {![info exists ifiles]} { + puts "charconv.tcl: missing input file(s)" + usage +} +foreach ifile $ifiles { + readfile $ifile +} +dump_trie $ofile diff --git a/src/charconv_cjk.xml b/src/charconv_cjk.xml new file mode 100644 index 0000000..494e523 --- /dev/null +++ b/src/charconv_cjk.xml @@ -0,0 +1,15730 @@ + +3000CJK space in some implementations +3000CJK space per ANSI Z39.64 +FF08Ideographic left parenthesis +FF09Ideographic right parenthesis +FF0DIdeographic hyphen minus +E8D0EACC component character +E8D1EACC component character +E8D2EACC component character +E8D3EACC component character +E8D4EACC component character +E8D5EACC component character +E8D6EACC component character +E8D7EACC component character +E8D8EACC component character +E8D9EACC component character +E8DAEACC component character +E8DBEACC component character +E8DCEACC component character +E8DDEACC component character +E8DEEACC component character +E8DFEACC component character +E8E0EACC component character +E8E1EACC component character +E8E2EACC component character +E8E3EACC component character +E8E4EACC component character +E8E5EACC component character +E8E6EACC component character +E8E7EACC component character +E8E8EACC component character +E8E9EACC component character +E8EAEACC component character +E8EBEACC component character +E8ECEACC component character +E8EDEACC component character +E8EEEACC component character +E8EFEACC component character +E8F0EACC component character +E8F1EACC component character +E8F2EACC component character +3013Ideographic geta symbol +300CIdeographic left corner bracket +300DIdeographic right corner bracket +FF3BIdeographic left square bracket +FF3DIdeographic right square bracket +3002Ideographic full stop +FF0EIdeographic variant full stop +3001Ideographic comma +FF0CIdeographic variant comma +FF1BIdeographic semicolon +FF1AIdeographic colon +FF1FIdeographic question mark +FF01Ideographic exclamation point +FF0FIdeographic solidus +3007Ideographic number zero +4E00East Asian ideograph +4E01East Asian ideograph +4E03East Asian ideograph +4E09East Asian ideograph +4E0BEast Asian ideograph +4E0AEast Asian ideograph +4E08East Asian ideograph +4E10East Asian ideograph +4E0DEast Asian ideograph +4E14East Asian ideograph +4E19East Asian ideograph +4E16East Asian ideograph +4E15East Asian ideograph +4E18East Asian ideograph +4E22East Asian ideograph +4E1EEast Asian ideograph +4E26East Asian ideograph +4E2DEast Asian ideograph +4E32East Asian ideograph +51E1East Asian ideograph +4E38East Asian ideograph +4E39East Asian ideograph +4E3BEast Asian ideograph +4E43East Asian ideograph +4E45East Asian ideograph +4E4BEast Asian ideograph +5C39East Asian ideograph +4E4FEast Asian ideograph +4E4EEast Asian ideograph +4E4DEast Asian ideograph +4E52East Asian ideograph +4E53East Asian ideograph +4E56East Asian ideograph +4E58East Asian ideograph +4E59East Asian ideograph +4E5DEast Asian ideograph +4E5FEast Asian ideograph +4E5EEast Asian ideograph +4E73East Asian ideograph +4E7EEast Asian ideograph +4E82East Asian ideograph +4E8BEast Asian ideograph +4E8CEast Asian ideograph +4E8EEast Asian ideograph +4E95East Asian ideograph +4E94East Asian ideograph +4E92East Asian ideograph +E9304E99Variant of 4B3057 which maps to 4E99 +4E9EEast Asian ideograph +4E9BEast Asian ideograph +4E9FEast Asian ideograph +4EA1East Asian ideograph +4EA6East Asian ideograph +4EA5East Asian ideograph +4EA4East Asian ideograph +4EA8East Asian ideograph +4EABEast Asian ideograph +4EACEast Asian ideograph +4EADEast Asian ideograph +4EAEEast Asian ideograph +4EBAEast Asian ideograph +4ECAEast Asian ideograph +4EC1East Asian ideograph +4EC3East Asian ideograph +4EC4East Asian ideograph +4ECDEast Asian ideograph +4EC7East Asian ideograph +4ECBEast Asian ideograph +4EE4East Asian ideograph +4ED8East Asian ideograph +4ED5East Asian ideograph +4ED6East Asian ideograph +4EDEEast Asian ideograph +4EE3East Asian ideograph +4ED4East Asian ideograph +4ED7East Asian ideograph +4ED9East Asian ideograph +4EE5East Asian ideograph +4EFFEast Asian ideograph +4F09East Asian ideograph +4EFBEast Asian ideograph +4F0AEast Asian ideograph +4F15East Asian ideograph +4F11East Asian ideograph +4F10East Asian ideograph +4F0FEast Asian ideograph +4EF2East Asian ideograph +4F01East Asian ideograph +4EF3East Asian ideograph +4EF6East Asian ideograph +4EF0East Asian ideograph +4F4FEast Asian ideograph +4F4DEast Asian ideograph +4F34East Asian ideograph +4F47East Asian ideograph +4F57East Asian ideograph +4F3AEast Asian ideograph +4F5EEast Asian ideograph +4F5BEast Asian ideograph +4F55East Asian ideograph +4F30East Asian ideograph +4F50East Asian ideograph +4F51East Asian ideograph +4F3DEast Asian ideograph +4F48East Asian ideograph +4F46East Asian ideograph +4F38East Asian ideograph +4F43East Asian ideograph +4F54East Asian ideograph +4F3CEast Asian ideograph +4F63East Asian ideograph +4F5CEast Asian ideograph +4F60East Asian ideograph +4F2FEast Asian ideograph +4F4EEast Asian ideograph +4F5DEast Asian ideograph +4F36East Asian ideograph +4F9DEast Asian ideograph +4F6FEast Asian ideograph +4F75East Asian ideograph +4F8DEast Asian ideograph +4F73East Asian ideograph +4F7FEast Asian ideograph +4F9BEast Asian ideograph +4F86East Asian ideograph +4F6CEast Asian ideograph +4F8BEast Asian ideograph +4F96East Asian ideograph +4F83East Asian ideograph +4F7BEast Asian ideograph +4F88East Asian ideograph +4F69East Asian ideograph +4F8FEast Asian ideograph +4F7EEast Asian ideograph +4FE1East Asian ideograph +4FD1East Asian ideograph +4FB5East Asian ideograph +4FAFEast Asian ideograph +4FBFEast Asian ideograph +4FDEEast Asian ideograph +4FE0East Asian ideograph +4FCFEast Asian ideograph +4FB6East Asian ideograph +4FDAEast Asian ideograph +4FDDEast Asian ideograph +4FC3East Asian ideograph +4FD8East Asian ideograph +4FDFEast Asian ideograph +4FCAEast Asian ideograph +4FAEEast Asian ideograph +4FD0East Asian ideograph +4FC4East Asian ideograph +4FC2East Asian ideograph +4FCEEast Asian ideograph +4FD7East Asian ideograph +5009East Asian ideograph +500DEast Asian ideograph +4FEFEast Asian ideograph +5026East Asian ideograph +500CEast Asian ideograph +5025East Asian ideograph +5011East Asian ideograph +4FF8East Asian ideograph +5028East Asian ideograph +5014East Asian ideograph +5016East Asian ideograph +5029East Asian ideograph +5006East Asian ideograph +5012East Asian ideograph +503CEast Asian ideograph +501AEast Asian ideograph +4FFAEast Asian ideograph +5018East Asian ideograph +4FF1East Asian ideograph +5021East Asian ideograph +500BEast Asian ideograph +5019East Asian ideograph +5000East Asian ideograph +4FEEEast Asian ideograph +4FF3East Asian ideograph +502DEast Asian ideograph +5003East Asian ideograph +4FFEEast Asian ideograph +502AEast Asian ideograph +502BEast Asian ideograph +505CEast Asian ideograph +504FEast Asian ideograph +5065East Asian ideograph +5047East Asian ideograph +505AEast Asian ideograph +5049East Asian ideograph +5043East Asian ideograph +5074East Asian ideograph +5076East Asian ideograph +504EEast Asian ideograph +5075East Asian ideograph +504CEast Asian ideograph +5055East Asian ideograph +500FEast Asian ideograph +5077East Asian ideograph +508DEast Asian ideograph +50A2East Asian ideograph +5085East Asian ideograph +5099East Asian ideograph +5091East Asian ideograph +5080East Asian ideograph +5096East Asian ideograph +5098East Asian ideograph +50ADEast Asian ideograph +50B3East Asian ideograph +50B5East Asian ideograph +50B2East Asian ideograph +50C5East Asian ideograph +50BEEast Asian ideograph +50ACEast Asian ideograph +50B7East Asian ideograph +50AFEast Asian ideograph +50E7East Asian ideograph +50EEEast Asian ideograph +50F1East Asian ideograph +50E5East Asian ideograph +50D6East Asian ideograph +50EDEast Asian ideograph +50DAEast Asian ideograph +50D5East Asian ideograph +507DEast Asian ideograph +50CFEast Asian ideograph +50D1East Asian ideograph +5100East Asian ideograph +5104East Asian ideograph +50FBEast Asian ideograph +50F5East Asian ideograph +50F9East Asian ideograph +5102East Asian ideograph +510DEast Asian ideograph +5108East Asian ideograph +5109East Asian ideograph +5110East Asian ideograph +5118East Asian ideograph +5112East Asian ideograph +5114East Asian ideograph +512AEast Asian ideograph +511FEast Asian ideograph +5121East Asian ideograph +5132East Asian ideograph +5137East Asian ideograph +513CEast Asian ideograph +5140East Asian ideograph +5143East Asian ideograph +5141East Asian ideograph +5145East Asian ideograph +5144East Asian ideograph +5146East Asian ideograph +5149East Asian ideograph +5147East Asian ideograph +5148East Asian ideograph +514CEast Asian ideograph +514DEast Asian ideograph +5155East Asian ideograph +5154East Asian ideograph +5152East Asian ideograph +5157East Asian ideograph +515CEast Asian ideograph +5162East Asian ideograph +5165East Asian ideograph +5167East Asian ideograph +5168East Asian ideograph +5169East Asian ideograph +516BEast Asian ideograph +516DEast Asian ideograph +516EEast Asian ideograph +516CEast Asian ideograph +5171East Asian ideograph +5175East Asian ideograph +5176East Asian ideograph +5177East Asian ideograph +5178East Asian ideograph +517CEast Asian ideograph +5180East Asian ideograph +5189East Asian ideograph +518CEast Asian ideograph +518DEast Asian ideograph +5192East Asian ideograph +5191East Asian ideograph +5195East Asian ideograph +6700East Asian ideograph +5197East Asian ideograph +51A0East Asian ideograph +51A5East Asian ideograph +51B0East Asian ideograph +51B6East Asian ideograph +51B7East Asian ideograph +51CDEast Asian ideograph +51CCEast Asian ideograph +51DCEast Asian ideograph +51DDEast Asian ideograph +51F0East Asian ideograph +51F1East Asian ideograph +51F3East Asian ideograph +51FAEast Asian ideograph +51F9East Asian ideograph +51F8East Asian ideograph +51FDEast Asian ideograph +5200East Asian ideograph +5201East Asian ideograph +5203East Asian ideograph +5207East Asian ideograph +5206East Asian ideograph +5208East Asian ideograph +520AEast Asian ideograph +5211East Asian ideograph +5217East Asian ideograph +520EEast Asian ideograph +5224East Asian ideograph +5225East Asian ideograph +5220East Asian ideograph +5228East Asian ideograph +5229East Asian ideograph +5238East Asian ideograph +523BEast Asian ideograph +5237East Asian ideograph +5230East Asian ideograph +523AEast Asian ideograph +5241East Asian ideograph +5239East Asian ideograph +5243East Asian ideograph +524DEast Asian ideograph +524CEast Asian ideograph +524BEast Asian ideograph +524AEast Asian ideograph +5247East Asian ideograph +525CEast Asian ideograph +5256East Asian ideograph +525BEast Asian ideograph +5254East Asian ideograph +525DEast Asian ideograph +526AEast Asian ideograph +526FEast Asian ideograph +5272East Asian ideograph +5274East Asian ideograph +5269East Asian ideograph +5275East Asian ideograph +527DEast Asian ideograph +527FEast Asian ideograph +5283East Asian ideograph +5288East Asian ideograph +5287East Asian ideograph +528DEast Asian ideograph +5289East Asian ideograph +5291East Asian ideograph +529BEast Asian ideograph +529FEast Asian ideograph +52A0East Asian ideograph +52A3East Asian ideograph +52ABEast Asian ideograph +52A9East Asian ideograph +52ACEast Asian ideograph +52AAEast Asian ideograph +52BEEast Asian ideograph +52C7East Asian ideograph +52C3East Asian ideograph +52C1East Asian ideograph +52C9East Asian ideograph +52D8East Asian ideograph +52D2East Asian ideograph +52D9East Asian ideograph +52D5East Asian ideograph +52DEEast Asian ideograph +52DBEast Asian ideograph +52DDEast Asian ideograph +52E2East Asian ideograph +52E4East Asian ideograph +52DFEast Asian ideograph +52F5East Asian ideograph +52F8East Asian ideograph +52FBEast Asian ideograph +52FFEast Asian ideograph +5305East Asian ideograph +5306East Asian ideograph +5308East Asian ideograph +530DEast Asian ideograph +5310East Asian ideograph +530FEast Asian ideograph +5315East Asian ideograph +5316East Asian ideograph +5317East Asian ideograph +5319East Asian ideograph +53F5East Asian ideograph +531DEast Asian ideograph +5321East Asian ideograph +5320East Asian ideograph +5323East Asian ideograph +532AEast Asian ideograph +532FEast Asian ideograph +5331East Asian ideograph +5339East Asian ideograph +533EEast Asian ideograph +5340East Asian ideograph +533FEast Asian ideograph +5341East Asian ideograph +5343East Asian ideograph +5345East Asian ideograph +5348East Asian ideograph +5347East Asian ideograph +534AEast Asian ideograph +E9315349Variant of 2D345D which maps to 5349 +5352East Asian ideograph +5354East Asian ideograph +5353East Asian ideograph +5351East Asian ideograph +5357East Asian ideograph +535AEast Asian ideograph +535EEast Asian ideograph +5361East Asian ideograph +5366East Asian ideograph +536FEast Asian ideograph +536EEast Asian ideograph +5370East Asian ideograph +5371East Asian ideograph +537DEast Asian ideograph +5375East Asian ideograph +5378East Asian ideograph +537BEast Asian ideograph +537FEast Asian ideograph +5384East Asian ideograph +539AEast Asian ideograph +539DEast Asian ideograph +539FEast Asian ideograph +53A5East Asian ideograph +53ADEast Asian ideograph +53B2East Asian ideograph +53BBEast Asian ideograph +53C3East Asian ideograph +53C8East Asian ideograph +53C9East Asian ideograph +53CBEast Asian ideograph +53CAEast Asian ideograph +53CDEast Asian ideograph +53D6East Asian ideograph +53D4East Asian ideograph +53D7East Asian ideograph +53DBEast Asian ideograph +53DFEast Asian ideograph +66FCEast Asian ideograph +53E2East Asian ideograph +53E3East Asian ideograph +53F8East Asian ideograph +53E4East Asian ideograph +53EEEast Asian ideograph +53EFEast Asian ideograph +53E9East Asian ideograph +53F3East Asian ideograph +53FCEast Asian ideograph +53E8East Asian ideograph +53E6East Asian ideograph +53ECEast Asian ideograph +53EBEast Asian ideograph +E900Duplicate simplified ideograph +53E5East Asian ideograph +53F1East Asian ideograph +53EDEast Asian ideograph +53EAEast Asian ideograph +53F2East Asian ideograph +540BEast Asian ideograph +5409East Asian ideograph +5410East Asian ideograph +540FEast Asian ideograph +540CEast Asian ideograph +540AEast Asian ideograph +540DEast Asian ideograph +5404East Asian ideograph +5403East Asian ideograph +5412East Asian ideograph +E9E0East Asian ideograph not in Unicode +542DEast Asian ideograph +541DEast Asian ideograph +541EEast Asian ideograph +541BEast Asian ideograph +544EEast Asian ideograph +543EEast Asian ideograph +5427East Asian ideograph +5440East Asian ideograph +5431East Asian ideograph +5446East Asian ideograph +543CEast Asian ideograph +5443East Asian ideograph +5426East Asian ideograph +5420East Asian ideograph +5436East Asian ideograph +5433East Asian ideograph +5435East Asian ideograph +542EEast Asian ideograph +544AEast Asian ideograph +5448East Asian ideograph +543BEast Asian ideograph +5438East Asian ideograph +5439East Asian ideograph +5442East Asian ideograph +542BEast Asian ideograph +541FEast Asian ideograph +5429East Asian ideograph +5473East Asian ideograph +5462East Asian ideograph +5475East Asian ideograph +5495East Asian ideograph +5478East Asian ideograph +5496East Asian ideograph +5477East Asian ideograph +547BEast Asian ideograph +5492East Asian ideograph +5484East Asian ideograph +547CEast Asian ideograph +5468East Asian ideograph +5486East Asian ideograph +548BEast Asian ideograph +548CEast Asian ideograph +5490East Asian ideograph +547DEast Asian ideograph +5476East Asian ideograph +5471East Asian ideograph +549AEast Asian ideograph +548EEast Asian ideograph +54A9East Asian ideograph +54AAEast Asian ideograph +54A8East Asian ideograph +54ACEast Asian ideograph +54C0East Asian ideograph +54B3East Asian ideograph +54A6East Asian ideograph +54ABEast Asian ideograph +54C7East Asian ideograph +54C9East Asian ideograph +54C4East Asian ideograph +54C2East Asian ideograph +54C1East Asian ideograph +54CEEast Asian ideograph +54B1East Asian ideograph +54BBEast Asian ideograph +54AFEast Asian ideograph +54C8East Asian ideograph +5501East Asian ideograph +54FCEast Asian ideograph +5510East Asian ideograph +54EAEast Asian ideograph +5514East Asian ideograph +54FAEast Asian ideograph +54E5East Asian ideograph +54EEEast Asian ideograph +54F2East Asian ideograph +54E8East Asian ideograph +54E1East Asian ideograph +54E9East Asian ideograph +54EDEast Asian ideograph +5506East Asian ideograph +5509East Asian ideograph +54E6East Asian ideograph +5556East Asian ideograph +5533East Asian ideograph +5546East Asian ideograph +554FEast Asian ideograph +555EEast Asian ideograph +5566East Asian ideograph +556AEast Asian ideograph +554AEast Asian ideograph +5544East Asian ideograph +555CEast Asian ideograph +5531East Asian ideograph +5543East Asian ideograph +552CEast Asian ideograph +5561East Asian ideograph +553EEast Asian ideograph +5563East Asian ideograph +5555East Asian ideograph +552FEast Asian ideograph +552EEast Asian ideograph +5564East Asian ideograph +5538East Asian ideograph +55A7East Asian ideograph +5580East Asian ideograph +557BEast Asian ideograph +557CEast Asian ideograph +5527East Asian ideograph +5594East Asian ideograph +5587East Asian ideograph +559CEast Asian ideograph +558BEast Asian ideograph +55AAEast Asian ideograph +55B3East Asian ideograph +558AEast Asian ideograph +5583East Asian ideograph +55B1East Asian ideograph +55AEEast Asian ideograph +5582East Asian ideograph +559FEast Asian ideograph +559DEast Asian ideograph +5598East Asian ideograph +559AEast Asian ideograph +557EEast Asian ideograph +55ACEast Asian ideograph +5589East Asian ideograph +55B2East Asian ideograph +55BBEast Asian ideograph +55E8East Asian ideograph +55DFEast Asian ideograph +55D1East Asian ideograph +55DCEast Asian ideograph +55E6East Asian ideograph +55C7East Asian ideograph +55D3East Asian ideograph +55CEEast Asian ideograph +55E3East Asian ideograph +55EFEast Asian ideograph +55E4East Asian ideograph +55C5East Asian ideograph +55DAEast Asian ideograph +55C6East Asian ideograph +55E1East Asian ideograph +5600East Asian ideograph +561BEast Asian ideograph +55FEEast Asian ideograph +5616East Asian ideograph +55F7East Asian ideograph +5608East Asian ideograph +561FEast Asian ideograph +55FDEast Asian ideograph +E9325606Variant of 4B372C which maps to 5606 +5609East Asian ideograph +5614East Asian ideograph +560EEast Asian ideograph +5617East Asian ideograph +560DEast Asian ideograph +562EEast Asian ideograph +562FEast Asian ideograph +564EEast Asian ideograph +5636East Asian ideograph +5632East Asian ideograph +563BEast Asian ideograph +5639East Asian ideograph +5657East Asian ideograph +5653East Asian ideograph +563FEast Asian ideograph +5634East Asian ideograph +5637East Asian ideograph +5659East Asian ideograph +5630East Asian ideograph +566BEast Asian ideograph +5664East Asian ideograph +5669East Asian ideograph +5678East Asian ideograph +5674East Asian ideograph +5679East Asian ideograph +5665East Asian ideograph +566AEast Asian ideograph +5668East Asian ideograph +5671East Asian ideograph +566FEast Asian ideograph +E9335662Variant of 4B374C which maps to 5662 +566CEast Asian ideograph +5680East Asian ideograph +568EEast Asian ideograph +5685East Asian ideograph +5687East Asian ideograph +5690East Asian ideograph +568FEast Asian ideograph +5695East Asian ideograph +E93456AEVariant of 453755 which maps to 56AE +56A8East Asian ideograph +56B0East Asian ideograph +56A5East Asian ideograph +56B7East Asian ideograph +56B4East Asian ideograph +56B6East Asian ideograph +56C0East Asian ideograph +56C1East Asian ideograph +56C2East Asian ideograph +56BCEast Asian ideograph +56CAEast Asian ideograph +56C9East Asian ideograph +56C8East Asian ideograph +56D1East Asian ideograph +56DBEast Asian ideograph +56DAEast Asian ideograph +56E0East Asian ideograph +56DEEast Asian ideograph +56E4East Asian ideograph +56F1East Asian ideograph +56FAEast Asian ideograph +5703East Asian ideograph +5708East Asian ideograph +570BEast Asian ideograph +570DEast Asian ideograph +5712East Asian ideograph +5713East Asian ideograph +5718East Asian ideograph +5716East Asian ideograph +571FEast Asian ideograph +572DEast Asian ideograph +572FEast Asian ideograph +5730East Asian ideograph +5728East Asian ideograph +5733East Asian ideograph +5751East Asian ideograph +574AEast Asian ideograph +5740East Asian ideograph +5747East Asian ideograph +574DEast Asian ideograph +573EEast Asian ideograph +574EEast Asian ideograph +5783East Asian ideograph +576AEast Asian ideograph +5769East Asian ideograph +5777East Asian ideograph +5761East Asian ideograph +5764East Asian ideograph +5766East Asian ideograph +5782East Asian ideograph +577CEast Asian ideograph +57A0East Asian ideograph +578BEast Asian ideograph +57A3East Asian ideograph +57AEEast Asian ideograph +57A2East Asian ideograph +57D4East Asian ideograph +57C2East Asian ideograph +57CEEast Asian ideograph +57CBEast Asian ideograph +57C3East Asian ideograph +57F9East Asian ideograph +57F7East Asian ideograph +57FAEast Asian ideograph +57DFEast Asian ideograph +580AEast Asian ideograph +5805East Asian ideograph +5802East Asian ideograph +5806East Asian ideograph +57E4East Asian ideograph +57E0East Asian ideograph +5831East Asian ideograph +582FEast Asian ideograph +5835East Asian ideograph +582AEast Asian ideograph +5830East Asian ideograph +5824East Asian ideograph +5834East Asian ideograph +5821East Asian ideograph +585EEast Asian ideograph +5857East Asian ideograph +5858East Asian ideograph +5851East Asian ideograph +586BEast Asian ideograph +584CEast Asian ideograph +585AEast Asian ideograph +586DEast Asian ideograph +5854East Asian ideograph +5862East Asian ideograph +584AEast Asian ideograph +5883East Asian ideograph +587EEast Asian ideograph +5875East Asian ideograph +588AEast Asian ideograph +5879East Asian ideograph +5885East Asian ideograph +5893East Asian ideograph +589EEast Asian ideograph +5880East Asian ideograph +58B3East Asian ideograph +589CEast Asian ideograph +58AEEast Asian ideograph +589FEast Asian ideograph +E93558C7Variant of 4B3864 which maps to 58C7 +58C5East Asian ideograph +58C1East Asian ideograph +58BEEast Asian ideograph +58D5East Asian ideograph +58D3East Asian ideograph +58D1East Asian ideograph +58D9East Asian ideograph +58D8East Asian ideograph +58DFEast Asian ideograph +58DEEast Asian ideograph +58E2East Asian ideograph +58E4East Asian ideograph +58E9East Asian ideograph +58EBEast Asian ideograph +58ECEast Asian ideograph +58EFEast Asian ideograph +58FAEast Asian ideograph +58FDEast Asian ideograph +590FEast Asian ideograph +5914East Asian ideograph +5915East Asian ideograph +5916East Asian ideograph +5919East Asian ideograph +591AEast Asian ideograph +591CEast Asian ideograph +5920East Asian ideograph +5924East Asian ideograph +5925East Asian ideograph +5922East Asian ideograph +5927East Asian ideograph +592AEast Asian ideograph +592BEast Asian ideograph +5929East Asian ideograph +592DEast Asian ideograph +592EEast Asian ideograph +5931East Asian ideograph +5937East Asian ideograph +593EEast Asian ideograph +5954East Asian ideograph +5949East Asian ideograph +5948East Asian ideograph +5947East Asian ideograph +5944East Asian ideograph +5955East Asian ideograph +5951East Asian ideograph +594EEast Asian ideograph +594FEast Asian ideograph +5950East Asian ideograph +5957East Asian ideograph +5958East Asian ideograph +595AEast Asian ideograph +5960East Asian ideograph +5962East Asian ideograph +5967East Asian ideograph +5969East Asian ideograph +596AEast Asian ideograph +596EEast Asian ideograph +5973East Asian ideograph +5974East Asian ideograph +5976East Asian ideograph +5984East Asian ideograph +5983East Asian ideograph +5978East Asian ideograph +597DEast Asian ideograph +5979East Asian ideograph +5982East Asian ideograph +5981East Asian ideograph +59A8East Asian ideograph +5992East Asian ideograph +59A4East Asian ideograph +59A3East Asian ideograph +5993East Asian ideograph +599EEast Asian ideograph +599DEast Asian ideograph +5999East Asian ideograph +59A5East Asian ideograph +598AEast Asian ideograph +5996East Asian ideograph +59BEEast Asian ideograph +59BBEast Asian ideograph +59AEEast Asian ideograph +59D1East Asian ideograph +59B9East Asian ideograph +59C6East Asian ideograph +59D0East Asian ideograph +59D7East Asian ideograph +59AFEast Asian ideograph +59D2East Asian ideograph +59D3East Asian ideograph +59CAEast Asian ideograph +59CBEast Asian ideograph +59D4East Asian ideograph +59E3East Asian ideograph +59FFEast Asian ideograph +59D8East Asian ideograph +5A03East Asian ideograph +59E8East Asian ideograph +59E5East Asian ideograph +59EAEast Asian ideograph +5A01East Asian ideograph +59FBEast Asian ideograph +59E6East Asian ideograph +59DAEast Asian ideograph +5A11East Asian ideograph +5A18East Asian ideograph +5A23East Asian ideograph +5A1CEast Asian ideograph +5A13East Asian ideograph +59ECEast Asian ideograph +5A20East Asian ideograph +5A1FEast Asian ideograph +5A1BEast Asian ideograph +5A0CEast Asian ideograph +5A29East Asian ideograph +5A25East Asian ideograph +5A46East Asian ideograph +5A49East Asian ideograph +5A6AEast Asian ideograph +5A36East Asian ideograph +5A4AEast Asian ideograph +5A40East Asian ideograph +5A66East Asian ideograph +5A41East Asian ideograph +5A3CEast Asian ideograph +5A62East Asian ideograph +5A5AEast Asian ideograph +5A77East Asian ideograph +5A9AEast Asian ideograph +5A92East Asian ideograph +5A7FEast Asian ideograph +5ABCEast Asian ideograph +5A9BEast Asian ideograph +5ACCEast Asian ideograph +5AC1East Asian ideograph +5AC9East Asian ideograph +5ABEEast Asian ideograph +5ABDEast Asian ideograph +5AB2East Asian ideograph +5AC2East Asian ideograph +5AB3East Asian ideograph +5AE1East Asian ideograph +5AD7East Asian ideograph +5AD6East Asian ideograph +5AE3East Asian ideograph +5AE9East Asian ideograph +5AD8East Asian ideograph +5AE6East Asian ideograph +5AFBEast Asian ideograph +5B09East Asian ideograph +5B0BEast Asian ideograph +5B0CEast Asian ideograph +5AF5East Asian ideograph +5B34East Asian ideograph +5B1DEast Asian ideograph +5B2AEast Asian ideograph +5B24East Asian ideograph +5B30East Asian ideograph +5B38East Asian ideograph +5B40East Asian ideograph +5B50East Asian ideograph +5B51East Asian ideograph +5B53East Asian ideograph +5B54East Asian ideograph +5B55East Asian ideograph +5B57East Asian ideograph +5B58East Asian ideograph +5B5DEast Asian ideograph +5B5CEast Asian ideograph +5B5FEast Asian ideograph +5B63East Asian ideograph +5B64East Asian ideograph +5B69East Asian ideograph +5B6BEast Asian ideograph +5B70East Asian ideograph +5B73East Asian ideograph +5B71East Asian ideograph +5B75East Asian ideograph +5B78East Asian ideograph +5B7AEast Asian ideograph +5B7DEast Asian ideograph +5B7FEast Asian ideograph +5B87East Asian ideograph +5B88East Asian ideograph +5B89East Asian ideograph +5B85East Asian ideograph +5B8CEast Asian ideograph +5B8BEast Asian ideograph +5B8FEast Asian ideograph +5B97East Asian ideograph +5B9AEast Asian ideograph +5B9CEast Asian ideograph +5B98East Asian ideograph +5B99East Asian ideograph +5B9BEast Asian ideograph +5BA5East Asian ideograph +5BA3East Asian ideograph +5BA6East Asian ideograph +5BA4East Asian ideograph +5BA2East Asian ideograph +5BB0East Asian ideograph +5BB8East Asian ideograph +5BB5East Asian ideograph +5BB4East Asian ideograph +5BAEEast Asian ideograph +5BB9East Asian ideograph +5BB3East Asian ideograph +5BC6East Asian ideograph +5BC7East Asian ideograph +5BC5East Asian ideograph +5BC4East Asian ideograph +5BC2East Asian ideograph +5BBFEast Asian ideograph +5BCCEast Asian ideograph +5BD2East Asian ideograph +5BD0East Asian ideograph +5BD3East Asian ideograph +5BE1East Asian ideograph +5BE5East Asian ideograph +5BE8East Asian ideograph +5BE2East Asian ideograph +5BE4East Asian ideograph +5BDEEast Asian ideograph +5BE6East Asian ideograph +5BE7East Asian ideograph +5BDFEast Asian ideograph +5BEEEast Asian ideograph +5BECEast Asian ideograph +5BE9East Asian ideograph +5BEBEast Asian ideograph +5BF5East Asian ideograph +5BF6East Asian ideograph +5BF8East Asian ideograph +5BFAEast Asian ideograph +5C01East Asian ideograph +5C04East Asian ideograph +5C09East Asian ideograph +5C08East Asian ideograph +5C07East Asian ideograph +5C0AEast Asian ideograph +5C0BEast Asian ideograph +5C0DEast Asian ideograph +5C0EEast Asian ideograph +5C0FEast Asian ideograph +5C11East Asian ideograph +5C16East Asian ideograph +5C1AEast Asian ideograph +5C24East Asian ideograph +5C2CEast Asian ideograph +5C31East Asian ideograph +5C37East Asian ideograph +5C38East Asian ideograph +5C3AEast Asian ideograph +5C3CEast Asian ideograph +5C40East Asian ideograph +5C41East Asian ideograph +5C3FEast Asian ideograph +5C3EEast Asian ideograph +5C46East Asian ideograph +5C45East Asian ideograph +5C48East Asian ideograph +5C4EEast Asian ideograph +5C4BEast Asian ideograph +5C4DEast Asian ideograph +5C55East Asian ideograph +5C51East Asian ideograph +5C50East Asian ideograph +E9E1East Asian ideograph not in Unicode +5C60East Asian ideograph +5C5CEast Asian ideograph +5C62East Asian ideograph +E9365C64Variant of 4B3B61 which maps to 5C64 +5C65East Asian ideograph +5C6CEast Asian ideograph +5C6FEast Asian ideograph +5C71East Asian ideograph +5C79East Asian ideograph +5C90East Asian ideograph +5C8CEast Asian ideograph +5C91East Asian ideograph +5C94East Asian ideograph +5CB7East Asian ideograph +5CB8East Asian ideograph +5CA1East Asian ideograph +5CABEast Asian ideograph +5CB1East Asian ideograph +5CD9East Asian ideograph +5D01East Asian ideograph +5CFDEast Asian ideograph +5CEDEast Asian ideograph +5CFBEast Asian ideograph +5CE8East Asian ideograph +5CF0East Asian ideograph +5CF6East Asian ideograph +5CEAEast Asian ideograph +5D07East Asian ideograph +5D06East Asian ideograph +5D1BEast Asian ideograph +5D16East Asian ideograph +5D0EEast Asian ideograph +5D11East Asian ideograph +5D22East Asian ideograph +5D29East Asian ideograph +5D14East Asian ideograph +5D19East Asian ideograph +5D4CEast Asian ideograph +5D50East Asian ideograph +5D69East Asian ideograph +5D84East Asian ideograph +5D87East Asian ideograph +5D9DEast Asian ideograph +5DBCEast Asian ideograph +5DBDEast Asian ideograph +E9375DBAVariant of 4B3C2F which maps to 5DBA +5DCDEast Asian ideograph +5DD2East Asian ideograph +5DD4East Asian ideograph +5DD6East Asian ideograph +5DDDEast Asian ideograph +5DDEEast Asian ideograph +5DE2East Asian ideograph +5DE5East Asian ideograph +5DE8East Asian ideograph +5DE7East Asian ideograph +5DE6East Asian ideograph +5DEBEast Asian ideograph +5DEEEast Asian ideograph +5DF1East Asian ideograph +5DF2East Asian ideograph +5DF3East Asian ideograph +5DF4East Asian ideograph +5DF7East Asian ideograph +5DFDEast Asian ideograph +5DFEEast Asian ideograph +5E02East Asian ideograph +5E06East Asian ideograph +5E1AEast Asian ideograph +5E16East Asian ideograph +5E15East Asian ideograph +5E1BEast Asian ideograph +5E11East Asian ideograph +5E1DEast Asian ideograph +5E25East Asian ideograph +5E2BEast Asian ideograph +5E33East Asian ideograph +5E36East Asian ideograph +5E38East Asian ideograph +5E37East Asian ideograph +5E45East Asian ideograph +5E3DEast Asian ideograph +5E40East Asian ideograph +5E4CEast Asian ideograph +5E5BEast Asian ideograph +5E54East Asian ideograph +5E57East Asian ideograph +5E55East Asian ideograph +5E63East Asian ideograph +5E62East Asian ideograph +5E5FEast Asian ideograph +5E6BEast Asian ideograph +5E73East Asian ideograph +5E74East Asian ideograph +5E7BEast Asian ideograph +5E7CEast Asian ideograph +5E7DEast Asian ideograph +5E7EEast Asian ideograph +5E8FEast Asian ideograph +5E87East Asian ideograph +5E8AEast Asian ideograph +5E9AEast Asian ideograph +5E97East Asian ideograph +5E96East Asian ideograph +5E9CEast Asian ideograph +5E95East Asian ideograph +5EA0East Asian ideograph +5EA6East Asian ideograph +5EABEast Asian ideograph +5EA7East Asian ideograph +5EADEast Asian ideograph +5EB7East Asian ideograph +5EB8East Asian ideograph +5EB6East Asian ideograph +5EB5East Asian ideograph +5EC2East Asian ideograph +5EC1East Asian ideograph +5EBEEast Asian ideograph +5ECAEast Asian ideograph +5EC9East Asian ideograph +5EC8East Asian ideograph +5ED3East Asian ideograph +5ED6East Asian ideograph +5EE2East Asian ideograph +5EDAEast Asian ideograph +5EDDEast Asian ideograph +E9385EE3Variant of 4B3D2A which maps to 5EE3 +5EDFEast Asian ideograph +5EE0East Asian ideograph +9F90East Asian ideograph +5EECEast Asian ideograph +5EF3East Asian ideograph +5EF7East Asian ideograph +5EF6East Asian ideograph +5EFAEast Asian ideograph +5EFFEast Asian ideograph +5F04East Asian ideograph +5F08East Asian ideograph +5F0AEast Asian ideograph +5F0FEast Asian ideograph +5F12East Asian ideograph +5F13East Asian ideograph +5F15East Asian ideograph +5F14East Asian ideograph +5F18East Asian ideograph +5F17East Asian ideograph +5F1BEast Asian ideograph +5F1FEast Asian ideograph +5F26East Asian ideograph +5F27East Asian ideograph +5F29East Asian ideograph +5F2DEast Asian ideograph +5F31East Asian ideograph +5F35East Asian ideograph +5F37East Asian ideograph +5F3CEast Asian ideograph +5F46East Asian ideograph +5F48East Asian ideograph +5F4CEast Asian ideograph +5F4EEast Asian ideograph +5F57East Asian ideograph +5F59East Asian ideograph +5F5DEast Asian ideograph +5F62East Asian ideograph +5F64East Asian ideograph +5F65East Asian ideograph +5F6CEast Asian ideograph +5F69East Asian ideograph +5F6DEast Asian ideograph +5F70East Asian ideograph +5F71East Asian ideograph +5F79East Asian ideograph +5F80East Asian ideograph +5F7FEast Asian ideograph +5F7CEast Asian ideograph +5F85East Asian ideograph +5F88East Asian ideograph +5F8BEast Asian ideograph +5F8AEast Asian ideograph +5F87East Asian ideograph +5F8CEast Asian ideograph +5F92East Asian ideograph +5F91East Asian ideograph +5F90East Asian ideograph +5F98East Asian ideograph +5F97East Asian ideograph +5F99East Asian ideograph +5F9EEast Asian ideograph +5FA9East Asian ideograph +5FAAEast Asian ideograph +5FACEast Asian ideograph +5FAEEast Asian ideograph +5FB9East Asian ideograph +5FB7East Asian ideograph +5FB5East Asian ideograph +5FBDEast Asian ideograph +5FC3East Asian ideograph +5FC5East Asian ideograph +5FD9East Asian ideograph +5FD8East Asian ideograph +5FCCEast Asian ideograph +5FD6East Asian ideograph +5FCDEast Asian ideograph +5FEBEast Asian ideograph +5FE0East Asian ideograph +5FF1East Asian ideograph +5FFDEast Asian ideograph +5FDDEast Asian ideograph +5FF5East Asian ideograph +5FFFEast Asian ideograph +6014East Asian ideograph +E9396035Variant of 4B3E2A which maps to 6035 +602AEast Asian ideograph +602FEast Asian ideograph +6016East Asian ideograph +601DEast Asian ideograph +600FEast Asian ideograph +6021East Asian ideograph +6020East Asian ideograph +6028East Asian ideograph +6025East Asian ideograph +6027East Asian ideograph +600EEast Asian ideograph +6015East Asian ideograph +6012East Asian ideograph +6059East Asian ideograph +6063East Asian ideograph +6068East Asian ideograph +6043East Asian ideograph +6065East Asian ideograph +6050East Asian ideograph +606DEast Asian ideograph +6062East Asian ideograph +E93A6046Variant of 4B3E40 which maps to 6046 +604DEast Asian ideograph +606BEast Asian ideograph +6069East Asian ideograph +606CEast Asian ideograph +606FEast Asian ideograph +606AEast Asian ideograph +6064East Asian ideograph +6070East Asian ideograph +6055East Asian ideograph +608CEast Asian ideograph +60A6East Asian ideograph +607FEast Asian ideograph +609FEast Asian ideograph +609AEast Asian ideograph +6096East Asian ideograph +6084East Asian ideograph +608DEast Asian ideograph +60A3East Asian ideograph +6089East Asian ideograph +6094East Asian ideograph +60A0East Asian ideograph +60A8East Asian ideograph +60B4East Asian ideograph +60E6East Asian ideograph +60CBEast Asian ideograph +E93B60C5Variant of 4B3E5B which maps to 60C5 +60B6East Asian ideograph +60D1East Asian ideograph +60B5East Asian ideograph +60BBEast Asian ideograph +60E0East Asian ideograph +60E1East Asian ideograph +60DCEast Asian ideograph +60D8East Asian ideograph +60D5East Asian ideograph +60BCEast Asian ideograph +60B2East Asian ideograph +60C6East Asian ideograph +60B8East Asian ideograph +60DAEast Asian ideograph +60DFEast Asian ideograph +610FEast Asian ideograph +611CEast Asian ideograph +60F3East Asian ideograph +611FEast Asian ideograph +60F0East Asian ideograph +60FBEast Asian ideograph +60FAEast Asian ideograph +611AEast Asian ideograph +6115East Asian ideograph +60F9East Asian ideograph +6123East Asian ideograph +60F4East Asian ideograph +611BEast Asian ideograph +610EEast Asian ideograph +6100East Asian ideograph +6101East Asian ideograph +60F6East Asian ideograph +6109East Asian ideograph +6108East Asian ideograph +60F1East Asian ideograph +6148East Asian ideograph +6168East Asian ideograph +613CEast Asian ideograph +614CEast Asian ideograph +614DEast Asian ideograph +614BEast Asian ideograph +613EEast Asian ideograph +6127East Asian ideograph +6134East Asian ideograph +6147East Asian ideograph +6177East Asian ideograph +6176East Asian ideograph +6167East Asian ideograph +6170East Asian ideograph +615AEast Asian ideograph +615DEast Asian ideograph +6182East Asian ideograph +617CEast Asian ideograph +6162East Asian ideograph +616EEast Asian ideograph +6155East Asian ideograph +6158East Asian ideograph +6163East Asian ideograph +615FEast Asian ideograph +616BEast Asian ideograph +617EEast Asian ideograph +61A7East Asian ideograph +61B2East Asian ideograph +6191East Asian ideograph +618EEast Asian ideograph +61ABEast Asian ideograph +61A4East Asian ideograph +61ACEast Asian ideograph +619AEast Asian ideograph +61A9East Asian ideograph +6194East Asian ideograph +618AEast Asian ideograph +61B6East Asian ideograph +61CDEast Asian ideograph +61C9East Asian ideograph +6190East Asian ideograph +61BEEast Asian ideograph +61C2East Asian ideograph +61C7East Asian ideograph +61C8East Asian ideograph +61CAEast Asian ideograph +61E3East Asian ideograph +61E6East Asian ideograph +E93C61F2Variant of 4B3F53 which maps to 61F2 +61F7East Asian ideograph +61F6East Asian ideograph +61F8East Asian ideograph +61F5East Asian ideograph +61FAEast Asian ideograph +61FEEast Asian ideograph +61FFEast Asian ideograph +61FCEast Asian ideograph +6200East Asian ideograph +6208East Asian ideograph +620AEast Asian ideograph +620EEast Asian ideograph +620DEast Asian ideograph +620CEast Asian ideograph +6210East Asian ideograph +6212East Asian ideograph +6211East Asian ideograph +6216East Asian ideograph +6215East Asian ideograph +621BEast Asian ideograph +621AEast Asian ideograph +621FEast Asian ideograph +6221East Asian ideograph +6222East Asian ideograph +622AEast Asian ideograph +622EEast Asian ideograph +6230East Asian ideograph +6232East Asian ideograph +6234East Asian ideograph +6233East Asian ideograph +6236East Asian ideograph +623FEast Asian ideograph +623EEast Asian ideograph +6240East Asian ideograph +6241East Asian ideograph +6248East Asian ideograph +6249East Asian ideograph +624BEast Asian ideograph +6253East Asian ideograph +6254East Asian ideograph +6252East Asian ideograph +625BEast Asian ideograph +6263East Asian ideograph +6258East Asian ideograph +6296East Asian ideograph +6297East Asian ideograph +6292East Asian ideograph +6276East Asian ideograph +6289East Asian ideograph +627FEast Asian ideograph +6279East Asian ideograph +6280East Asian ideograph +628AEast Asian ideograph +626DEast Asian ideograph +627CEast Asian ideograph +627EEast Asian ideograph +626FEast Asian ideograph +6284East Asian ideograph +6295East Asian ideograph +6291East Asian ideograph +6298East Asian ideograph +626EEast Asian ideograph +6273East Asian ideograph +6293East Asian ideograph +62C9East Asian ideograph +62C4East Asian ideograph +62CCEast Asian ideograph +62A8East Asian ideograph +62DCEast Asian ideograph +62BFEast Asian ideograph +62C2East Asian ideograph +62B9East Asian ideograph +62D2East Asian ideograph +62D3East Asian ideograph +62DBEast Asian ideograph +62ABEast Asian ideograph +62CBEast Asian ideograph +62D4East Asian ideograph +62BDEast Asian ideograph +62BCEast Asian ideograph +E93D62D0Variant of 4B4049 which maps to 62D0 +62C8East Asian ideograph +62D9East Asian ideograph +62DAEast Asian ideograph +62ACEast Asian ideograph +62C7East Asian ideograph +62B1East Asian ideograph +62D6East Asian ideograph +62D8East Asian ideograph +62CDEast Asian ideograph +62B5East Asian ideograph +62CEEast Asian ideograph +62D7East Asian ideograph +62C6East Asian ideograph +6309East Asian ideograph +6316East Asian ideograph +62FCEast Asian ideograph +62F3East Asian ideograph +6308East Asian ideograph +62EDEast Asian ideograph +6301East Asian ideograph +62EEEast Asian ideograph +62EFEast Asian ideograph +62F7East Asian ideograph +6307East Asian ideograph +62F1East Asian ideograph +62FDEast Asian ideograph +6311East Asian ideograph +62ECEast Asian ideograph +E93E62F4Variant of 4B4066 which maps to 62F4 +62FFEast Asian ideograph +6342East Asian ideograph +632AEast Asian ideograph +6355East Asian ideograph +633EEast Asian ideograph +632FEast Asian ideograph +634EEast Asian ideograph +634FEast Asian ideograph +6350East Asian ideograph +6349East Asian ideograph +632BEast Asian ideograph +6328East Asian ideograph +633AEast Asian ideograph +63A5East Asian ideograph +6369East Asian ideograph +63A0East Asian ideograph +6396East Asian ideograph +63A7East Asian ideograph +6372East Asian ideograph +6377East Asian ideograph +6383East Asian ideograph +636BEast Asian ideograph +6367East Asian ideograph +6398East Asian ideograph +639BEast Asian ideograph +63AAEast Asian ideograph +6371East Asian ideograph +63A9East Asian ideograph +638CEast Asian ideograph +6389East Asian ideograph +63A2East Asian ideograph +6399East Asian ideograph +63A1East Asian ideograph +6388East Asian ideograph +63ACEast Asian ideograph +633DEast Asian ideograph +6392East Asian ideograph +63A3East Asian ideograph +6376East Asian ideograph +638FEast Asian ideograph +63A8East Asian ideograph +637BEast Asian ideograph +E93F6368Variant of 4B4135 which maps to 6368 +6384East Asian ideograph +6380East Asian ideograph +63C6East Asian ideograph +63C9East Asian ideograph +63CDEast Asian ideograph +63E1East Asian ideograph +63C0East Asian ideograph +63E9East Asian ideograph +63D0East Asian ideograph +63DAEast Asian ideograph +63D6East Asian ideograph +63EDEast Asian ideograph +63EEEast Asian ideograph +63CFEast Asian ideograph +63E3East Asian ideograph +63F4East Asian ideograph +E94063DBVariant of 454146 which maps to 63DB +63D2East Asian ideograph +63EAEast Asian ideograph +641EEast Asian ideograph +642AEast Asian ideograph +643EEast Asian ideograph +6413East Asian ideograph +640FEast Asian ideograph +6414East Asian ideograph +640DEast Asian ideograph +642DEast Asian ideograph +643DEast Asian ideograph +6416East Asian ideograph +6417East Asian ideograph +641CEast Asian ideograph +6436East Asian ideograph +642CEast Asian ideograph +6458East Asian ideograph +6469East Asian ideograph +6454East Asian ideograph +6452East Asian ideograph +646FEast Asian ideograph +6478East Asian ideograph +6479East Asian ideograph +647AEast Asian ideograph +645FEast Asian ideograph +6451East Asian ideograph +6467East Asian ideograph +649EEast Asian ideograph +64A4East Asian ideograph +6487East Asian ideograph +6488East Asian ideograph +64A5East Asian ideograph +64B0East Asian ideograph +6493East Asian ideograph +6495East Asian ideograph +6492East Asian ideograph +64A9East Asian ideograph +6491East Asian ideograph +64AEEast Asian ideograph +64B2East Asian ideograph +64ADEast Asian ideograph +649AEast Asian ideograph +64ABEast Asian ideograph +64ACEast Asian ideograph +64C5East Asian ideograph +64C1East Asian ideograph +64D8East Asian ideograph +64CAEast Asian ideograph +64BBEast Asian ideograph +64C2East Asian ideograph +64BCEast Asian ideograph +64CBEast Asian ideograph +64CDEast Asian ideograph +64DAEast Asian ideograph +64C4East Asian ideograph +64C7East Asian ideograph +64CEEast Asian ideograph +64D4East Asian ideograph +64D2East Asian ideograph +64BFEast Asian ideograph +64E0East Asian ideograph +64F0East Asian ideograph +64E6East Asian ideograph +64ECEast Asian ideograph +64F1East Asian ideograph +64F4East Asian ideograph +64F2East Asian ideograph +6506East Asian ideograph +6500East Asian ideograph +64FEEast Asian ideograph +64FBEast Asian ideograph +64FAEast Asian ideograph +650FEast Asian ideograph +6518East Asian ideograph +6514East Asian ideograph +6519East Asian ideograph +651DEast Asian ideograph +651CEast Asian ideograph +6523East Asian ideograph +6524East Asian ideograph +652BEast Asian ideograph +652AEast Asian ideograph +652CEast Asian ideograph +652FEast Asian ideograph +6536East Asian ideograph +6539East Asian ideograph +653BEast Asian ideograph +653EEast Asian ideograph +653FEast Asian ideograph +6545East Asian ideograph +6548East Asian ideograph +654EEast Asian ideograph +6556East Asian ideograph +6551East Asian ideograph +6557East Asian ideograph +655DEast Asian ideograph +6558East Asian ideograph +654FEast Asian ideograph +6566East Asian ideograph +6562East Asian ideograph +6563East Asian ideograph +655EEast Asian ideograph +5553East Asian ideograph +656CEast Asian ideograph +6572East Asian ideograph +6575East Asian ideograph +6577East Asian ideograph +6578East Asian ideograph +6574East Asian ideograph +6582East Asian ideograph +6583East Asian ideograph +6587East Asian ideograph +6591East Asian ideograph +6590East Asian ideograph +6599East Asian ideograph +659CEast Asian ideograph +659FEast Asian ideograph +65A1East Asian ideograph +65A4East Asian ideograph +65A5East Asian ideograph +65A7East Asian ideograph +65ACEast Asian ideograph +65AFEast Asian ideograph +65B0East Asian ideograph +65B7East Asian ideograph +65B9East Asian ideograph +65BDEast Asian ideograph +65C1East Asian ideograph +65C5East Asian ideograph +65CEEast Asian ideograph +65CBEast Asian ideograph +65CCEast Asian ideograph +65CFEast Asian ideograph +65D7East Asian ideograph +65D6East Asian ideograph +65E2East Asian ideograph +65E5East Asian ideograph +65E9East Asian ideograph +65ECEast Asian ideograph +65EDEast Asian ideograph +65E8East Asian ideograph +65F1East Asian ideograph +65FAEast Asian ideograph +6606East Asian ideograph +6614East Asian ideograph +660CEast Asian ideograph +6600East Asian ideograph +660EEast Asian ideograph +6613East Asian ideograph +6602East Asian ideograph +660FEast Asian ideograph +6625East Asian ideograph +6627East Asian ideograph +662FEast Asian ideograph +662DEast Asian ideograph +6620East Asian ideograph +661FEast Asian ideograph +6628East Asian ideograph +664FEast Asian ideograph +6642East Asian ideograph +6652East Asian ideograph +6649East Asian ideograph +6643East Asian ideograph +664CEast Asian ideograph +665DEast Asian ideograph +6664East Asian ideograph +6668East Asian ideograph +6666East Asian ideograph +665AEast Asian ideograph +666FEast Asian ideograph +666EEast Asian ideograph +FA12East Asian ideograph +6691East Asian ideograph +6670East Asian ideograph +6676East Asian ideograph +667AEast Asian ideograph +6697East Asian ideograph +6687East Asian ideograph +6689East Asian ideograph +6688East Asian ideograph +6696East Asian ideograph +66A2East Asian ideograph +66ABEast Asian ideograph +66B4East Asian ideograph +66AEEast Asian ideograph +66C1East Asian ideograph +66C9East Asian ideograph +66C6East Asian ideograph +66B9East Asian ideograph +66D6East Asian ideograph +66D9East Asian ideograph +66E0East Asian ideograph +66DDEast Asian ideograph +66E6East Asian ideograph +66F0East Asian ideograph +66F2East Asian ideograph +66F3East Asian ideograph +66F4East Asian ideograph +66F7East Asian ideograph +66F8East Asian ideograph +66F9East Asian ideograph +52D7East Asian ideograph +66FEEast Asian ideograph +66FFEast Asian ideograph +6703East Asian ideograph +6708East Asian ideograph +6709East Asian ideograph +670DEast Asian ideograph +670BEast Asian ideograph +6717East Asian ideograph +6715East Asian ideograph +6714East Asian ideograph +671BEast Asian ideograph +671DEast Asian ideograph +671FEast Asian ideograph +6727East Asian ideograph +6728East Asian ideograph +672CEast Asian ideograph +672BEast Asian ideograph +672AEast Asian ideograph +673DEast Asian ideograph +6731East Asian ideograph +6735East Asian ideograph +675EEast Asian ideograph +6751East Asian ideograph +674EEast Asian ideograph +675CEast Asian ideograph +6750East Asian ideograph +6756East Asian ideograph +675FEast Asian ideograph +674FEast Asian ideograph +6749East Asian ideograph +676DEast Asian ideograph +678BEast Asian ideograph +6795East Asian ideograph +6789East Asian ideograph +6787East Asian ideograph +6777East Asian ideograph +679DEast Asian ideograph +6797East Asian ideograph +676FEast Asian ideograph +6771East Asian ideograph +6773East Asian ideograph +679CEast Asian ideograph +6775East Asian ideograph +679AEast Asian ideograph +6790East Asian ideograph +677EEast Asian ideograph +67D3East Asian ideograph +67F1East Asian ideograph +67FFEast Asian ideograph +67D4East Asian ideograph +67C4East Asian ideograph +67AFEast Asian ideograph +67D0East Asian ideograph +67D1East Asian ideograph +67EFEast Asian ideograph +67E9East Asian ideograph +67B6East Asian ideograph +67ECEast Asian ideograph +67E5East Asian ideograph +67FAEast Asian ideograph +67DAEast Asian ideograph +6805East Asian ideograph +67DEEast Asian ideograph +67B8East Asian ideograph +67CFEast Asian ideograph +67F3East Asian ideograph +6848East Asian ideograph +6821East Asian ideograph +6838East Asian ideograph +6853East Asian ideograph +6846East Asian ideograph +6842East Asian ideograph +6854East Asian ideograph +6817East Asian ideograph +683DEast Asian ideograph +6851East Asian ideograph +6829East Asian ideograph +6850East Asian ideograph +6839East Asian ideograph +67F4East Asian ideograph +6843East Asian ideograph +6840East Asian ideograph +682AEast Asian ideograph +6845East Asian ideograph +683CEast Asian ideograph +E9416813Variant of 4B4456 which maps to 6813 +6881East Asian ideograph +6893East Asian ideograph +68AFEast Asian ideograph +6876East Asian ideograph +68B0East Asian ideograph +68A7East Asian ideograph +6897East Asian ideograph +68B5East Asian ideograph +68B3East Asian ideograph +68A2East Asian ideograph +687FEast Asian ideograph +68B1East Asian ideograph +689DEast Asian ideograph +68ADEast Asian ideograph +6886East Asian ideograph +6885East Asian ideograph +68A8East Asian ideograph +689FEast Asian ideograph +6894East Asian ideograph +6883East Asian ideograph +68D5East Asian ideograph +68FAEast Asian ideograph +68C4East Asian ideograph +68F2East Asian ideograph +68D2East Asian ideograph +68E3East Asian ideograph +68DFEast Asian ideograph +68CBEast Asian ideograph +68EEEast Asian ideograph +690DEast Asian ideograph +6905East Asian ideograph +68E7East Asian ideograph +68E0East Asian ideograph +68F5East Asian ideograph +68CDEast Asian ideograph +68D7East Asian ideograph +68D8East Asian ideograph +6912East Asian ideograph +68F9East Asian ideograph +68DAEast Asian ideograph +690EEast Asian ideograph +68C9East Asian ideograph +6954East Asian ideograph +6930East Asian ideograph +6977East Asian ideograph +6975East Asian ideograph +695AEast Asian ideograph +6960East Asian ideograph +696BEast Asian ideograph +694AEast Asian ideograph +6968East Asian ideograph +695EEast Asian ideograph +696DEast Asian ideograph +6979East Asian ideograph +6953East Asian ideograph +6986East Asian ideograph +69A8East Asian ideograph +6995East Asian ideograph +699CEast Asian ideograph +6994East Asian ideograph +69C1East Asian ideograph +69B7East Asian ideograph +69AEEast Asian ideograph +699BEast Asian ideograph +69CBEast Asian ideograph +69D3East Asian ideograph +69BBEast Asian ideograph +69ABEast Asian ideograph +69CCEast Asian ideograph +69ADEast Asian ideograph +69D0East Asian ideograph +69CDEast Asian ideograph +69B4East Asian ideograph +6A1FEast Asian ideograph +69E8East Asian ideograph +6A23East Asian ideograph +69EAEast Asian ideograph +6A01East Asian ideograph +6A19East Asian ideograph +69FDEast Asian ideograph +6A1EEast Asian ideograph +6A13East Asian ideograph +6A21East Asian ideograph +69F3East Asian ideograph +6A0AEast Asian ideograph +6A02East Asian ideograph +6A05East Asian ideograph +6A3DEast Asian ideograph +6A58East Asian ideograph +6A59East Asian ideograph +6A62East Asian ideograph +6A44East Asian ideograph +6A39East Asian ideograph +6A6BEast Asian ideograph +6A3AEast Asian ideograph +6A38East Asian ideograph +6A47East Asian ideograph +6A61East Asian ideograph +6A4BEast Asian ideograph +6A35East Asian ideograph +6A5FEast Asian ideograph +6A80East Asian ideograph +6A94East Asian ideograph +6A84East Asian ideograph +6AA2East Asian ideograph +6A9CEast Asian ideograph +6AB8East Asian ideograph +6AB3East Asian ideograph +6AC3East Asian ideograph +6ABBEast Asian ideograph +6AACEast Asian ideograph +6AE5East Asian ideograph +6ADAEast Asian ideograph +6ADDEast Asian ideograph +6ADBEast Asian ideograph +6AD3East Asian ideograph +6B04East Asian ideograph +6AFBEast Asian ideograph +6B0AEast Asian ideograph +6B16East Asian ideograph +6B21East Asian ideograph +6B23East Asian ideograph +6B3EEast Asian ideograph +6B3AEast Asian ideograph +6B3DEast Asian ideograph +6B47East Asian ideograph +6B49East Asian ideograph +6B4CEast Asian ideograph +6B50East Asian ideograph +6B59East Asian ideograph +6B5FEast Asian ideograph +6B61East Asian ideograph +6B63East Asian ideograph +6B64East Asian ideograph +6B65East Asian ideograph +6B66East Asian ideograph +6B6AEast Asian ideograph +6B72East Asian ideograph +6B77East Asian ideograph +6B78East Asian ideograph +6B79East Asian ideograph +6B7BEast Asian ideograph +6B7FEast Asian ideograph +6B83East Asian ideograph +6B86East Asian ideograph +6B8AEast Asian ideograph +6B89East Asian ideograph +6B98East Asian ideograph +6B96East Asian ideograph +6BA4East Asian ideograph +6BAEEast Asian ideograph +6BAFEast Asian ideograph +6BB2East Asian ideograph +6BB5East Asian ideograph +6BB7East Asian ideograph +6BBAEast Asian ideograph +6BBCEast Asian ideograph +6BC0East Asian ideograph +6BBFEast Asian ideograph +6BC5East Asian ideograph +6BC6East Asian ideograph +6BCBEast Asian ideograph +6BCDEast Asian ideograph +6BCFEast Asian ideograph +6BD2East Asian ideograph +6BD4East Asian ideograph +6BD7East Asian ideograph +6BDBEast Asian ideograph +6BEBEast Asian ideograph +6BEFEast Asian ideograph +6BFDEast Asian ideograph +6C0FEast Asian ideograph +6C11East Asian ideograph +6C10East Asian ideograph +6C13East Asian ideograph +6C16East Asian ideograph +6C1BEast Asian ideograph +6C1FEast Asian ideograph +6C27East Asian ideograph +6C26East Asian ideograph +6C23East Asian ideograph +6C28East Asian ideograph +6C24East Asian ideograph +6C2BEast Asian ideograph +6C2EEast Asian ideograph +6C33East Asian ideograph +E9426C2FVariant of 45465B which maps to 6C2F +6C34East Asian ideograph +6C38East Asian ideograph +6C41East Asian ideograph +6C40East Asian ideograph +6C42East Asian ideograph +6C5EEast Asian ideograph +6C57East Asian ideograph +6C5FEast Asian ideograph +6C59East Asian ideograph +6C60East Asian ideograph +6C55East Asian ideograph +6C50East Asian ideograph +6C5DEast Asian ideograph +6C9BEast Asian ideograph +6C81East Asian ideograph +6C7AEast Asian ideograph +6C6AEast Asian ideograph +6C8CEast Asian ideograph +6C90East Asian ideograph +6C72East Asian ideograph +6C70East Asian ideograph +6C68East Asian ideograph +6C96East Asian ideograph +E9436C89Variant of 4B4676 which maps to 6C89 +6C99East Asian ideograph +6C7EEast Asian ideograph +6C7DEast Asian ideograph +6C92East Asian ideograph +6C83East Asian ideograph +6CB1East Asian ideograph +6CF3East Asian ideograph +6CE3East Asian ideograph +6CF0East Asian ideograph +6CB8East Asian ideograph +6CD3East Asian ideograph +6CABEast Asian ideograph +6CE5East Asian ideograph +6CBDEast Asian ideograph +6CB3East Asian ideograph +6CC4East Asian ideograph +6CD5East Asian ideograph +6CE2East Asian ideograph +6CBCEast Asian ideograph +6CAEEast Asian ideograph +6CB9East Asian ideograph +6CF1East Asian ideograph +6CC1East Asian ideograph +6CBEEast Asian ideograph +6CC5East Asian ideograph +6CD7East Asian ideograph +6CBBEast Asian ideograph +6CDBEast Asian ideograph +6CE1East Asian ideograph +6CBFEast Asian ideograph +6CCAEast Asian ideograph +6CCCEast Asian ideograph +6CC9East Asian ideograph +6D41East Asian ideograph +6D0BEast Asian ideograph +6D32East Asian ideograph +6D25East Asian ideograph +6D31East Asian ideograph +6D2AEast Asian ideograph +6D0CEast Asian ideograph +6D1EEast Asian ideograph +6D17East Asian ideograph +6D3BEast Asian ideograph +6D1BEast Asian ideograph +6D36East Asian ideograph +6D3DEast Asian ideograph +6D3EEast Asian ideograph +6D6AEast Asian ideograph +6D95East Asian ideograph +6D78East Asian ideograph +6D66East Asian ideograph +6D59East Asian ideograph +6D87East Asian ideograph +6D88East Asian ideograph +6D6CEast Asian ideograph +6D93East Asian ideograph +6D89East Asian ideograph +6D6EEast Asian ideograph +6D74East Asian ideograph +6D5AEast Asian ideograph +6D69East Asian ideograph +6D77East Asian ideograph +6DD9East Asian ideograph +6DDAEast Asian ideograph +6DF3East Asian ideograph +6DBCEast Asian ideograph +6DE4East Asian ideograph +6DB2East Asian ideograph +6DE1East Asian ideograph +6DD2East Asian ideograph +6DAEEast Asian ideograph +6DF8East Asian ideograph +6DC7East Asian ideograph +6DCBEast Asian ideograph +6DC5East Asian ideograph +6DDEEast Asian ideograph +6DAFEast Asian ideograph +6DB5East Asian ideograph +6DFAEast Asian ideograph +6DF9East Asian ideograph +6DCCEast Asian ideograph +6DF7East Asian ideograph +6DB8East Asian ideograph +6DD1East Asian ideograph +6DF1East Asian ideograph +6DE8East Asian ideograph +6DEBEast Asian ideograph +6DD8East Asian ideograph +6DFBEast Asian ideograph +6DEEEast Asian ideograph +6DF5East Asian ideograph +6D8EEast Asian ideograph +6DC6East Asian ideograph +6DEAEast Asian ideograph +6DC4East Asian ideograph +6E54East Asian ideograph +6E21East Asian ideograph +6E38East Asian ideograph +6E32East Asian ideograph +6E67East Asian ideograph +6E20East Asian ideograph +6E5BEast Asian ideograph +6E1AEast Asian ideograph +6E56East Asian ideograph +6E2FEast Asian ideograph +6E6EEast Asian ideograph +6E58East Asian ideograph +6E23East Asian ideograph +6E24East Asian ideograph +6E1BEast Asian ideograph +6E25East Asian ideograph +6E4AEast Asian ideograph +6E3AEast Asian ideograph +6E6FEast Asian ideograph +6E2DEast Asian ideograph +6E34East Asian ideograph +6E2CEast Asian ideograph +6E26East Asian ideograph +6E4DEast Asian ideograph +6E3EEast Asian ideograph +6E43East Asian ideograph +6E19East Asian ideograph +6E1DEast Asian ideograph +6ED3East Asian ideograph +6EB6East Asian ideograph +6EC2East Asian ideograph +6EAFEast Asian ideograph +6EA2East Asian ideograph +6E9DEast Asian ideograph +6EA5East Asian ideograph +6E98East Asian ideograph +6E90East Asian ideograph +6EC5East Asian ideograph +6EC7East Asian ideograph +6EBCEast Asian ideograph +6EABEast Asian ideograph +6ED1East Asian ideograph +6ECBEast Asian ideograph +6EC4East Asian ideograph +6ED4East Asian ideograph +6EAAEast Asian ideograph +6E96East Asian ideograph +6E9CEast Asian ideograph +6F33East Asian ideograph +6EF4East Asian ideograph +6EECEast Asian ideograph +6EFEEast Asian ideograph +6F29East Asian ideograph +6F14East Asian ideograph +6F3EEast Asian ideograph +6F2CEast Asian ideograph +6F32East Asian ideograph +6F0FEast Asian ideograph +E9446F22Variant of 4B4857 which maps to 6F22 +6EFFEast Asian ideograph +6F23East Asian ideograph +6F38East Asian ideograph +6F15East Asian ideograph +6F31East Asian ideograph +6F02East Asian ideograph +6F06East Asian ideograph +6EEFEast Asian ideograph +6F2BEast Asian ideograph +6F2FEast Asian ideograph +6F20East Asian ideograph +6F3FEast Asian ideograph +6EF2East Asian ideograph +6F01East Asian ideograph +6F11East Asian ideograph +6ECCEast Asian ideograph +6F2AEast Asian ideograph +6F7CEast Asian ideograph +6F88East Asian ideograph +6F84East Asian ideograph +6F51East Asian ideograph +6F64East Asian ideograph +6F97East Asian ideograph +6F54East Asian ideograph +6F7AEast Asian ideograph +6F86East Asian ideograph +6F8EEast Asian ideograph +6F6DEast Asian ideograph +6F5BEast Asian ideograph +6F6EEast Asian ideograph +6F78East Asian ideograph +6F66East Asian ideograph +6F70East Asian ideograph +6F58East Asian ideograph +6FC2East Asian ideograph +6FB1East Asian ideograph +6FC3East Asian ideograph +6FA7East Asian ideograph +6FA1East Asian ideograph +6FA4East Asian ideograph +6FC1East Asian ideograph +6FC0East Asian ideograph +6FB3East Asian ideograph +6FDFEast Asian ideograph +6FD8East Asian ideograph +6FF1East Asian ideograph +6FE0East Asian ideograph +6FEFEast Asian ideograph +E9456FEBVariant of 4B492B which maps to 6FEB +6FE1East Asian ideograph +6FE4East Asian ideograph +6F80East Asian ideograph +700BEast Asian ideograph +7009East Asian ideograph +7006East Asian ideograph +6FFAEast Asian ideograph +7011East Asian ideograph +6FFEEast Asian ideograph +700FEast Asian ideograph +701BEast Asian ideograph +701AEast Asian ideograph +7028East Asian ideograph +701DEast Asian ideograph +7015East Asian ideograph +701FEast Asian ideograph +703EEast Asian ideograph +704CEast Asian ideograph +7051East Asian ideograph +7058East Asian ideograph +7063East Asian ideograph +7064East Asian ideograph +706BEast Asian ideograph +7070East Asian ideograph +7076East Asian ideograph +707CEast Asian ideograph +7078East Asian ideograph +707DEast Asian ideograph +7095East Asian ideograph +708EEast Asian ideograph +7092East Asian ideograph +7099East Asian ideograph +708AEast Asian ideograph +70ABEast Asian ideograph +70BAEast Asian ideograph +70ACEast Asian ideograph +70B3East Asian ideograph +70AFEast Asian ideograph +70ADEast Asian ideograph +70AEEast Asian ideograph +70B8East Asian ideograph +70CAEast Asian ideograph +70E4East Asian ideograph +70D8East Asian ideograph +70C8East Asian ideograph +70D9East Asian ideograph +70CFEast Asian ideograph +70F9East Asian ideograph +7109East Asian ideograph +710AEast Asian ideograph +70FDEast Asian ideograph +7119East Asian ideograph +716EEast Asian ideograph +711AEast Asian ideograph +7136East Asian ideograph +7121East Asian ideograph +7130East Asian ideograph +7126East Asian ideograph +714EEast Asian ideograph +7149East Asian ideograph +7159East Asian ideograph +7164East Asian ideograph +7169East Asian ideograph +715CEast Asian ideograph +716CEast Asian ideograph +7166East Asian ideograph +7167East Asian ideograph +715EEast Asian ideograph +7165East Asian ideograph +714CEast Asian ideograph +717DEast Asian ideograph +7199East Asian ideograph +718AEast Asian ideograph +7184East Asian ideograph +719FEast Asian ideograph +71A8East Asian ideograph +71ACEast Asian ideograph +71B1East Asian ideograph +71D9East Asian ideograph +71BEEast Asian ideograph +71C9East Asian ideograph +71D0East Asian ideograph +71C8East Asian ideograph +71DCEast Asian ideograph +71D2East Asian ideograph +71B9East Asian ideograph +71D5East Asian ideograph +71CEEast Asian ideograph +71C3East Asian ideograph +71C4East Asian ideograph +71EEEast Asian ideograph +71E7East Asian ideograph +71DFEast Asian ideograph +71E5East Asian ideograph +71EDEast Asian ideograph +71E6East Asian ideograph +71ECEast Asian ideograph +71F4East Asian ideograph +71FBEast Asian ideograph +7206East Asian ideograph +720DEast Asian ideograph +7210East Asian ideograph +721BEast Asian ideograph +7228East Asian ideograph +722AEast Asian ideograph +722DEast Asian ideograph +722CEast Asian ideograph +7230East Asian ideograph +E9467235Variant of 4B4A3E which maps to 7235 +7236East Asian ideograph +7238East Asian ideograph +7239East Asian ideograph +723AEast Asian ideograph +723BEast Asian ideograph +723DEast Asian ideograph +723EEast Asian ideograph +7246East Asian ideograph +7247East Asian ideograph +7248East Asian ideograph +724CEast Asian ideograph +7252East Asian ideograph +7256East Asian ideograph +7258East Asian ideograph +7259East Asian ideograph +725BEast Asian ideograph +725FEast Asian ideograph +725DEast Asian ideograph +7262East Asian ideograph +7261East Asian ideograph +7260East Asian ideograph +7267East Asian ideograph +7269East Asian ideograph +726FEast Asian ideograph +7272East Asian ideograph +7274East Asian ideograph +7279East Asian ideograph +727DEast Asian ideograph +7281East Asian ideograph +7280East Asian ideograph +7284East Asian ideograph +7296East Asian ideograph +7292East Asian ideograph +729BEast Asian ideograph +72A2East Asian ideograph +72A7East Asian ideograph +72ACEast Asian ideograph +72AFEast Asian ideograph +72C4East Asian ideograph +72C2East Asian ideograph +72D9East Asian ideograph +72C0East Asian ideograph +72CEEast Asian ideograph +72D7East Asian ideograph +72D0East Asian ideograph +72E1East Asian ideograph +72E9East Asian ideograph +72E0East Asian ideograph +72FCEast Asian ideograph +72F9East Asian ideograph +72FDEast Asian ideograph +72F7East Asian ideograph +731CEast Asian ideograph +731BEast Asian ideograph +7313East Asian ideograph +7316East Asian ideograph +7319East Asian ideograph +7336East Asian ideograph +7337East Asian ideograph +7329East Asian ideograph +7325East Asian ideograph +7334East Asian ideograph +7344East Asian ideograph +733FEast Asian ideograph +733EEast Asian ideograph +7345East Asian ideograph +7350East Asian ideograph +7357East Asian ideograph +7368East Asian ideograph +7370East Asian ideograph +7372East Asian ideograph +7377East Asian ideograph +7378East Asian ideograph +7375East Asian ideograph +737AEast Asian ideograph +737BEast Asian ideograph +7380East Asian ideograph +7384East Asian ideograph +7387East Asian ideograph +7389East Asian ideograph +738BEast Asian ideograph +7396East Asian ideograph +739FEast Asian ideograph +73A8East Asian ideograph +73A9East Asian ideograph +73ABEast Asian ideograph +73BBEast Asian ideograph +73CAEast Asian ideograph +73B7East Asian ideograph +73C0East Asian ideograph +73B2East Asian ideograph +73CDEast Asian ideograph +73EDEast Asian ideograph +73EEEast Asian ideograph +73E0East Asian ideograph +7405East Asian ideograph +7409East Asian ideograph +7403East Asian ideograph +740AEast Asian ideograph +73FEEast Asian ideograph +7406East Asian ideograph +740DEast Asian ideograph +743AEast Asian ideograph +7435East Asian ideograph +7436East Asian ideograph +7434East Asian ideograph +742AEast Asian ideograph +7433East Asian ideograph +7422East Asian ideograph +7425East Asian ideograph +7455East Asian ideograph +745FEast Asian ideograph +745AEast Asian ideograph +7441East Asian ideograph +743FEast Asian ideograph +745BEast Asian ideograph +745EEast Asian ideograph +745CEast Asian ideograph +7459East Asian ideograph +7483East Asian ideograph +7469East Asian ideograph +746AEast Asian ideograph +7463East Asian ideograph +7464East Asian ideograph +7470East Asian ideograph +748BEast Asian ideograph +E947749CVariant of 4B4B63 which maps to 749C +74A3East Asian ideograph +74A7East Asian ideograph +74A9East Asian ideograph +74B0East Asian ideograph +74A6East Asian ideograph +74BDEast Asian ideograph +74CAEast Asian ideograph +74CFEast Asian ideograph +74DCEast Asian ideograph +74E0East Asian ideograph +74E2East Asian ideograph +74E3East Asian ideograph +74E6East Asian ideograph +74F6East Asian ideograph +74F7East Asian ideograph +7504East Asian ideograph +750CEast Asian ideograph +7515East Asian ideograph +7518East Asian ideograph +751AEast Asian ideograph +751CEast Asian ideograph +751FEast Asian ideograph +7522East Asian ideograph +7526East Asian ideograph +7525East Asian ideograph +7528East Asian ideograph +7529East Asian ideograph +752CEast Asian ideograph +752BEast Asian ideograph +752DEast Asian ideograph +7530East Asian ideograph +7532East Asian ideograph +7531East Asian ideograph +7533East Asian ideograph +7537East Asian ideograph +7538East Asian ideograph +753DEast Asian ideograph +754FEast Asian ideograph +754CEast Asian ideograph +755DEast Asian ideograph +755CEast Asian ideograph +7554East Asian ideograph +755AEast Asian ideograph +7559East Asian ideograph +7566East Asian ideograph +7562East Asian ideograph +7570East Asian ideograph +7565East Asian ideograph +756BEast Asian ideograph +756AEast Asian ideograph +7578East Asian ideograph +7576East Asian ideograph +7586East Asian ideograph +7587East Asian ideograph +758AEast Asian ideograph +758FEast Asian ideograph +7591East Asian ideograph +759DEast Asian ideograph +7599East Asian ideograph +759AEast Asian ideograph +75A4East Asian ideograph +75ABEast Asian ideograph +75A5East Asian ideograph +75C7East Asian ideograph +75C5East Asian ideograph +75B3East Asian ideograph +75B2East Asian ideograph +75BDEast Asian ideograph +75BEEast Asian ideograph +75BCEast Asian ideograph +75B9East Asian ideograph +75D5East Asian ideograph +75D4East Asian ideograph +75B5East Asian ideograph +E94875CAVariant of 4B4C51 which maps to 75CA +75DBEast Asian ideograph +75E3East Asian ideograph +75D8East Asian ideograph +75DEEast Asian ideograph +75D9East Asian ideograph +75E2East Asian ideograph +7601East Asian ideograph +7600East Asian ideograph +75F0East Asian ideograph +75F2East Asian ideograph +75F1East Asian ideograph +75F4East Asian ideograph +75FFEast Asian ideograph +75FAEast Asian ideograph +760DEast Asian ideograph +7627East Asian ideograph +7613East Asian ideograph +760BEast Asian ideograph +7620East Asian ideograph +7629East Asian ideograph +761FEast Asian ideograph +7624East Asian ideograph +7626East Asian ideograph +7621East Asian ideograph +7634East Asian ideograph +7638East Asian ideograph +7646East Asian ideograph +7642East Asian ideograph +764CEast Asian ideograph +7656East Asian ideograph +7658East Asian ideograph +7662East Asian ideograph +7665East Asian ideograph +7669East Asian ideograph +766EEast Asian ideograph +766CEast Asian ideograph +7671East Asian ideograph +E9497672Variant of 4B4C79 which maps to 7672 +7678East Asian ideograph +767CEast Asian ideograph +767BEast Asian ideograph +767DEast Asian ideograph +767EEast Asian ideograph +7682East Asian ideograph +7684East Asian ideograph +7687East Asian ideograph +7686East Asian ideograph +768EEast Asian ideograph +7696East Asian ideograph +7693East Asian ideograph +769AEast Asian ideograph +76AEEast Asian ideograph +76B0East Asian ideograph +76B4East Asian ideograph +76BAEast Asian ideograph +76BFEast Asian ideograph +76C2East Asian ideograph +76C8East Asian ideograph +76C6East Asian ideograph +76CAEast Asian ideograph +76CDEast Asian ideograph +76CEEast Asian ideograph +76D4East Asian ideograph +76D2East Asian ideograph +76DCEast Asian ideograph +76DBEast Asian ideograph +76DEEast Asian ideograph +76DFEast Asian ideograph +76E1East Asian ideograph +76E3East Asian ideograph +76E4East Asian ideograph +76E7East Asian ideograph +76E5East Asian ideograph +76EAEast Asian ideograph +76EEEast Asian ideograph +76EFEast Asian ideograph +76F2East Asian ideograph +76F4East Asian ideograph +7709East Asian ideograph +76F9East Asian ideograph +76F8East Asian ideograph +7701East Asian ideograph +770BEast Asian ideograph +76FCEast Asian ideograph +76FEEast Asian ideograph +7729East Asian ideograph +7720East Asian ideograph +771EEast Asian ideograph +7728East Asian ideograph +7737East Asian ideograph +773CEast Asian ideograph +7736East Asian ideograph +7738East Asian ideograph +773AEast Asian ideograph +773EEast Asian ideograph +774FEast Asian ideograph +776BEast Asian ideograph +775BEast Asian ideograph +776AEast Asian ideograph +7766East Asian ideograph +7779East Asian ideograph +775EEast Asian ideograph +7763East Asian ideograph +775CEast Asian ideograph +776CEast Asian ideograph +7768East Asian ideograph +7765East Asian ideograph +777DEast Asian ideograph +7771East Asian ideograph +777FEast Asian ideograph +7784East Asian ideograph +7761East Asian ideograph +7787East Asian ideograph +778EEast Asian ideograph +778CEast Asian ideograph +7791East Asian ideograph +779FEast Asian ideograph +779EEast Asian ideograph +77A0East Asian ideograph +77A5East Asian ideograph +77B3East Asian ideograph +77AAEast Asian ideograph +77B0East Asian ideograph +77ADEast Asian ideograph +77ACEast Asian ideograph +77A7East Asian ideograph +77BDEast Asian ideograph +77BFEast Asian ideograph +77BBEast Asian ideograph +77D3East Asian ideograph +77D7East Asian ideograph +77DAEast Asian ideograph +77DBEast Asian ideograph +77DCEast Asian ideograph +77E2East Asian ideograph +77E3East Asian ideograph +77E5East Asian ideograph +77E9East Asian ideograph +77EDEast Asian ideograph +77EEEast Asian ideograph +77EFEast Asian ideograph +77F3East Asian ideograph +77FDEast Asian ideograph +7802East Asian ideograph +780DEast Asian ideograph +780CEast Asian ideograph +65ABEast Asian ideograph +7830East Asian ideograph +781DEast Asian ideograph +7834East Asian ideograph +7838East Asian ideograph +7837East Asian ideograph +7827East Asian ideograph +782DEast Asian ideograph +7825East Asian ideograph +786BEast Asian ideograph +784FEast Asian ideograph +7843East Asian ideograph +786CEast Asian ideograph +785DEast Asian ideograph +786FEast Asian ideograph +78B0East Asian ideograph +7897East Asian ideograph +788EEast Asian ideograph +7898East Asian ideograph +7889East Asian ideograph +7891East Asian ideograph +787CEast Asian ideograph +788CEast Asian ideograph +78A7East Asian ideograph +78A9East Asian ideograph +789FEast Asian ideograph +78B3East Asian ideograph +78CBEast Asian ideograph +78BAEast Asian ideograph +78C1East Asian ideograph +78C5East Asian ideograph +78BCEast Asian ideograph +78D5East Asian ideograph +78BEEast Asian ideograph +78CAEast Asian ideograph +78D0East Asian ideograph +78E8East Asian ideograph +78ECEast Asian ideograph +78DAEast Asian ideograph +78F7East Asian ideograph +78F4East Asian ideograph +E94A78FAVariant of 4B4E56 which maps to 78FA +7901East Asian ideograph +78EFEast Asian ideograph +790EEast Asian ideograph +7919East Asian ideograph +7926East Asian ideograph +792CEast Asian ideograph +792AEast Asian ideograph +792BEast Asian ideograph +793AEast Asian ideograph +7940East Asian ideograph +793EEast Asian ideograph +7941East Asian ideograph +7945East Asian ideograph +7949East Asian ideograph +7948East Asian ideograph +7947East Asian ideograph +7955East Asian ideograph +7960East Asian ideograph +7950East Asian ideograph +7956East Asian ideograph +795EEast Asian ideograph +795DEast Asian ideograph +795FEast Asian ideograph +795AEast Asian ideograph +7957East Asian ideograph +7965East Asian ideograph +7968East Asian ideograph +796DEast Asian ideograph +797AEast Asian ideograph +7981East Asian ideograph +797FEast Asian ideograph +798FEast Asian ideograph +798DEast Asian ideograph +798EEast Asian ideograph +79A6East Asian ideograph +79A7East Asian ideograph +79AAEast Asian ideograph +79AEEast Asian ideograph +79B1East Asian ideograph +79B9East Asian ideograph +79BDEast Asian ideograph +842CEast Asian ideograph +79BEEast Asian ideograph +79C0East Asian ideograph +79C1East Asian ideograph +79BFEast Asian ideograph +79C9East Asian ideograph +79D1East Asian ideograph +79CBEast Asian ideograph +79D2East Asian ideograph +79E4East Asian ideograph +79E6East Asian ideograph +79E3East Asian ideograph +79DFEast Asian ideograph +79E7East Asian ideograph +79E9East Asian ideograph +79FBEast Asian ideograph +7A05East Asian ideograph +7A0DEast Asian ideograph +7A08East Asian ideograph +7A0BEast Asian ideograph +7A00East Asian ideograph +7A1FEast Asian ideograph +7A20East Asian ideograph +7A1AEast Asian ideograph +7A14East Asian ideograph +7A31East Asian ideograph +7A2EEast Asian ideograph +7A3FEast Asian ideograph +7A3CEast Asian ideograph +7A40East Asian ideograph +7A3DEast Asian ideograph +7A37East Asian ideograph +7A3BEast Asian ideograph +7A4DEast Asian ideograph +7A4EEast Asian ideograph +7A4CEast Asian ideograph +7A46East Asian ideograph +7A57East Asian ideograph +7A61East Asian ideograph +7A62East Asian ideograph +7A6BEast Asian ideograph +7A69East Asian ideograph +7A74East Asian ideograph +7A76East Asian ideograph +7A79East Asian ideograph +7A7AEast Asian ideograph +7A7FEast Asian ideograph +7A81East Asian ideograph +7A84East Asian ideograph +7A88East Asian ideograph +7A92East Asian ideograph +7A95East Asian ideograph +7A98East Asian ideograph +7A96East Asian ideograph +7A97East Asian ideograph +7A9FEast Asian ideograph +7AA0East Asian ideograph +7AAAEast Asian ideograph +7AA9East Asian ideograph +7AAFEast Asian ideograph +7AAEEast Asian ideograph +7ABAEast Asian ideograph +7AC5East Asian ideograph +7AC4East Asian ideograph +7AC7East Asian ideograph +7ACAEast Asian ideograph +7ACBEast Asian ideograph +7AD9East Asian ideograph +7AE5East Asian ideograph +7AE3East Asian ideograph +7AEDEast Asian ideograph +7AEFEast Asian ideograph +7AF6East Asian ideograph +7AF9East Asian ideograph +7AFAEast Asian ideograph +7AFFEast Asian ideograph +7AFDEast Asian ideograph +7B06East Asian ideograph +7B11East Asian ideograph +7B20East Asian ideograph +7B2CEast Asian ideograph +7B28East Asian ideograph +7B1BEast Asian ideograph +7B1EEast Asian ideograph +7B19East Asian ideograph +7B26East Asian ideograph +7B46East Asian ideograph +7B49East Asian ideograph +7B50East Asian ideograph +7B56East Asian ideograph +7B52East Asian ideograph +7B4BEast Asian ideograph +7B4DEast Asian ideograph +7B4FEast Asian ideograph +7B54East Asian ideograph +7B60East Asian ideograph +7B77East Asian ideograph +7B75East Asian ideograph +7BA1East Asian ideograph +7B94East Asian ideograph +7B95East Asian ideograph +7B9DEast Asian ideograph +7B8BEast Asian ideograph +7B97East Asian ideograph +7B8FEast Asian ideograph +7BC7East Asian ideograph +7BADEast Asian ideograph +7BC4East Asian ideograph +7BB1East Asian ideograph +7BB4East Asian ideograph +7BC0East Asian ideograph +7BC6East Asian ideograph +7BC1East Asian ideograph +7C11East Asian ideograph +7BD9East Asian ideograph +7BDBEast Asian ideograph +7BE4East Asian ideograph +7BC9East Asian ideograph +7BE1East Asian ideograph +7BE9East Asian ideograph +7C07East Asian ideograph +7C0DEast Asian ideograph +7BFEEast Asian ideograph +7BF7East Asian ideograph +7C21East Asian ideograph +7C2BEast Asian ideograph +7C2AEast Asian ideograph +7C27East Asian ideograph +7C1EEast Asian ideograph +7C23East Asian ideograph +7C3FEast Asian ideograph +7C3EEast Asian ideograph +7C38East Asian ideograph +7C37East Asian ideograph +7C3DEast Asian ideograph +7C43East Asian ideograph +7C4CEast Asian ideograph +7C4DEast Asian ideograph +7C50East Asian ideograph +7C60East Asian ideograph +7C5FEast Asian ideograph +7C64East Asian ideograph +7C6CEast Asian ideograph +7C6EEast Asian ideograph +7C72East Asian ideograph +7C73East Asian ideograph +7C89East Asian ideograph +7C92East Asian ideograph +7C97East Asian ideograph +7C9FEast Asian ideograph +7CA5East Asian ideograph +7CA4East Asian ideograph +7CB1East Asian ideograph +7CB3East Asian ideograph +7CBDEast Asian ideograph +7CB9East Asian ideograph +FA1DEast Asian ideograph +7CCAEast Asian ideograph +7CD6East Asian ideograph +7CD5East Asian ideograph +7CE0East Asian ideograph +7CDCEast Asian ideograph +7CDFEast Asian ideograph +7CDEEast Asian ideograph +7CE2East Asian ideograph +7CD9East Asian ideograph +7CE7East Asian ideograph +7CEFEast Asian ideograph +7CFBEast Asian ideograph +7CFEEast Asian ideograph +7D00East Asian ideograph +7D02East Asian ideograph +7D05East Asian ideograph +7D09East Asian ideograph +7D04East Asian ideograph +7D07East Asian ideograph +7D21East Asian ideograph +7D0BEast Asian ideograph +7D0AEast Asian ideograph +7D20East Asian ideograph +7D1CEast Asian ideograph +7D22East Asian ideograph +7D15East Asian ideograph +7D14East Asian ideograph +7D10East Asian ideograph +7D17East Asian ideograph +E94B7D0DVariant of 455122 which maps to 7D0D +7D1AEast Asian ideograph +7D19East Asian ideograph +7D1BEast Asian ideograph +7D46East Asian ideograph +7D3CEast Asian ideograph +7D2EEast Asian ideograph +7D39East Asian ideograph +7D44East Asian ideograph +7D30East Asian ideograph +7D33East Asian ideograph +7D2FEast Asian ideograph +7D40East Asian ideograph +7D42East Asian ideograph +7D71East Asian ideograph +7D5EEast Asian ideograph +7D68East Asian ideograph +7D50East Asian ideograph +7D2BEast Asian ideograph +7D62East Asian ideograph +7D76East Asian ideograph +7D61East Asian ideograph +7D66East Asian ideograph +7D6EEast Asian ideograph +7D72East Asian ideograph +7D93East Asian ideograph +7D91East Asian ideograph +7D79East Asian ideograph +7D8FEast Asian ideograph +7D81East Asian ideograph +7D9CEast Asian ideograph +7DBBEast Asian ideograph +7DB0East Asian ideograph +7DCAEast Asian ideograph +7DBEEast Asian ideograph +7DB4East Asian ideograph +7DBAEast Asian ideograph +7DB2East Asian ideograph +7DB1East Asian ideograph +7DBDEast Asian ideograph +7DB5East Asian ideograph +7DA0East Asian ideograph +7DA2East Asian ideograph +7DADEast Asian ideograph +7DBFEast Asian ideograph +7DB8East Asian ideograph +7DC7East Asian ideograph +7DE0East Asian ideograph +7DEFEast Asian ideograph +E94C7DF4Variant of 4B5154 which maps to 7DF4 +7DD6East Asian ideograph +7DD8East Asian ideograph +7DECEast Asian ideograph +7DDDEast Asian ideograph +7DE9East Asian ideograph +7DE3East Asian ideograph +7DE8East Asian ideograph +7DDAEast Asian ideograph +7D9EEast Asian ideograph +7DDEEast Asian ideograph +7E11East Asian ideograph +7E0AEast Asian ideograph +7E08East Asian ideograph +7E1BEast Asian ideograph +7DFBEast Asian ideograph +7E23East Asian ideograph +7E2EEast Asian ideograph +7E3EEast Asian ideograph +7E46East Asian ideograph +7E37East Asian ideograph +7E32East Asian ideograph +7E43East Asian ideograph +7E41East Asian ideograph +7E2BEast Asian ideograph +7E3DEast Asian ideograph +7E31East Asian ideograph +7E45East Asian ideograph +7E55East Asian ideograph +7E54East Asian ideograph +7E61East Asian ideograph +7E5EEast Asian ideograph +7E5AEast Asian ideograph +7E6BEast Asian ideograph +7E69East Asian ideograph +7E6DEast Asian ideograph +7E79East Asian ideograph +7E6AEast Asian ideograph +8FAEEast Asian ideograph +7E7DEast Asian ideograph +7E82East Asian ideograph +7E7CEast Asian ideograph +7E8FEast Asian ideograph +7E8CEast Asian ideograph +7E93East Asian ideograph +7E96East Asian ideograph +7E9CEast Asian ideograph +7F38East Asian ideograph +7F3AEast Asian ideograph +7F3DEast Asian ideograph +7F44East Asian ideograph +7F50East Asian ideograph +7F55East Asian ideograph +7F54East Asian ideograph +7F5FEast Asian ideograph +7F72East Asian ideograph +7F6EEast Asian ideograph +7F69East Asian ideograph +7F6AEast Asian ideograph +7F70East Asian ideograph +7F75East Asian ideograph +7F77East Asian ideograph +7F79East Asian ideograph +7F85East Asian ideograph +7F88East Asian ideograph +7F8AEast Asian ideograph +7F8CEast Asian ideograph +7F8EEast Asian ideograph +7F94East Asian ideograph +7F9EEast Asian ideograph +7F9AEast Asian ideograph +5584East Asian ideograph +7FA8East Asian ideograph +7FA4East Asian ideograph +7FA9East Asian ideograph +7FAFEast Asian ideograph +7FB2East Asian ideograph +7FB6East Asian ideograph +7FB8East Asian ideograph +7FB9East Asian ideograph +7FBDEast Asian ideograph +7FBFEast Asian ideograph +7FC5East Asian ideograph +7FC1East Asian ideograph +7FCCEast Asian ideograph +7FD2East Asian ideograph +E94D7FCEVariant of 4B524E which maps to 7FCE +7FD4East Asian ideograph +7FD5East Asian ideograph +7FE0East Asian ideograph +7FE1East Asian ideograph +7FDFEast Asian ideograph +7FE9East Asian ideograph +7FF0East Asian ideograph +7FF3East Asian ideograph +7FFCEast Asian ideograph +7FF9East Asian ideograph +7FFBEast Asian ideograph +7FF1East Asian ideograph +8000East Asian ideograph +8001East Asian ideograph +8003East Asian ideograph +8006East Asian ideograph +8005East Asian ideograph +800CEast Asian ideograph +8010East Asian ideograph +800DEast Asian ideograph +8012East Asian ideograph +8015East Asian ideograph +8018East Asian ideograph +8019East Asian ideograph +8017East Asian ideograph +801CEast Asian ideograph +8033East Asian ideograph +8036East Asian ideograph +803FEast Asian ideograph +803DEast Asian ideograph +804AEast Asian ideograph +8046East Asian ideograph +8056East Asian ideograph +8058East Asian ideograph +805EEast Asian ideograph +805AEast Asian ideograph +8071East Asian ideograph +8072East Asian ideograph +8073East Asian ideograph +8070East Asian ideograph +806FEast Asian ideograph +8077East Asian ideograph +8076East Asian ideograph +807EEast Asian ideograph +807DEast Asian ideograph +807FEast Asian ideograph +8084East Asian ideograph +8085East Asian ideograph +8087East Asian ideograph +8089East Asian ideograph +808BEast Asian ideograph +808CEast Asian ideograph +8093East Asian ideograph +809DEast Asian ideograph +8098East Asian ideograph +809BEast Asian ideograph +809AEast Asian ideograph +8096East Asian ideograph +80B2East Asian ideograph +80AAEast Asian ideograph +80BAEast Asian ideograph +80A5East Asian ideograph +80A2East Asian ideograph +80ABEast Asian ideograph +80B1East Asian ideograph +80AFEast Asian ideograph +80A1East Asian ideograph +80A9East Asian ideograph +80B4East Asian ideograph +80D6East Asian ideograph +80CCEast Asian ideograph +80E5East Asian ideograph +80DAEast Asian ideograph +80E1East Asian ideograph +80C3East Asian ideograph +80DBEast Asian ideograph +80C4East Asian ideograph +80CEEast Asian ideograph +80DEEast Asian ideograph +80E4East Asian ideograph +80F0East Asian ideograph +8102East Asian ideograph +8105East Asian ideograph +80F1East Asian ideograph +80F4East Asian ideograph +80EDEast Asian ideograph +80FDEast Asian ideograph +8106East Asian ideograph +80F3East Asian ideograph +80F8East Asian ideograph +810AEast Asian ideograph +8108East Asian ideograph +812BEast Asian ideograph +812FEast Asian ideograph +8116East Asian ideograph +8129East Asian ideograph +8155East Asian ideograph +8154East Asian ideograph +814BEast Asian ideograph +8151East Asian ideograph +8150East Asian ideograph +814EEast Asian ideograph +8139East Asian ideograph +8146East Asian ideograph +813EEast Asian ideograph +8171East Asian ideograph +8170East Asian ideograph +8178East Asian ideograph +8165East Asian ideograph +816EEast Asian ideograph +8173East Asian ideograph +816BEast Asian ideograph +8179East Asian ideograph +817AEast Asian ideograph +8166East Asian ideograph +8180East Asian ideograph +818FEast Asian ideograph +817FEast Asian ideograph +818AEast Asian ideograph +8188East Asian ideograph +819DEast Asian ideograph +81A0East Asian ideograph +819BEast Asian ideograph +819AEast Asian ideograph +819CEast Asian ideograph +81B3East Asian ideograph +81A9East Asian ideograph +81A8East Asian ideograph +81C6East Asian ideograph +81BAEast Asian ideograph +81C3East Asian ideograph +81C0East Asian ideograph +81C2East Asian ideograph +81BFEast Asian ideograph +81BDEast Asian ideograph +81C9East Asian ideograph +81BEEast Asian ideograph +81CDEast Asian ideograph +81CFEast Asian ideograph +81D8East Asian ideograph +81DAEast Asian ideograph +81DFEast Asian ideograph +81E3East Asian ideograph +81E5East Asian ideograph +81E8East Asian ideograph +81EAEast Asian ideograph +81ECEast Asian ideograph +81EDEast Asian ideograph +81F3East Asian ideograph +81FAEast Asian ideograph +81FBEast Asian ideograph +81FCEast Asian ideograph +81FEEast Asian ideograph +8200East Asian ideograph +8202East Asian ideograph +8205East Asian ideograph +8207East Asian ideograph +8208East Asian ideograph +8209East Asian ideograph +820AEast Asian ideograph +820CEast Asian ideograph +820DEast Asian ideograph +8210East Asian ideograph +8212East Asian ideograph +8214East Asian ideograph +821BEast Asian ideograph +821CEast Asian ideograph +821EEast Asian ideograph +821FEast Asian ideograph +8222East Asian ideograph +822AEast Asian ideograph +822BEast Asian ideograph +822CEast Asian ideograph +8228East Asian ideograph +8237East Asian ideograph +8235East Asian ideograph +8239East Asian ideograph +8236East Asian ideograph +8247East Asian ideograph +8258East Asian ideograph +8259East Asian ideograph +8266East Asian ideograph +826EEast Asian ideograph +826FEast Asian ideograph +8271East Asian ideograph +8272East Asian ideograph +827EEast Asian ideograph +8292East Asian ideograph +828BEast Asian ideograph +828DEast Asian ideograph +82B3East Asian ideograph +829DEast Asian ideograph +8299East Asian ideograph +82BDEast Asian ideograph +82ADEast Asian ideograph +82ACEast Asian ideograph +82A5East Asian ideograph +829FEast Asian ideograph +82BBEast Asian ideograph +82B1East Asian ideograph +82B9East Asian ideograph +82E7East Asian ideograph +8305East Asian ideograph +8309East Asian ideograph +82E3East Asian ideograph +82DBEast Asian ideograph +82E6East Asian ideograph +8304East Asian ideograph +82E5East Asian ideograph +8302East Asian ideograph +82DCEast Asian ideograph +82D7East Asian ideograph +82F1East Asian ideograph +8301East Asian ideograph +82D3East Asian ideograph +82D4East Asian ideograph +82D1East Asian ideograph +82DEEast Asian ideograph +82DFEast Asian ideograph +832BEast Asian ideograph +8352East Asian ideograph +834AEast Asian ideograph +8338East Asian ideograph +8354East Asian ideograph +8350East Asian ideograph +8349East Asian ideograph +8335East Asian ideograph +8334East Asian ideograph +8336East Asian ideograph +8331East Asian ideograph +8340East Asian ideograph +8317East Asian ideograph +5179East Asian ideograph +834FEast Asian ideograph +8339East Asian ideograph +838EEast Asian ideograph +8398East Asian ideograph +839EEast Asian ideograph +8378East Asian ideograph +83A2East Asian ideograph +8396East Asian ideograph +83A7East Asian ideograph +83ABEast Asian ideograph +E94E8392Variant of 4B552C which maps to 8392 +838AEast Asian ideograph +8393East Asian ideograph +83A0East Asian ideograph +8389East Asian ideograph +8377East Asian ideograph +837CEast Asian ideograph +837BEast Asian ideograph +840DEast Asian ideograph +83E0East Asian ideograph +83E9East Asian ideograph +8403East Asian ideograph +83C5East Asian ideograph +83C1East Asian ideograph +840BEast Asian ideograph +83EFEast Asian ideograph +83F1East Asian ideograph +83BDEast Asian ideograph +840AEast Asian ideograph +840CEast Asian ideograph +83CCEast Asian ideograph +83DCEast Asian ideograph +83CAEast Asian ideograph +83F2East Asian ideograph +840EEast Asian ideograph +8404East Asian ideograph +843DEast Asian ideograph +8482East Asian ideograph +8431East Asian ideograph +8475East Asian ideograph +8466East Asian ideograph +8457East Asian ideograph +8449East Asian ideograph +846CEast Asian ideograph +846BEast Asian ideograph +845BEast Asian ideograph +8477East Asian ideograph +843CEast Asian ideograph +8435East Asian ideograph +8461East Asian ideograph +8463East Asian ideograph +8469East Asian ideograph +8438East Asian ideograph +84B2East Asian ideograph +849EEast Asian ideograph +84BFEast Asian ideograph +84C6East Asian ideograph +84C4East Asian ideograph +84C9East Asian ideograph +849CEast Asian ideograph +84CBEast Asian ideograph +84B8East Asian ideograph +84C0East Asian ideograph +8499East Asian ideograph +84D3East Asian ideograph +8490East Asian ideograph +84BCEast Asian ideograph +853DEast Asian ideograph +84FFEast Asian ideograph +8517East Asian ideograph +851AEast Asian ideograph +84EEEast Asian ideograph +852CEast Asian ideograph +852DEast Asian ideograph +8513East Asian ideograph +8523East Asian ideograph +8521East Asian ideograph +8514East Asian ideograph +84ECEast Asian ideograph +8525East Asian ideograph +8569East Asian ideograph +854AEast Asian ideograph +8559East Asian ideograph +8548East Asian ideograph +8568East Asian ideograph +8543East Asian ideograph +856AEast Asian ideograph +8549East Asian ideograph +8584East Asian ideograph +85AAEast Asian ideograph +856DEast Asian ideograph +859BEast Asian ideograph +8591East Asian ideograph +857EEast Asian ideograph +8594East Asian ideograph +859CEast Asian ideograph +8587East Asian ideograph +E94F85CDVariant of 4B5629 which maps to 85CD +85A9East Asian ideograph +85CFEast Asian ideograph +85AFEast Asian ideograph +85D0East Asian ideograph +85C9East Asian ideograph +85B0East Asian ideograph +85E9East Asian ideograph +85DDEast Asian ideograph +85EAEast Asian ideograph +85E4East Asian ideograph +85D5East Asian ideograph +85E5East Asian ideograph +85FBEast Asian ideograph +85F9East Asian ideograph +8611East Asian ideograph +85FAEast Asian ideograph +8606East Asian ideograph +860BEast Asian ideograph +8607East Asian ideograph +860AEast Asian ideograph +862DEast Asian ideograph +8617East Asian ideograph +861AEast Asian ideograph +8638East Asian ideograph +863FEast Asian ideograph +864EEast Asian ideograph +8650East Asian ideograph +8654East Asian ideograph +5F6AEast Asian ideograph +8655East Asian ideograph +865CEast Asian ideograph +865BEast Asian ideograph +865FEast Asian ideograph +865EEast Asian ideograph +8667East Asian ideograph +8679East Asian ideograph +86A9East Asian ideograph +86AAEast Asian ideograph +868AEast Asian ideograph +8693East Asian ideograph +86A4East Asian ideograph +868CEast Asian ideograph +86A3East Asian ideograph +86C0East Asian ideograph +86C7East Asian ideograph +86B5East Asian ideograph +86CBEast Asian ideograph +86B6East Asian ideograph +86C4East Asian ideograph +86C6East Asian ideograph +86B1East Asian ideograph +86AFEast Asian ideograph +86DFEast Asian ideograph +86D9East Asian ideograph +86EDEast Asian ideograph +86D4East Asian ideograph +86DBEast Asian ideograph +86E4East Asian ideograph +86FBEast Asian ideograph +86F9East Asian ideograph +8707East Asian ideograph +8703East Asian ideograph +8708East Asian ideograph +8700East Asian ideograph +86FEEast Asian ideograph +8713East Asian ideograph +8702East Asian ideograph +871CEast Asian ideograph +873FEast Asian ideograph +873BEast Asian ideograph +8722East Asian ideograph +8725East Asian ideograph +8734East Asian ideograph +8718East Asian ideograph +8755East Asian ideograph +8760East Asian ideograph +8776East Asian ideograph +8774East Asian ideograph +8766East Asian ideograph +8778East Asian ideograph +8768East Asian ideograph +874CEast Asian ideograph +8757East Asian ideograph +8759East Asian ideograph +8783East Asian ideograph +8782East Asian ideograph +87A2East Asian ideograph +879EEast Asian ideograph +878DEast Asian ideograph +879FEast Asian ideograph +87D1East Asian ideograph +87C0East Asian ideograph +87ABEast Asian ideograph +87B3East Asian ideograph +87BBEast Asian ideograph +87C8East Asian ideograph +87D2East Asian ideograph +87BAEast Asian ideograph +87C6East Asian ideograph +87CBEast Asian ideograph +87EFEast Asian ideograph +87F2East Asian ideograph +87ECEast Asian ideograph +87FBEast Asian ideograph +8805East Asian ideograph +880DEast Asian ideograph +87F9East Asian ideograph +8814East Asian ideograph +8815East Asian ideograph +8822East Asian ideograph +8823East Asian ideograph +8821East Asian ideograph +881FEast Asian ideograph +8831East Asian ideograph +8839East Asian ideograph +8836East Asian ideograph +883BEast Asian ideograph +8840East Asian ideograph +884CEast Asian ideograph +884DEast Asian ideograph +E9508853Variant of 4B5746 which maps to 8853 +8857East Asian ideograph +8859East Asian ideograph +885BEast Asian ideograph +885DEast Asian ideograph +8861East Asian ideograph +8862East Asian ideograph +8863East Asian ideograph +521DEast Asian ideograph +8868East Asian ideograph +886BEast Asian ideograph +8882East Asian ideograph +8881East Asian ideograph +8870East Asian ideograph +8877East Asian ideograph +8888East Asian ideograph +88ABEast Asian ideograph +8892East Asian ideograph +8896East Asian ideograph +888DEast Asian ideograph +888BEast Asian ideograph +889EEast Asian ideograph +88C1East Asian ideograph +88C2East Asian ideograph +88B1East Asian ideograph +88DFEast Asian ideograph +88D9East Asian ideograph +88D8East Asian ideograph +88DCEast Asian ideograph +88CFEast Asian ideograph +88D4East Asian ideograph +88DDEast Asian ideograph +88D5East Asian ideograph +8902East Asian ideograph +88F3East Asian ideograph +88F8East Asian ideograph +88F9East Asian ideograph +88F4East Asian ideograph +88FDEast Asian ideograph +88E8East Asian ideograph +891AEast Asian ideograph +8910East Asian ideograph +8913East Asian ideograph +8912East Asian ideograph +8932East Asian ideograph +892AEast Asian ideograph +8925East Asian ideograph +892BEast Asian ideograph +893BEast Asian ideograph +8936East Asian ideograph +8938East Asian ideograph +8944East Asian ideograph +895FEast Asian ideograph +8960East Asian ideograph +8956East Asian ideograph +8964East Asian ideograph +896AEast Asian ideograph +896FEast Asian ideograph +8972East Asian ideograph +897FEast Asian ideograph +8981East Asian ideograph +8983East Asian ideograph +898BEast Asian ideograph +898FEast Asian ideograph +8993East Asian ideograph +8996East Asian ideograph +89AAEast Asian ideograph +89A6East Asian ideograph +89ACEast Asian ideograph +89B2East Asian ideograph +89BAEast Asian ideograph +89BDEast Asian ideograph +89C0East Asian ideograph +89D2East Asian ideograph +89E3East Asian ideograph +89F4East Asian ideograph +89F8East Asian ideograph +8A00East Asian ideograph +8A08East Asian ideograph +8A02East Asian ideograph +8A03East Asian ideograph +8A10East Asian ideograph +8A18East Asian ideograph +8A0EEast Asian ideograph +8A0CEast Asian ideograph +8A15East Asian ideograph +8A0AEast Asian ideograph +8A16East Asian ideograph +8A17East Asian ideograph +8A13East Asian ideograph +8A2AEast Asian ideograph +8A23East Asian ideograph +8A1DEast Asian ideograph +8A25East Asian ideograph +8A31East Asian ideograph +8A2DEast Asian ideograph +8A1BEast Asian ideograph +8A1FEast Asian ideograph +8A3BEast Asian ideograph +8A60East Asian ideograph +8A55East Asian ideograph +8A5EEast Asian ideograph +8A41East Asian ideograph +8A54East Asian ideograph +8A5BEast Asian ideograph +8A50East Asian ideograph +8A46East Asian ideograph +8A34East Asian ideograph +8A3AEast Asian ideograph +8A6BEast Asian ideograph +8A72East Asian ideograph +8A73East Asian ideograph +8A66East Asian ideograph +8A69East Asian ideograph +8A70East Asian ideograph +8A63East Asian ideograph +8A7CEast Asian ideograph +8AA0East Asian ideograph +8A87East Asian ideograph +8A85East Asian ideograph +8A6DEast Asian ideograph +8A79East Asian ideograph +8A62East Asian ideograph +8A71East Asian ideograph +8A6EEast Asian ideograph +8A6CEast Asian ideograph +8AAAEast Asian ideograph +8AA6East Asian ideograph +8AA1East Asian ideograph +8A9EEast Asian ideograph +8A8CEast Asian ideograph +8A93East Asian ideograph +8AA3East Asian ideograph +8A8DEast Asian ideograph +E9518AA4Variant of 4B5871 which maps to 8AA4 +8AA8East Asian ideograph +8AA5East Asian ideograph +8A98East Asian ideograph +8A91East Asian ideograph +8ABCEast Asian ideograph +8AC4East Asian ideograph +8AD2East Asian ideograph +8AC7East Asian ideograph +E9528ACBVariant of 4B587A which maps to 8ACB +8AF8East Asian ideograph +8AB2East Asian ideograph +8ABFEast Asian ideograph +8AC9East Asian ideograph +8AC2East Asian ideograph +8AB0East Asian ideograph +8A95East Asian ideograph +8AD6East Asian ideograph +8AE6East Asian ideograph +8AFAEast Asian ideograph +8AEBEast Asian ideograph +8AF1East Asian ideograph +8AE7East Asian ideograph +8ADCEast Asian ideograph +8B00East Asian ideograph +E9538B01Variant of 2D592C which maps to 8B01 +8B02East Asian ideograph +8AFEEast Asian ideograph +8AF7East Asian ideograph +8AEDEast Asian ideograph +8B17East Asian ideograph +8B19East Asian ideograph +8B0EEast Asian ideograph +8B1BEast Asian ideograph +8B0AEast Asian ideograph +8B21East Asian ideograph +8B04East Asian ideograph +8B1DEast Asian ideograph +8B39East Asian ideograph +8B2CEast Asian ideograph +8B28East Asian ideograph +8B58East Asian ideograph +8B5CEast Asian ideograph +8B4EEast Asian ideograph +8B49East Asian ideograph +8B5AEast Asian ideograph +8B41East Asian ideograph +8B4FEast Asian ideograph +8B70East Asian ideograph +8B6CEast Asian ideograph +8B66East Asian ideograph +8B6FEast Asian ideograph +8B74East Asian ideograph +8B77East Asian ideograph +8B7DEast Asian ideograph +8B80East Asian ideograph +8B8AEast Asian ideograph +8B93East Asian ideograph +8B96East Asian ideograph +8B92East Asian ideograph +8B9AEast Asian ideograph +8C41East Asian ideograph +8C3FEast Asian ideograph +8C46East Asian ideograph +8C48East Asian ideograph +8C49East Asian ideograph +8C4CEast Asian ideograph +8C4EEast Asian ideograph +8C50East Asian ideograph +8C54East Asian ideograph +8C5AEast Asian ideograph +8C62East Asian ideograph +8C6AEast Asian ideograph +8C6BEast Asian ideograph +8C6CEast Asian ideograph +8C7AEast Asian ideograph +8C79East Asian ideograph +8C82East Asian ideograph +8C8AEast Asian ideograph +8C89East Asian ideograph +8C8DEast Asian ideograph +8C8CEast Asian ideograph +8C93East Asian ideograph +8C9DEast Asian ideograph +8C9EEast Asian ideograph +8CA0East Asian ideograph +8CA2East Asian ideograph +8CA1East Asian ideograph +8CACEast Asian ideograph +8CABEast Asian ideograph +8CA8East Asian ideograph +8CAAEast Asian ideograph +8CA7East Asian ideograph +8CA9East Asian ideograph +8CAFEast Asian ideograph +8CBBEast Asian ideograph +8CC1East Asian ideograph +8CC0East Asian ideograph +8CB4East Asian ideograph +8CBCEast Asian ideograph +8CB7East Asian ideograph +8CB6East Asian ideograph +8CBDEast Asian ideograph +8CB8East Asian ideograph +8CBFEast Asian ideograph +8CC5East Asian ideograph +8CC7East Asian ideograph +8CCAEast Asian ideograph +8CC8East Asian ideograph +8CC4East Asian ideograph +8CB2East Asian ideograph +8CC3East Asian ideograph +8CC2East Asian ideograph +8CD3East Asian ideograph +8CD1East Asian ideograph +8CD2East Asian ideograph +8CE0East Asian ideograph +8CE6East Asian ideograph +8CE3East Asian ideograph +8CE2East Asian ideograph +8CE4East Asian ideograph +8CDEEast Asian ideograph +8CDCEast Asian ideograph +8CEAEast Asian ideograph +8CEDEast Asian ideograph +8CF4East Asian ideograph +8CFDEast Asian ideograph +8CFAEast Asian ideograph +8D05East Asian ideograph +8CFCEast Asian ideograph +E9548D08Variant of 4B5A3B which maps to 8D08 +8D0BEast Asian ideograph +8D0AEast Asian ideograph +8D0FEast Asian ideograph +8D0DEast Asian ideograph +8D13East Asian ideograph +8D16East Asian ideograph +8D1BEast Asian ideograph +8D64East Asian ideograph +8D67East Asian ideograph +8D66East Asian ideograph +8D6BEast Asian ideograph +8D6DEast Asian ideograph +8D70East Asian ideograph +8D74East Asian ideograph +8D73East Asian ideograph +8D77East Asian ideograph +8D85East Asian ideograph +8D8AEast Asian ideograph +8D81East Asian ideograph +8D99East Asian ideograph +8D95East Asian ideograph +8DA3East Asian ideograph +8D9FEast Asian ideograph +8DA8East Asian ideograph +8DB3East Asian ideograph +8DB4East Asian ideograph +8DBEEast Asian ideograph +8DCEEast Asian ideograph +8DDDEast Asian ideograph +8DDBEast Asian ideograph +8DCBEast Asian ideograph +8DDAEast Asian ideograph +8DC6East Asian ideograph +8DD1East Asian ideograph +8DCCEast Asian ideograph +8DE1East Asian ideograph +8DDFEast Asian ideograph +8DE8East Asian ideograph +8DF3East Asian ideograph +8DFAEast Asian ideograph +8DEAEast Asian ideograph +8DEFEast Asian ideograph +8DFCEast Asian ideograph +8E2BEast Asian ideograph +8E10East Asian ideograph +8E22East Asian ideograph +8E1DEast Asian ideograph +8E0FEast Asian ideograph +8E29East Asian ideograph +8E1FEast Asian ideograph +8E44East Asian ideograph +8E31East Asian ideograph +8E42East Asian ideograph +8E34East Asian ideograph +8E39East Asian ideograph +8E35East Asian ideograph +8E49East Asian ideograph +8E4BEast Asian ideograph +8E48East Asian ideograph +8E4AEast Asian ideograph +8E63East Asian ideograph +8E59East Asian ideograph +8E66East Asian ideograph +8E64East Asian ideograph +8E72East Asian ideograph +8E6CEast Asian ideograph +8E7AEast Asian ideograph +8E76East Asian ideograph +8E7CEast Asian ideograph +8E82East Asian ideograph +8E81East Asian ideograph +8E87East Asian ideograph +8E89East Asian ideograph +8E85East Asian ideograph +8E8AEast Asian ideograph +E9558E8DVariant of 4B5B29 which maps to 8E8D +8E91East Asian ideograph +8EA1East Asian ideograph +8EAAEast Asian ideograph +8EABEast Asian ideograph +8EACEast Asian ideograph +8EB2East Asian ideograph +8EBAEast Asian ideograph +8EC0East Asian ideograph +8ECAEast Asian ideograph +8ECBEast Asian ideograph +8ECDEast Asian ideograph +8ECCEast Asian ideograph +8ED2East Asian ideograph +8ED4East Asian ideograph +8EDFEast Asian ideograph +8EDBEast Asian ideograph +8EFBEast Asian ideograph +8EF8East Asian ideograph +8EFCEast Asian ideograph +8F03East Asian ideograph +8EFEEast Asian ideograph +8F09East Asian ideograph +8F0AEast Asian ideograph +8F14East Asian ideograph +8F12East Asian ideograph +8F15East Asian ideograph +8F13East Asian ideograph +8F26East Asian ideograph +8F1BEast Asian ideograph +8F1FEast Asian ideograph +8F1DEast Asian ideograph +8F29East Asian ideograph +8F2AEast Asian ideograph +8F1CEast Asian ideograph +8F3BEast Asian ideograph +8F2FEast Asian ideograph +8F38East Asian ideograph +8F44East Asian ideograph +8F3EEast Asian ideograph +8F45East Asian ideograph +E9568F42Variant of 4B5B52 which maps to 8F42 +8F3FEast Asian ideograph +8F4DEast Asian ideograph +8F49East Asian ideograph +8F54East Asian ideograph +8F4EEast Asian ideograph +8F5FEast Asian ideograph +8F61East Asian ideograph +8F9BEast Asian ideograph +8F9CEast Asian ideograph +8F9FEast Asian ideograph +8FA3East Asian ideograph +8FA8East Asian ideograph +8FA6East Asian ideograph +8FADEast Asian ideograph +8FAFEast Asian ideograph +8FB0East Asian ideograph +8FB1East Asian ideograph +8FB2East Asian ideograph +8FC6East Asian ideograph +8FC5East Asian ideograph +8FC4East Asian ideograph +5DE1East Asian ideograph +8FCEEast Asian ideograph +8FD1East Asian ideograph +8FD4East Asian ideograph +E9578FF0Variant of 275B6D which maps to 8FF0 +8FE6East Asian ideograph +8FE2East Asian ideograph +8FEAEast Asian ideograph +8FE5East Asian ideograph +8FEBEast Asian ideograph +9001East Asian ideograph +9006East Asian ideograph +8FF7East Asian ideograph +9000East Asian ideograph +9003East Asian ideograph +8FFDEast Asian ideograph +9005East Asian ideograph +9019East Asian ideograph +9023East Asian ideograph +901FEast Asian ideograph +9017East Asian ideograph +901DEast Asian ideograph +9010East Asian ideograph +900DEast Asian ideograph +901EEast Asian ideograph +901AEast Asian ideograph +9020East Asian ideograph +900FEast Asian ideograph +9022East Asian ideograph +9016East Asian ideograph +901BEast Asian ideograph +9014East Asian ideograph +902EEast Asian ideograph +9035East Asian ideograph +9031East Asian ideograph +FA25East Asian ideograph +9032East Asian ideograph +904BEast Asian ideograph +9053East Asian ideograph +9042East Asian ideograph +9050East Asian ideograph +9054East Asian ideograph +9055East Asian ideograph +903CEast Asian ideograph +9047East Asian ideograph +904FEast Asian ideograph +904EEast Asian ideograph +904DEast Asian ideograph +9051East Asian ideograph +9041East Asian ideograph +903EEast Asian ideograph +9058East Asian ideograph +9060East Asian ideograph +905CEast Asian ideograph +9063East Asian ideograph +9065East Asian ideograph +905EEast Asian ideograph +9069East Asian ideograph +906EEast Asian ideograph +9068East Asian ideograph +906DEast Asian ideograph +9075East Asian ideograph +9074East Asian ideograph +9078East Asian ideograph +9072East Asian ideograph +9077East Asian ideograph +907CEast Asian ideograph +907AEast Asian ideograph +907FEast Asian ideograph +907DEast Asian ideograph +9081East Asian ideograph +9084East Asian ideograph +9082East Asian ideograph +9080East Asian ideograph +9087East Asian ideograph +908AEast Asian ideograph +9090East Asian ideograph +908FEast Asian ideograph +9091East Asian ideograph +9095East Asian ideograph +90A3East Asian ideograph +90A2East Asian ideograph +90AAEast Asian ideograph +90A6East Asian ideograph +90B5East Asian ideograph +90B1East Asian ideograph +90B8East Asian ideograph +90CEEast Asian ideograph +90CAEast Asian ideograph +90E1East Asian ideograph +90E8East Asian ideograph +90EDEast Asian ideograph +90F5East Asian ideograph +90FDEast Asian ideograph +9102East Asian ideograph +9109East Asian ideograph +9112East Asian ideograph +9119East Asian ideograph +912DEast Asian ideograph +9130East Asian ideograph +9127East Asian ideograph +9131East Asian ideograph +E9589139Variant of 4B5C77 which maps to 9139 +9149East Asian ideograph +914BEast Asian ideograph +914AEast Asian ideograph +9152East Asian ideograph +914DEast Asian ideograph +914CEast Asian ideograph +9157East Asian ideograph +9163East Asian ideograph +9165East Asian ideograph +916CEast Asian ideograph +9169East Asian ideograph +916AEast Asian ideograph +9175East Asian ideograph +9178East Asian ideograph +9177East Asian ideograph +9187East Asian ideograph +9189East Asian ideograph +918BEast Asian ideograph +9183East Asian ideograph +9192East Asian ideograph +91A3East Asian ideograph +919EEast Asian ideograph +919CEast Asian ideograph +91ABEast Asian ideograph +91ACEast Asian ideograph +91BAEast Asian ideograph +91C0East Asian ideograph +91C1East Asian ideograph +91C7East Asian ideograph +91C9East Asian ideograph +91CBEast Asian ideograph +91CDEast Asian ideograph +91CEEast Asian ideograph +91CFEast Asian ideograph +91D0East Asian ideograph +91D1East Asian ideograph +91DDEast Asian ideograph +91D8East Asian ideograph +91D7East Asian ideograph +91DCEast Asian ideograph +91F5East Asian ideograph +91E6East Asian ideograph +91E3East Asian ideograph +91E7East Asian ideograph +9223East Asian ideograph +920DEast Asian ideograph +9215East Asian ideograph +9209East Asian ideograph +9214East Asian ideograph +921EEast Asian ideograph +9210East Asian ideograph +9237East Asian ideograph +9238East Asian ideograph +923DEast Asian ideograph +923EEast Asian ideograph +9240East Asian ideograph +924BEast Asian ideograph +925BEast Asian ideograph +9264East Asian ideograph +9251East Asian ideograph +E9599234Variant of 4B5D58 which maps to 9234 +9278East Asian ideograph +9280East Asian ideograph +92ACEast Asian ideograph +9285East Asian ideograph +9298East Asian ideograph +9296East Asian ideograph +927BEast Asian ideograph +9293East Asian ideograph +929CEast Asian ideograph +92C5East Asian ideograph +92BBEast Asian ideograph +92B3East Asian ideograph +92EAEast Asian ideograph +92B7East Asian ideograph +92C1East Asian ideograph +92E4East Asian ideograph +92BCEast Asian ideograph +92D2East Asian ideograph +9320East Asian ideograph +9336East Asian ideograph +92F8East Asian ideograph +9333East Asian ideograph +932FEast Asian ideograph +9322East Asian ideograph +92FCEast Asian ideograph +932BEast Asian ideograph +931AEast Asian ideograph +9304East Asian ideograph +9310East Asian ideograph +9326East Asian ideograph +934DEast Asian ideograph +9382East Asian ideograph +9375East Asian ideograph +9365East Asian ideograph +934BEast Asian ideograph +9328East Asian ideograph +9370East Asian ideograph +937EEast Asian ideograph +9318East Asian ideograph +936CEast Asian ideograph +935BEast Asian ideograph +938AEast Asian ideograph +9394East Asian ideograph +93AEEast Asian ideograph +9396East Asian ideograph +93A2East Asian ideograph +93B3East Asian ideograph +93E1East Asian ideograph +93D1East Asian ideograph +93D6East Asian ideograph +93C3East Asian ideograph +93DFEast Asian ideograph +93D7East Asian ideograph +93C8East Asian ideograph +93E2East Asian ideograph +93DCEast Asian ideograph +93E4East Asian ideograph +93DDEast Asian ideograph +93CDEast Asian ideograph +93D8East Asian ideograph +9403East Asian ideograph +942EEast Asian ideograph +93FDEast Asian ideograph +9433East Asian ideograph +9435East Asian ideograph +943AEast Asian ideograph +9438East Asian ideograph +9432East Asian ideograph +9451East Asian ideograph +9444East Asian ideograph +9463East Asian ideograph +9460East Asian ideograph +9472East Asian ideograph +9470East Asian ideograph +947EEast Asian ideograph +947CEast Asian ideograph +947DEast Asian ideograph +947FEast Asian ideograph +9577East Asian ideograph +9580East Asian ideograph +9582East Asian ideograph +9583East Asian ideograph +9589East Asian ideograph +9594East Asian ideograph +958FEast Asian ideograph +958BEast Asian ideograph +9591East Asian ideograph +9593East Asian ideograph +9592East Asian ideograph +9598East Asian ideograph +95A1East Asian ideograph +95A8East Asian ideograph +95A9East Asian ideograph +95A3East Asian ideograph +95A5East Asian ideograph +95A4East Asian ideograph +95B1East Asian ideograph +95ADEast Asian ideograph +95BBEast Asian ideograph +95CAEast Asian ideograph +95CBEast Asian ideograph +95CCEast Asian ideograph +95C8East Asian ideograph +95C6East Asian ideograph +95D6East Asian ideograph +95D0East Asian ideograph +95DCEast Asian ideograph +95E1East Asian ideograph +95E2East Asian ideograph +961CEast Asian ideograph +9621East Asian ideograph +9632East Asian ideograph +9631East Asian ideograph +962EEast Asian ideograph +962AEast Asian ideograph +9640East Asian ideograph +963FEast Asian ideograph +963BEast Asian ideograph +9644East Asian ideograph +9650East Asian ideograph +964CEast Asian ideograph +964BEast Asian ideograph +964DEast Asian ideograph +9662East Asian ideograph +9663East Asian ideograph +965BEast Asian ideograph +9661East Asian ideograph +965DEast Asian ideograph +9664East Asian ideograph +966AEast Asian ideograph +9673East Asian ideograph +9678East Asian ideograph +9675East Asian ideograph +9672East Asian ideograph +9676East Asian ideograph +9677East Asian ideograph +9674East Asian ideograph +9670East Asian ideograph +968AEast Asian ideograph +968EEast Asian ideograph +968BEast Asian ideograph +967DEast Asian ideograph +9685East Asian ideograph +9686East Asian ideograph +968DEast Asian ideograph +9698East Asian ideograph +9694East Asian ideograph +9699East Asian ideograph +9695East Asian ideograph +969CEast Asian ideograph +969BEast Asian ideograph +96A7East Asian ideograph +96A8East Asian ideograph +96AAEast Asian ideograph +96B1East Asian ideograph +96B4East Asian ideograph +96B8East Asian ideograph +96BBEast Asian ideograph +96C0East Asian ideograph +96C7East Asian ideograph +96C6East Asian ideograph +96C4East Asian ideograph +96C1East Asian ideograph +96C5East Asian ideograph +96CDEast Asian ideograph +96CBEast Asian ideograph +96C9East Asian ideograph +96CCEast Asian ideograph +96D5East Asian ideograph +96D6East Asian ideograph +96DCEast Asian ideograph +96DEEast Asian ideograph +96DBEast Asian ideograph +96D9East Asian ideograph +96E2East Asian ideograph +E95A96E3Variant of 4B5F50 which maps to 96E3 +96E8East Asian ideograph +96EAEast Asian ideograph +96EFEast Asian ideograph +96F2East Asian ideograph +96FBEast Asian ideograph +96F7East Asian ideograph +96F9East Asian ideograph +96F6East Asian ideograph +9700East Asian ideograph +9707East Asian ideograph +9704East Asian ideograph +9709East Asian ideograph +9706East Asian ideograph +9711East Asian ideograph +970EEast Asian ideograph +9716East Asian ideograph +970FEast Asian ideograph +970DEast Asian ideograph +9713East Asian ideograph +971CEast Asian ideograph +971EEast Asian ideograph +972AEast Asian ideograph +9727East Asian ideograph +9738East Asian ideograph +9739East Asian ideograph +9732East Asian ideograph +973DEast Asian ideograph +973EEast Asian ideograph +9744East Asian ideograph +9742East Asian ideograph +9748East Asian ideograph +9751East Asian ideograph +FA1CEast Asian ideograph +E95B975BVariant of 4B5F72 which maps to 975B +975CEast Asian ideograph +975EEast Asian ideograph +9760East Asian ideograph +9761East Asian ideograph +9766East Asian ideograph +9768East Asian ideograph +9769East Asian ideograph +9776East Asian ideograph +9774East Asian ideograph +977CEast Asian ideograph +9785East Asian ideograph +978DEast Asian ideograph +978BEast Asian ideograph +978FEast Asian ideograph +9798East Asian ideograph +97A0East Asian ideograph +97A3East Asian ideograph +97A6East Asian ideograph +97ADEast Asian ideograph +97C3East Asian ideograph +97C1East Asian ideograph +97C6East Asian ideograph +97CBEast Asian ideograph +97CCEast Asian ideograph +97D3East Asian ideograph +97DCEast Asian ideograph +97EDEast Asian ideograph +97F3East Asian ideograph +7AE0East Asian ideograph +7ADFEast Asian ideograph +97F6East Asian ideograph +97FBEast Asian ideograph +E95C97FFVariant of 456036 which maps to 97FF +9801East Asian ideograph +9802East Asian ideograph +9803East Asian ideograph +9805East Asian ideograph +9806East Asian ideograph +9808East Asian ideograph +9810East Asian ideograph +980AEast Asian ideograph +9811East Asian ideograph +9813East Asian ideograph +9812East Asian ideograph +980CEast Asian ideograph +9817East Asian ideograph +E95D9818Variant of 4B6044 which maps to 9818 +9821East Asian ideograph +982DEast Asian ideograph +9830East Asian ideograph +9838East Asian ideograph +983BEast Asian ideograph +9839East Asian ideograph +9837East Asian ideograph +9824East Asian ideograph +9846East Asian ideograph +9854East Asian ideograph +984DEast Asian ideograph +984CEast Asian ideograph +984EEast Asian ideograph +9853East Asian ideograph +E95E985EVariant of 4B6053 which maps to 985E +985AEast Asian ideograph +9858East Asian ideograph +9867East Asian ideograph +986BEast Asian ideograph +986FEast Asian ideograph +9871East Asian ideograph +9870East Asian ideograph +98A8East Asian ideograph +98AFEast Asian ideograph +98B1East Asian ideograph +98B3East Asian ideograph +98B6East Asian ideograph +98BAEast Asian ideograph +98BCEast Asian ideograph +98C4East Asian ideograph +98DBEast Asian ideograph +98DFEast Asian ideograph +98E2East Asian ideograph +98E7East Asian ideograph +98E9East Asian ideograph +98EDEast Asian ideograph +98EAEast Asian ideograph +98EEEast Asian ideograph +98EFEast Asian ideograph +98FCEast Asian ideograph +98F4East Asian ideograph +98FDEast Asian ideograph +98FEEast Asian ideograph +9903East Asian ideograph +990AEast Asian ideograph +990CEast Asian ideograph +9909East Asian ideograph +9910East Asian ideograph +9912East Asian ideograph +9918East Asian ideograph +9913East Asian ideograph +9905East Asian ideograph +9928East Asian ideograph +991EEast Asian ideograph +991BEast Asian ideograph +9921East Asian ideograph +9935East Asian ideograph +993EEast Asian ideograph +993FEast Asian ideograph +993DEast Asian ideograph +9945East Asian ideograph +9952East Asian ideograph +9951East Asian ideograph +995CEast Asian ideograph +995EEast Asian ideograph +9996East Asian ideograph +9999East Asian ideograph +99A5East Asian ideograph +99A8East Asian ideograph +99ACEast Asian ideograph +99AEEast Asian ideograph +99ADEast Asian ideograph +99B3East Asian ideograph +99B1East Asian ideograph +99B4East Asian ideograph +99C1East Asian ideograph +99D0East Asian ideograph +99DDEast Asian ideograph +99D5East Asian ideograph +99DFEast Asian ideograph +99DBEast Asian ideograph +99D2East Asian ideograph +99D9East Asian ideograph +99D1East Asian ideograph +99EDEast Asian ideograph +99F1East Asian ideograph +9A01East Asian ideograph +99FFEast Asian ideograph +99E2East Asian ideograph +9A0EEast Asian ideograph +9A19East Asian ideograph +9A16East Asian ideograph +9A2BEast Asian ideograph +9A30East Asian ideograph +9A37East Asian ideograph +9A43East Asian ideograph +9A45East Asian ideograph +9A40East Asian ideograph +9A3EEast Asian ideograph +9A55East Asian ideograph +9A5AEast Asian ideograph +9A5BEast Asian ideograph +9A57East Asian ideograph +9A5FEast Asian ideograph +9A62East Asian ideograph +9A65East Asian ideograph +9A6AEast Asian ideograph +9AA8East Asian ideograph +9AAFEast Asian ideograph +9AB0East Asian ideograph +9AB7East Asian ideograph +9AB8East Asian ideograph +9ABCEast Asian ideograph +9ACFEast Asian ideograph +9AD3East Asian ideograph +9AD4East Asian ideograph +9AD2East Asian ideograph +9AD8East Asian ideograph +9AE5East Asian ideograph +9AEEEast Asian ideograph +9AFBEast Asian ideograph +9AEDEast Asian ideograph +9B03East Asian ideograph +9B06East Asian ideograph +9B0DEast Asian ideograph +9B1AEast Asian ideograph +9B22East Asian ideograph +9B25East Asian ideograph +9B27East Asian ideograph +9B31East Asian ideograph +9B32East Asian ideograph +9B3CEast Asian ideograph +9B41East Asian ideograph +9B42East Asian ideograph +9B45East Asian ideograph +9B44East Asian ideograph +9B4FEast Asian ideograph +9B54East Asian ideograph +9B58East Asian ideograph +9B5AEast Asian ideograph +9B77East Asian ideograph +9B6FEast Asian ideograph +9B91East Asian ideograph +9BABEast Asian ideograph +9BAEEast Asian ideograph +9BAAEast Asian ideograph +9BCAEast Asian ideograph +9BC9East Asian ideograph +9BE8East Asian ideograph +9BE7East Asian ideograph +9C13East Asian ideograph +9C0DEast Asian ideograph +9BFDEast Asian ideograph +9C2DEast Asian ideograph +9C25East Asian ideograph +9C31East Asian ideograph +9C3EEast Asian ideograph +9C3BEast Asian ideograph +9C54East Asian ideograph +9C57East Asian ideograph +9C56East Asian ideograph +9C49East Asian ideograph +9C77East Asian ideograph +9C78East Asian ideograph +9CE5East Asian ideograph +9CE9East Asian ideograph +9CF6East Asian ideograph +9CF4East Asian ideograph +9CF3East Asian ideograph +9D06East Asian ideograph +9D09East Asian ideograph +9D15East Asian ideograph +9D23East Asian ideograph +9D28East Asian ideograph +9D26East Asian ideograph +9D1BEast Asian ideograph +E95F9D12Variant of 4B623B which maps to 9D12 +9D3BEast Asian ideograph +9D3FEast Asian ideograph +9D61East Asian ideograph +9D51East Asian ideograph +9D60East Asian ideograph +9D5DEast Asian ideograph +9D89East Asian ideograph +9D72East Asian ideograph +9D6AEast Asian ideograph +9D6CEast Asian ideograph +9DB4East Asian ideograph +9DAFEast Asian ideograph +9DC2East Asian ideograph +9DD3East Asian ideograph +9DD7East Asian ideograph +9DE5East Asian ideograph +9DF9East Asian ideograph +9DFAEast Asian ideograph +9E1AEast Asian ideograph +9E1EEast Asian ideograph +9E79East Asian ideograph +9E7DEast Asian ideograph +9E7CEast Asian ideograph +9E7FEast Asian ideograph +9E82East Asian ideograph +9E8BEast Asian ideograph +9E97East Asian ideograph +9E92East Asian ideograph +9E93East Asian ideograph +9E9DEast Asian ideograph +9E9FEast Asian ideograph +9EA5East Asian ideograph +9EA9East Asian ideograph +9EB4East Asian ideograph +9EB5East Asian ideograph +9EBBEast Asian ideograph +9EBCEast Asian ideograph +9EBEEast Asian ideograph +9EC3East Asian ideograph +9ECDEast Asian ideograph +9ECEEast Asian ideograph +9ECFEast Asian ideograph +9ED1East Asian ideograph +58A8East Asian ideograph +9ED8East Asian ideograph +9ED4East Asian ideograph +9EDEEast Asian ideograph +9EDCEast Asian ideograph +9EDBEast Asian ideograph +9EDDEast Asian ideograph +9EE0East Asian ideograph +9EE8East Asian ideograph +9EEFEast Asian ideograph +9EF4East Asian ideograph +9EF7East Asian ideograph +9F07East Asian ideograph +9F0EEast Asian ideograph +9F13East Asian ideograph +9F15East Asian ideograph +9F19East Asian ideograph +9F20East Asian ideograph +9F2CEast Asian ideograph +9F34East Asian ideograph +9F3BEast Asian ideograph +9F3EEast Asian ideograph +9F4AEast Asian ideograph +9F4BEast Asian ideograph +9F52East Asian ideograph +9F5FEast Asian ideograph +9F63East Asian ideograph +E9609F61Variant of 456324 which maps to 9F61 +9F66East Asian ideograph +9F5CEast Asian ideograph +9F6CEast Asian ideograph +9F6AEast Asian ideograph +9F77East Asian ideograph +9F72East Asian ideograph +9F8DEast Asian ideograph +9F94East Asian ideograph +9F9CEast Asian ideograph +8288East Asian ideograph +4E0FEast Asian ideograph +5187East Asian ideograph +4E28East Asian ideograph +4E31East Asian ideograph +4E36East Asian ideograph +4E3FEast Asian ideograph +4E42East Asian ideograph +738DEast Asian ideograph +4E5CEast Asian ideograph +6C39East Asian ideograph +4E85East Asian ideograph +4EA0East Asian ideograph +4EA2East Asian ideograph +4EB3East Asian ideograph +E9614EB6Variant of 4B6455 which maps to 4EB6 +4EB9East Asian ideograph +4EBCEast Asian ideograph +4EC9East Asian ideograph +4EC8East Asian ideograph +E9E2East Asian ideograph not in Unicode +4EE8East Asian ideograph +4EE1East Asian ideograph +4F08East Asian ideograph +4F0EEast Asian ideograph +4F03East Asian ideograph +4F22East Asian ideograph +4EF5East Asian ideograph +4F07East Asian ideograph +4F00East Asian ideograph +4F0BEast Asian ideograph +4F3BEast Asian ideograph +4F58East Asian ideograph +4F62East Asian ideograph +4F64East Asian ideograph +4F49East Asian ideograph +4F3EEast Asian ideograph +4F66East Asian ideograph +4F67East Asian ideograph +4F68East Asian ideograph +4F5AEast Asian ideograph +4F5FEast Asian ideograph +4F82East Asian ideograph +4F7CEast Asian ideograph +4F98East Asian ideograph +4F92East Asian ideograph +4F7DEast Asian ideograph +4F80East Asian ideograph +4F74East Asian ideograph +4F76East Asian ideograph +4FA2East Asian ideograph +4F91East Asian ideograph +4F95East Asian ideograph +4F4CEast Asian ideograph +4F97East Asian ideograph +4F94East Asian ideograph +4F79East Asian ideograph +4F9AEast Asian ideograph +4F81East Asian ideograph +4F78East Asian ideograph +4F9CEast Asian ideograph +4F90East Asian ideograph +4F7AEast Asian ideograph +4FCDEast Asian ideograph +4FE4East Asian ideograph +4FB7East Asian ideograph +4FC5East Asian ideograph +4FC9East Asian ideograph +4FE5East Asian ideograph +4FE7East Asian ideograph +4FDCEast Asian ideograph +4FD4East Asian ideograph +4FC1East Asian ideograph +4FDBEast Asian ideograph +4FC6East Asian ideograph +4FB9East Asian ideograph +501EEast Asian ideograph +503FEast Asian ideograph +5005East Asian ideograph +5007East Asian ideograph +5013East Asian ideograph +5022East Asian ideograph +4FF5East Asian ideograph +4FF4East Asian ideograph +5037East Asian ideograph +502EEast Asian ideograph +4FF6East Asian ideograph +501CEast Asian ideograph +502CEast Asian ideograph +5010East Asian ideograph +503DEast Asian ideograph +506FEast Asian ideograph +5050East Asian ideograph +5070East Asian ideograph +5053East Asian ideograph +506AEast Asian ideograph +5056East Asian ideograph +506DEast Asian ideograph +505DEast Asian ideograph +5048East Asian ideograph +5058East Asian ideograph +5072East Asian ideograph +5041East Asian ideograph +5015East Asian ideograph +507AEast Asian ideograph +506CEast Asian ideograph +505FEast Asian ideograph +506BEast Asian ideograph +5094East Asian ideograph +509EEast Asian ideograph +509BEast Asian ideograph +509AEast Asian ideograph +50A3East Asian ideograph +508CEast Asian ideograph +5088East Asian ideograph +508EEast Asian ideograph +5095East Asian ideograph +50A6East Asian ideograph +5092East Asian ideograph +509CEast Asian ideograph +50C7East Asian ideograph +50C9East Asian ideograph +50CAEast Asian ideograph +50B4East Asian ideograph +50C2East Asian ideograph +50BAEast Asian ideograph +50CDEast Asian ideograph +50D4East Asian ideograph +50EFEast Asian ideograph +50E6East Asian ideograph +50F4East Asian ideograph +50CEEast Asian ideograph +50DDEast Asian ideograph +50F3East Asian ideograph +50E8East Asian ideograph +50F0East Asian ideograph +50D9East Asian ideograph +50ECEast Asian ideograph +510EEast Asian ideograph +5105East Asian ideograph +50FCEast Asian ideograph +5106East Asian ideograph +5107East Asian ideograph +510FEast Asian ideograph +50FEEast Asian ideograph +510BEast Asian ideograph +50FDEast Asian ideograph +5101East Asian ideograph +5115East Asian ideograph +5113East Asian ideograph +511AEast Asian ideograph +9797East Asian ideograph +5126East Asian ideograph +5124East Asian ideograph +5129East Asian ideograph +5131East Asian ideograph +5135East Asian ideograph +5133East Asian ideograph +513AEast Asian ideograph +5139East Asian ideograph +513BEast Asian ideograph +5159East Asian ideograph +515BEast Asian ideograph +515DEast Asian ideograph +515EEast Asian ideograph +515FEast Asian ideograph +5161East Asian ideograph +5163East Asian ideograph +5182East Asian ideograph +5184East Asian ideograph +518FEast Asian ideograph +5194East Asian ideograph +5193East Asian ideograph +5196East Asian ideograph +51A1East Asian ideograph +51A3East Asian ideograph +51AAEast Asian ideograph +51ABEast Asian ideograph +51B1East Asian ideograph +51BCEast Asian ideograph +51CAEast Asian ideograph +51C7East Asian ideograph +51D1East Asian ideograph +51D0East Asian ideograph +51D3East Asian ideograph +51D9East Asian ideograph +51DFEast Asian ideograph +51E2East Asian ideograph +5160East Asian ideograph +51F5East Asian ideograph +51F7East Asian ideograph +5213East Asian ideograph +5216East Asian ideograph +521CEast Asian ideograph +5231East Asian ideograph +5235East Asian ideograph +5232East Asian ideograph +5233East Asian ideograph +5244East Asian ideograph +5249East Asian ideograph +5260East Asian ideograph +525AEast Asian ideograph +5252East Asian ideograph +525EEast Asian ideograph +525FEast Asian ideograph +5255East Asian ideograph +526EEast Asian ideograph +5268East Asian ideograph +7B9AEast Asian ideograph +5278East Asian ideograph +5282East Asian ideograph +5281East Asian ideograph +528CEast Asian ideograph +528AEast Asian ideograph +5290East Asian ideograph +5293East Asian ideograph +5296East Asian ideograph +5298East Asian ideograph +529AEast Asian ideograph +5299East Asian ideograph +52A6East Asian ideograph +52ADEast Asian ideograph +52AEEast Asian ideograph +52BBEast Asian ideograph +52BCEast Asian ideograph +52CAEast Asian ideograph +52CDEast Asian ideograph +52D0East Asian ideograph +52D1East Asian ideograph +52D4East Asian ideograph +52D6East Asian ideograph +52E3East Asian ideograph +52E1East Asian ideograph +55E7East Asian ideograph +52E9East Asian ideograph +52F0East Asian ideograph +52F1East Asian ideograph +52F7East Asian ideograph +52F9East Asian ideograph +52FAEast Asian ideograph +52FCEast Asian ideograph +5307East Asian ideograph +5303East Asian ideograph +E9E3East Asian ideograph not in Unicode +530AEast Asian ideograph +530BEast Asian ideograph +5311East Asian ideograph +6706East Asian ideograph +531AEast Asian ideograph +531CEast Asian ideograph +531FEast Asian ideograph +532DEast Asian ideograph +5330East Asian ideograph +5335East Asian ideograph +5338East Asian ideograph +533DEast Asian ideograph +534CEast Asian ideograph +534DEast Asian ideograph +535DEast Asian ideograph +5363East Asian ideograph +E9E4East Asian ideograph not in Unicode +536CEast Asian ideograph +5372East Asian ideograph +537AEast Asian ideograph +5380East Asian ideograph +538EEast Asian ideograph +5393East Asian ideograph +5394East Asian ideograph +5399East Asian ideograph +8652East Asian ideograph +53A4East Asian ideograph +53ABEast Asian ideograph +53B5East Asian ideograph +53B9East Asian ideograph +53D0East Asian ideograph +53DAEast Asian ideograph +53FBEast Asian ideograph +535FEast Asian ideograph +5414East Asian ideograph +5406East Asian ideograph +544CEast Asian ideograph +5445East Asian ideograph +541AEast Asian ideograph +5432East Asian ideograph +5421East Asian ideograph +5430East Asian ideograph +5454East Asian ideograph +543DEast Asian ideograph +544FEast Asian ideograph +542AEast Asian ideograph +5422East Asian ideograph +5423East Asian ideograph +545FEast Asian ideograph +549CEast Asian ideograph +5488East Asian ideograph +547FEast Asian ideograph +5482East Asian ideograph +546DEast Asian ideograph +5491East Asian ideograph +5494East Asian ideograph +546BEast Asian ideograph +548DEast Asian ideograph +5463East Asian ideograph +5474East Asian ideograph +5466East Asian ideograph +5464East Asian ideograph +54A4East Asian ideograph +54A1East Asian ideograph +54ADEast Asian ideograph +54BAEast Asian ideograph +54CFEast Asian ideograph +54BEEast Asian ideograph +54A5East Asian ideograph +54A7East Asian ideograph +54B5East Asian ideograph +54A2East Asian ideograph +5472East Asian ideograph +5470East Asian ideograph +54BCEast Asian ideograph +54B7East Asian ideograph +54DEEast Asian ideograph +54D6East Asian ideograph +54AEEast Asian ideograph +54BFEast Asian ideograph +54C6East Asian ideograph +551AEast Asian ideograph +54E2East Asian ideograph +5507East Asian ideograph +5517East Asian ideograph +54FDEast Asian ideograph +54E7East Asian ideograph +54F3East Asian ideograph +54E4East Asian ideograph +550AEast Asian ideograph +54FFEast Asian ideograph +5518East Asian ideograph +5504East Asian ideograph +54EFEast Asian ideograph +5508East Asian ideograph +54F6East Asian ideograph +54F7East Asian ideograph +550EEast Asian ideograph +5523East Asian ideograph +550FEast Asian ideograph +5511East Asian ideograph +5575East Asian ideograph +5573East Asian ideograph +554CEast Asian ideograph +5576East Asian ideograph +554DEast Asian ideograph +555AEast Asian ideograph +553CEast Asian ideograph +5550East Asian ideograph +5539East Asian ideograph +5548East Asian ideograph +552DEast Asian ideograph +5551East Asian ideograph +552AEast Asian ideograph +5562East Asian ideograph +5536East Asian ideograph +5549East Asian ideograph +5530East Asian ideograph +5540East Asian ideograph +5535East Asian ideograph +5545East Asian ideograph +553FEast Asian ideograph +5541East Asian ideograph +5565East Asian ideograph +5591East Asian ideograph +5577East Asian ideograph +55A8East Asian ideograph +55ADEast Asian ideograph +5605East Asian ideograph +5593East Asian ideograph +5586East Asian ideograph +5588East Asian ideograph +55B4East Asian ideograph +E96255E2Variant of 2D7143 which maps to 55E2 +5581East Asian ideograph +558EEast Asian ideograph +55B5East Asian ideograph +558FEast Asian ideograph +5559East Asian ideograph +55A4East Asian ideograph +5592East Asian ideograph +5599East Asian ideograph +55F4East Asian ideograph +55CCEast Asian ideograph +55D0East Asian ideograph +55DBEast Asian ideograph +55CDEast Asian ideograph +55DEEast Asian ideograph +55D9East Asian ideograph +55C3East Asian ideograph +55C9East Asian ideograph +55CAEast Asian ideograph +55DDEast Asian ideograph +55D4East Asian ideograph +55C4East Asian ideograph +55E9East Asian ideograph +55CFEast Asian ideograph +55D2East Asian ideograph +55E5East Asian ideograph +55D6East Asian ideograph +55C1East Asian ideograph +55F2East Asian ideograph +5627East Asian ideograph +55FBEast Asian ideograph +5612East Asian ideograph +55F8East Asian ideograph +560FEast Asian ideograph +55F9East Asian ideograph +561EEast Asian ideograph +560CEast Asian ideograph +561CEast Asian ideograph +5610East Asian ideograph +5601East Asian ideograph +5613East Asian ideograph +55F6East Asian ideograph +5602East Asian ideograph +561DEast Asian ideograph +55FFEast Asian ideograph +5642East Asian ideograph +564CEast Asian ideograph +564BEast Asian ideograph +5640East Asian ideograph +5635East Asian ideograph +5649East Asian ideograph +5641East Asian ideograph +5658East Asian ideograph +5620East Asian ideograph +5654East Asian ideograph +562AEast Asian ideograph +563DEast Asian ideograph +562CEast Asian ideograph +5638East Asian ideograph +564DEast Asian ideograph +562BEast Asian ideograph +564FEast Asian ideograph +5670East Asian ideograph +565FEast Asian ideograph +567CEast Asian ideograph +5660East Asian ideograph +5676East Asian ideograph +5666East Asian ideograph +5673East Asian ideograph +566DEast Asian ideograph +5672East Asian ideograph +5693East Asian ideograph +568CEast Asian ideograph +56BAEast Asian ideograph +5686East Asian ideograph +5684East Asian ideograph +5691East Asian ideograph +568AEast Asian ideograph +569EEast Asian ideograph +569CEast Asian ideograph +569AEast Asian ideograph +5699East Asian ideograph +56ADEast Asian ideograph +56A6East Asian ideograph +56ACEast Asian ideograph +56B2East Asian ideograph +56B3East Asian ideograph +56C3East Asian ideograph +56C5East Asian ideograph +56CFEast Asian ideograph +56CDEast Asian ideograph +56D4East Asian ideograph +56D7East Asian ideograph +56DDEast Asian ideograph +56E1East Asian ideograph +56DFEast Asian ideograph +56EBEast Asian ideograph +56EEEast Asian ideograph +56E7East Asian ideograph +56FBEast Asian ideograph +56F7East Asian ideograph +56F9East Asian ideograph +56FFEast Asian ideograph +5705East Asian ideograph +5704East Asian ideograph +5702East Asian ideograph +570AEast Asian ideograph +5709East Asian ideograph +5707East Asian ideograph +570CEast Asian ideograph +5715East Asian ideograph +5714East Asian ideograph +571AEast Asian ideograph +571BEast Asian ideograph +571CEast Asian ideograph +571DEast Asian ideograph +571EEast Asian ideograph +5724East Asian ideograph +572EEast Asian ideograph +5729East Asian ideograph +5738East Asian ideograph +572AEast Asian ideograph +5749East Asian ideograph +5745East Asian ideograph +574BEast Asian ideograph +574CEast Asian ideograph +573FEast Asian ideograph +5768East Asian ideograph +578AEast Asian ideograph +576DEast Asian ideograph +5774East Asian ideograph +5767East Asian ideograph +5770East Asian ideograph +5771East Asian ideograph +576EEast Asian ideograph +5776East Asian ideograph +5789East Asian ideograph +577FEast Asian ideograph +5775East Asian ideograph +577BEast Asian ideograph +5788East Asian ideograph +5773East Asian ideograph +579FEast Asian ideograph +5790East Asian ideograph +5793East Asian ideograph +579EEast Asian ideograph +57B5East Asian ideograph +579AEast Asian ideograph +5794East Asian ideograph +57A4East Asian ideograph +5799East Asian ideograph +578CEast Asian ideograph +5797East Asian ideograph +579DEast Asian ideograph +579CEast Asian ideograph +57A7East Asian ideograph +57A1East Asian ideograph +EA00East Asian ideograph not found in unified han +5795East Asian ideograph +57B8East Asian ideograph +57C7East Asian ideograph +5809East Asian ideograph +57BEEast Asian ideograph +57DBEast Asian ideograph +57D5East Asian ideograph +57D2East Asian ideograph +57C6East Asian ideograph +57C4East Asian ideograph +70FEEast Asian ideograph +57E3East Asian ideograph +57FBEast Asian ideograph +5803East Asian ideograph +57F6East Asian ideograph +57E6East Asian ideograph +57EDEast Asian ideograph +5800East Asian ideograph +57ECEast Asian ideograph +5807East Asian ideograph +580EEast Asian ideograph +580FEast Asian ideograph +57F4East Asian ideograph +5810East Asian ideograph +580DEast Asian ideograph +57EFEast Asian ideograph +5801East Asian ideograph +5812East Asian ideograph +57FDEast Asian ideograph +57F8East Asian ideograph +580CEast Asian ideograph +5813East Asian ideograph +57F0East Asian ideograph +580BEast Asian ideograph +57F3East Asian ideograph +5804East Asian ideograph +57CFEast Asian ideograph +57DDEast Asian ideograph +5847East Asian ideograph +581BEast Asian ideograph +5819East Asian ideograph +5833East Asian ideograph +581EEast Asian ideograph +583FEast Asian ideograph +5827East Asian ideograph +5828East Asian ideograph +582EEast Asian ideograph +581DEast Asian ideograph +5844East Asian ideograph +5848East Asian ideograph +5818East Asian ideograph +57F5East Asian ideograph +582DEast Asian ideograph +5820East Asian ideograph +584EEast Asian ideograph +585DEast Asian ideograph +5859East Asian ideograph +584BEast Asian ideograph +5865East Asian ideograph +586CEast Asian ideograph +5852East Asian ideograph +5864East Asian ideograph +5853East Asian ideograph +584FEast Asian ideograph +583DEast Asian ideograph +584DEast Asian ideograph +5856East Asian ideograph +589AEast Asian ideograph +5892East Asian ideograph +588EEast Asian ideograph +5889East Asian ideograph +5840East Asian ideograph +589BEast Asian ideograph +587CEast Asian ideograph +5888East Asian ideograph +5890East Asian ideograph +5898East Asian ideograph +587DEast Asian ideograph +587FEast Asian ideograph +5881East Asian ideograph +58A9East Asian ideograph +58A1East Asian ideograph +58B1East Asian ideograph +58ADEast Asian ideograph +58A0East Asian ideograph +58A3East Asian ideograph +58A6East Asian ideograph +58C8East Asian ideograph +58BCEast Asian ideograph +58BFEast Asian ideograph +58C6East Asian ideograph +58BAEast Asian ideograph +58D6East Asian ideograph +58D2East Asian ideograph +58CEEast Asian ideograph +58E0East Asian ideograph +58DAEast Asian ideograph +58FCEast Asian ideograph +5902East Asian ideograph +5906East Asian ideograph +6535East Asian ideograph +5910East Asian ideograph +8641East Asian ideograph +592CEast Asian ideograph +592FEast Asian ideograph +593CEast Asian ideograph +5940East Asian ideograph +594DEast Asian ideograph +5953East Asian ideograph +595CEast Asian ideograph +5961East Asian ideograph +596CEast Asian ideograph +596DEast Asian ideograph +597CEast Asian ideograph +59A7East Asian ideograph +5998East Asian ideograph +599AEast Asian ideograph +59A0East Asian ideograph +5997East Asian ideograph +5990East Asian ideograph +59C5East Asian ideograph +59B5East Asian ideograph +59CFEast Asian ideograph +59BAEast Asian ideograph +59B8East Asian ideograph +59B2East Asian ideograph +59B7East Asian ideograph +59C1East Asian ideograph +59F9East Asian ideograph +59F8East Asian ideograph +59EEEast Asian ideograph +59F1East Asian ideograph +5A00East Asian ideograph +59DEEast Asian ideograph +59FDEast Asian ideograph +59F6East Asian ideograph +59DDEast Asian ideograph +59FAEast Asian ideograph +59E4East Asian ideograph +5A2AEast Asian ideograph +5A16East Asian ideograph +5A09East Asian ideograph +5A12East Asian ideograph +5A60East Asian ideograph +5A67East Asian ideograph +5A38East Asian ideograph +5A5EEast Asian ideograph +5A6DEast Asian ideograph +5A35East Asian ideograph +5A55East Asian ideograph +5A2CEast Asian ideograph +5A50East Asian ideograph +5A65East Asian ideograph +5A64East Asian ideograph +5A8AEast Asian ideograph +5ACFEast Asian ideograph +5A7AEast Asian ideograph +5A9FEast Asian ideograph +5AA0East Asian ideograph +5AA6East Asian ideograph +5A8CEast Asian ideograph +5AA7East Asian ideograph +5A9EEast Asian ideograph +5AA2East Asian ideograph +5A9CEast Asian ideograph +5A7CEast Asian ideograph +5A96East Asian ideograph +5A93East Asian ideograph +5AACEast Asian ideograph +5AAEEast Asian ideograph +5A95East Asian ideograph +5AAFEast Asian ideograph +5AC8East Asian ideograph +5AB5East Asian ideograph +5AC4East Asian ideograph +5AB7East Asian ideograph +5AD1East Asian ideograph +5A90East Asian ideograph +5AB8East Asian ideograph +5ABAEast Asian ideograph +5AAAEast Asian ideograph +5AD3East Asian ideograph +5AB1East Asian ideograph +5ADCEast Asian ideograph +5AE5East Asian ideograph +5AE0East Asian ideograph +5AEAEast Asian ideograph +5ADAEast Asian ideograph +5AEBEast Asian ideograph +5AFFEast Asian ideograph +5AFDEast Asian ideograph +5B08East Asian ideograph +5B0DEast Asian ideograph +5B03East Asian ideograph +5B17East Asian ideograph +5B16East Asian ideograph +5B19East Asian ideograph +5B1BEast Asian ideograph +5B21East Asian ideograph +5B2CEast Asian ideograph +5B32East Asian ideograph +5B3FEast Asian ideograph +5B45East Asian ideograph +5B4CEast Asian ideograph +5B4BEast Asian ideograph +5B56East Asian ideograph +5B5BEast Asian ideograph +5B62East Asian ideograph +5B65East Asian ideograph +5B67East Asian ideograph +E9E5East Asian ideograph not in Unicode +5B6CEast Asian ideograph +5B6EEast Asian ideograph +5B7BEast Asian ideograph +5B7CEast Asian ideograph +5B80East Asian ideograph +5B84East Asian ideograph +E9E6East Asian ideograph not in Unicode +5B95East Asian ideograph +5B93East Asian ideograph +5BACEast Asian ideograph +5BA7East Asian ideograph +5BB7East Asian ideograph +5BC1East Asian ideograph +EA01East Asian ideography not found in unified han +5BC9East Asian ideograph +5BD4East Asian ideograph +5BC3East Asian ideograph +5BD6East Asian ideograph +5BD7East Asian ideograph +5BE0East Asian ideograph +5BEAEast Asian ideograph +5BF0East Asian ideograph +5BEFEast Asian ideograph +5C00East Asian ideograph +5C57East Asian ideograph +5C15East Asian ideograph +5C22East Asian ideograph +5C25East Asian ideograph +5C2AEast Asian ideograph +5C2FEast Asian ideograph +5C32East Asian ideograph +5C3BEast Asian ideograph +5C44East Asian ideograph +5C49East Asian ideograph +5C59East Asian ideograph +5C5DEast Asian ideograph +5C5FEast Asian ideograph +5C63East Asian ideograph +5C67East Asian ideograph +5C68East Asian ideograph +5C6DEast Asian ideograph +5C6EEast Asian ideograph +5C74East Asian ideograph +5C73East Asian ideograph +5C77East Asian ideograph +5C7AEast Asian ideograph +5C7CEast Asian ideograph +5C8FEast Asian ideograph +5C88East Asian ideograph +5C8DEast Asian ideograph +5C99East Asian ideograph +5CA6East Asian ideograph +5CA0East Asian ideograph +5CA2East Asian ideograph +5CB5East Asian ideograph +5CA7East Asian ideograph +5CA8East Asian ideograph +5CACEast Asian ideograph +5CA3East Asian ideograph +5CB6East Asian ideograph +5CC1East Asian ideograph +5CADEast Asian ideograph +5CD5East Asian ideograph +5CD3East Asian ideograph +E9E7East Asian ideograph not in Unicode +5CE0East Asian ideograph +5CD2East Asian ideograph +5CDDEast Asian ideograph +5CCBEast Asian ideograph +5CC7East Asian ideograph +5CDCEast Asian ideograph +5D00East Asian ideograph +5CFFEast Asian ideograph +5CEBEast Asian ideograph +5CF4East Asian ideograph +5CF1East Asian ideograph +5D1EEast Asian ideograph +5D12East Asian ideograph +5D1AEast Asian ideograph +5D0CEast Asian ideograph +5D20East Asian ideograph +5D21East Asian ideograph +5D27East Asian ideograph +5D0DEast Asian ideograph +5D26East Asian ideograph +5D2EEast Asian ideograph +5D24East Asian ideograph +5D36East Asian ideograph +5D3EEast Asian ideograph +5D4BEast Asian ideograph +5D57East Asian ideograph +5D34East Asian ideograph +5D3FEast Asian ideograph +5D52East Asian ideograph +5D3DEast Asian ideograph +5D4EEast Asian ideograph +5D59East Asian ideograph +5D47East Asian ideograph +5D32East Asian ideograph +5D42East Asian ideograph +5D74East Asian ideograph +5D6FEast Asian ideograph +5D6BEast Asian ideograph +5D75East Asian ideograph +5D4AEast Asian ideograph +5D6CEast Asian ideograph +5D62East Asian ideograph +5D82East Asian ideograph +5D79East Asian ideograph +5D8EEast Asian ideograph +5D81East Asian ideograph +5D7EEast Asian ideograph +5D92East Asian ideograph +5D99East Asian ideograph +5D97East Asian ideograph +5DA2East Asian ideograph +5DA1East Asian ideograph +5D93East Asian ideograph +5DA0East Asian ideograph +5D94East Asian ideograph +5DACEast Asian ideograph +5DA7East Asian ideograph +5DB0East Asian ideograph +5DB4East Asian ideograph +5DAEEast Asian ideograph +5DB6East Asian ideograph +5DB8East Asian ideograph +5DBFEast Asian ideograph +5DB7East Asian ideograph +5DC3East Asian ideograph +5DC7East Asian ideograph +5DC9East Asian ideograph +5DCBEast Asian ideograph +5DD8East Asian ideograph +5DDBEast Asian ideograph +5DDCEast Asian ideograph +5DE4East Asian ideograph +5E00East Asian ideograph +51E7East Asian ideograph +5E14East Asian ideograph +5E17East Asian ideograph +5E19East Asian ideograph +5E12East Asian ideograph +5E1FEast Asian ideograph +5E23East Asian ideograph +5E21East Asian ideograph +5E22East Asian ideograph +5E28East Asian ideograph +5E44East Asian ideograph +5E43East Asian ideograph +5E42East Asian ideograph +5E4EEast Asian ideograph +5E58East Asian ideograph +5E48East Asian ideograph +5E5EEast Asian ideograph +5E61East Asian ideograph +5E68East Asian ideograph +5E6CEast Asian ideograph +5E6AEast Asian ideograph +5E6EEast Asian ideograph +5E6DEast Asian ideograph +5E70East Asian ideograph +5E75East Asian ideograph +5E80East Asian ideograph +5E8BEast Asian ideograph +5EA4East Asian ideograph +5EA5East Asian ideograph +5EAFEast Asian ideograph +5EB9East Asian ideograph +5EB3East Asian ideograph +5EC4East Asian ideograph +5ECCEast Asian ideograph +5ECBEast Asian ideograph +5ECDEast Asian ideograph +5ED2East Asian ideograph +5ED1East Asian ideograph +5ED5East Asian ideograph +5ED4East Asian ideograph +5ED9East Asian ideograph +5ECEEast Asian ideograph +5EE1East Asian ideograph +5EE7East Asian ideograph +5EE8East Asian ideograph +5EEDEast Asian ideograph +5EF1East Asian ideograph +5EF4East Asian ideograph +5F07East Asian ideograph +5F0BEast Asian ideograph +5F28East Asian ideograph +5F22East Asian ideograph +5F23East Asian ideograph +5F24East Asian ideograph +5F33East Asian ideograph +5F30East Asian ideograph +5F38East Asian ideograph +5F40East Asian ideograph +5F44East Asian ideograph +5F4DEast Asian ideograph +5F50East Asian ideograph +5F54East Asian ideograph +5F56East Asian ideograph +5F58East Asian ideograph +5F60East Asian ideograph +5F61East Asian ideograph +5F63East Asian ideograph +809CEast Asian ideograph +5F67East Asian ideograph +5F72East Asian ideograph +5F73East Asian ideograph +5F74East Asian ideograph +5F82East Asian ideograph +5F89East Asian ideograph +5F94East Asian ideograph +EA02East Asian ideograph not found in unified han +5F9CEast Asian ideograph +5F9AEast Asian ideograph +5FAFEast Asian ideograph +5FBCEast Asian ideograph +5FC9East Asian ideograph +5FD1East Asian ideograph +5FD2East Asian ideograph +5FD0East Asian ideograph +5FCEEast Asian ideograph +5FEDEast Asian ideograph +5FEEEast Asian ideograph +5FF8East Asian ideograph +5FE1East Asian ideograph +5FE4East Asian ideograph +5FEAEast Asian ideograph +6026East Asian ideograph +6029East Asian ideograph +602BEast Asian ideograph +6019East Asian ideograph +6008East Asian ideograph +600AEast Asian ideograph +600CEast Asian ideograph +601BEast Asian ideograph +6017East Asian ideograph +6033East Asian ideograph +600DEast Asian ideograph +6010East Asian ideograph +6039East Asian ideograph +6013East Asian ideograph +6054East Asian ideograph +605DEast Asian ideograph +6047East Asian ideograph +6049East Asian ideograph +6053East Asian ideograph +6067East Asian ideograph +604CEast Asian ideograph +6041East Asian ideograph +6077East Asian ideograph +6042East Asian ideograph +605FEast Asian ideograph +6061East Asian ideograph +608AEast Asian ideograph +6092East Asian ideograph +609DEast Asian ideograph +6081East Asian ideograph +609EEast Asian ideograph +6083East Asian ideograph +6097East Asian ideograph +60A7East Asian ideograph +6095East Asian ideograph +60C7East Asian ideograph +60B0East Asian ideograph +60BEEast Asian ideograph +60D3East Asian ideograph +60D4East Asian ideograph +60CEEast Asian ideograph +60CFEast Asian ideograph +60D9East Asian ideograph +60B3East Asian ideograph +60DDEast Asian ideograph +60C4East Asian ideograph +60B1East Asian ideograph +60E3East Asian ideograph +60E2East Asian ideograph +60E5East Asian ideograph +60DBEast Asian ideograph +60E9East Asian ideograph +6114East Asian ideograph +6103East Asian ideograph +6119East Asian ideograph +60FDEast Asian ideograph +610DEast Asian ideograph +610AEast Asian ideograph +6110East Asian ideograph +6112East Asian ideograph +60F2East Asian ideograph +6125East Asian ideograph +60F8East Asian ideograph +6121East Asian ideograph +60FCEast Asian ideograph +6106East Asian ideograph +6149East Asian ideograph +614AEast Asian ideograph +612BEast Asian ideograph +6129East Asian ideograph +6150East Asian ideograph +53AFEast Asian ideograph +6130East Asian ideograph +6141East Asian ideograph +6137East Asian ideograph +6146East Asian ideograph +615EEast Asian ideograph +6175East Asian ideograph +6174East Asian ideograph +6183East Asian ideograph +6171East Asian ideograph +616AEast Asian ideograph +6173East Asian ideograph +6164East Asian ideograph +6153East Asian ideograph +618BEast Asian ideograph +616FEast Asian ideograph +6165East Asian ideograph +615CEast Asian ideograph +619DEast Asian ideograph +61A6East Asian ideograph +61A2East Asian ideograph +61A8East Asian ideograph +619CEast Asian ideograph +61AFEast Asian ideograph +6196East Asian ideograph +6197East Asian ideograph +61ADEast Asian ideograph +6192East Asian ideograph +61AEEast Asian ideograph +618DEast Asian ideograph +61CBEast Asian ideograph +61CCEast Asian ideograph +61C6East Asian ideograph +61BAEast Asian ideograph +61B8East Asian ideograph +61E0East Asian ideograph +61E5East Asian ideograph +61DCEast Asian ideograph +61DFEast Asian ideograph +61F3East Asian ideograph +6201East Asian ideograph +6204East Asian ideograph +6207East Asian ideograph +6209East Asian ideograph +6214East Asian ideograph +6223East Asian ideograph +6225East Asian ideograph +6224East Asian ideograph +6229East Asian ideograph +622DEast Asian ideograph +97EFEast Asian ideograph +6239East Asian ideograph +623AEast Asian ideograph +623DEast Asian ideograph +6243East Asian ideograph +6246East Asian ideograph +6245East Asian ideograph +624AEast Asian ideograph +6250East Asian ideograph +625EEast Asian ideograph +6268East Asian ideograph +6260East Asian ideograph +625AEast Asian ideograph +6262East Asian ideograph +6266East Asian ideograph +6286East Asian ideograph +628EEast Asian ideograph +62A3East Asian ideograph +6282East Asian ideograph +6285East Asian ideograph +629DEast Asian ideograph +62A6East Asian ideograph +62D1East Asian ideograph +62E4East Asian ideograph +62B6East Asian ideograph +62C3East Asian ideograph +630DEast Asian ideograph +62F5East Asian ideograph +630CEast Asian ideograph +6360East Asian ideograph +62F6East Asian ideograph +6331East Asian ideograph +6345East Asian ideograph +6343East Asian ideograph +6335East Asian ideograph +6353East Asian ideograph +6364East Asian ideograph +6336East Asian ideograph +6344East Asian ideograph +6339East Asian ideograph +6357East Asian ideograph +633CEast Asian ideograph +6358East Asian ideograph +634BEast Asian ideograph +6354East Asian ideograph +637DEast Asian ideograph +63B6East Asian ideograph +6382East Asian ideograph +636CEast Asian ideograph +639FEast Asian ideograph +639EEast Asian ideograph +637FEast Asian ideograph +6381East Asian ideograph +6397East Asian ideograph +63ABEast Asian ideograph +6387East Asian ideograph +637AEast Asian ideograph +638EEast Asian ideograph +6386East Asian ideograph +6375East Asian ideograph +63AFEast Asian ideograph +63B1East Asian ideograph +63B0East Asian ideograph +63AEEast Asian ideograph +637CEast Asian ideograph +6390East Asian ideograph +63ADEast Asian ideograph +636DEast Asian ideograph +63DEEast Asian ideograph +63E5East Asian ideograph +63D3East Asian ideograph +63BDEast Asian ideograph +63C3East Asian ideograph +63F5East Asian ideograph +63E6East Asian ideograph +63E0East Asian ideograph +63D5East Asian ideograph +63F6East Asian ideograph +63F2East Asian ideograph +63F8East Asian ideograph +E9E8East Asian ideograph not in Unicode +63F9East Asian ideograph +63BEEast Asian ideograph +63EBEast Asian ideograph +63DDEast Asian ideograph +E9E9East Asian ideograph not in Unicode +63C4East Asian ideograph +63DCEast Asian ideograph +63D7East Asian ideograph +6412East Asian ideograph +6410East Asian ideograph +6434East Asian ideograph +641BEast Asian ideograph +6420East Asian ideograph +6424East Asian ideograph +6426East Asian ideograph +640CEast Asian ideograph +6415East Asian ideograph +6418East Asian ideograph +640EEast Asian ideograph +EA03East Asian ideography not found in unified han +6422East Asian ideograph +6421East Asian ideograph +6430East Asian ideograph +6441East Asian ideograph +6435East Asian ideograph +6409East Asian ideograph +640AEast Asian ideograph +6440East Asian ideograph +6407East Asian ideograph +643BEast Asian ideograph +643FEast Asian ideograph +645BEast Asian ideograph +644FEast Asian ideograph +646BEast Asian ideograph +6476East Asian ideograph +6474East Asian ideograph +647DEast Asian ideograph +6473East Asian ideograph +644EEast Asian ideograph +6464East Asian ideograph +6482East Asian ideograph +645EEast Asian ideograph +647BEast Asian ideograph +645CEast Asian ideograph +649DEast Asian ideograph +6499East Asian ideograph +648FEast Asian ideograph +6496East Asian ideograph +64A2East Asian ideograph +6490East Asian ideograph +64B6East Asian ideograph +6498East Asian ideograph +649FEast Asian ideograph +E9EAEast Asian ideograph not in Unicode +64B3East Asian ideograph +64D7East Asian ideograph +64D3East Asian ideograph +64BEEast Asian ideograph +64D0East Asian ideograph +64EFEast Asian ideograph +64E1East Asian ideograph +64E5East Asian ideograph +64EBEast Asian ideograph +64E2East Asian ideograph +64EDEast Asian ideograph +64E4East Asian ideograph +64F7East Asian ideograph +6504East Asian ideograph +64FDEast Asian ideograph +6508East Asian ideograph +6509East Asian ideograph +651AEast Asian ideograph +6516East Asian ideograph +651BEast Asian ideograph +6527East Asian ideograph +6522East Asian ideograph +6529East Asian ideograph +6525East Asian ideograph +652EEast Asian ideograph +6541East Asian ideograph +6538East Asian ideograph +6542East Asian ideograph +6549East Asian ideograph +6554East Asian ideograph +6555East Asian ideograph +6567East Asian ideograph +6561East Asian ideograph +656DEast Asian ideograph +657AEast Asian ideograph +6585East Asian ideograph +658CEast Asian ideograph +6592East Asian ideograph +6595East Asian ideograph +659BEast Asian ideograph +659DEast Asian ideograph +65A0East Asian ideograph +65A8East Asian ideograph +65A6East Asian ideograph +65AEEast Asian ideograph +65B6East Asian ideograph +65B8East Asian ideograph +65BFEast Asian ideograph +65C6East Asian ideograph +65C3East Asian ideograph +65C4East Asian ideograph +65C2East Asian ideograph +65D0East Asian ideograph +65D2East Asian ideograph +65DBEast Asian ideograph +65DCEast Asian ideograph +65DDEast Asian ideograph +65DFEast Asian ideograph +65E1East Asian ideograph +65E4East Asian ideograph +65F4East Asian ideograph +65F0East Asian ideograph +6609East Asian ideograph +65FBEast Asian ideograph +65FCEast Asian ideograph +660AEast Asian ideograph +6603East Asian ideograph +6611East Asian ideograph +6615East Asian ideograph +6604East Asian ideograph +6631East Asian ideograph +6621East Asian ideograph +662CEast Asian ideograph +6635East Asian ideograph +661EEast Asian ideograph +663AEast Asian ideograph +6633East Asian ideograph +662BEast Asian ideograph +6634East Asian ideograph +6624East Asian ideograph +6645East Asian ideograph +665FEast Asian ideograph +6665East Asian ideograph +665CEast Asian ideograph +6661East Asian ideograph +665BEast Asian ideograph +6659East Asian ideograph +6667East Asian ideograph +665EEast Asian ideograph +6657East Asian ideograph +667EEast Asian ideograph +666CEast Asian ideograph +6678East Asian ideograph +6673East Asian ideograph +666DEast Asian ideograph +6677East Asian ideograph +6684East Asian ideograph +668CEast Asian ideograph +6693East Asian ideograph +668BEast Asian ideograph +6690East Asian ideograph +6694East Asian ideograph +668AEast Asian ideograph +6698East Asian ideograph +668DEast Asian ideograph +7A25East Asian ideograph +66A0East Asian ideograph +5C21East Asian ideograph +669DEast Asian ideograph +66B2East Asian ideograph +66B5East Asian ideograph +66AAEast Asian ideograph +66ACEast Asian ideograph +66B1East Asian ideograph +66C8East Asian ideograph +66BEEast Asian ideograph +66C0East Asian ideograph +66C7East Asian ideograph +66BBEast Asian ideograph +66C4East Asian ideograph +66CFEast Asian ideograph +66DAEast Asian ideograph +66DBEast Asian ideograph +66E2East Asian ideograph +66E1East Asian ideograph +66E8East Asian ideograph +66E9East Asian ideograph +6705East Asian ideograph +670FEast Asian ideograph +6710East Asian ideograph +6712East Asian ideograph +6713East Asian ideograph +6719East Asian ideograph +6718East Asian ideograph +6723East Asian ideograph +673EEast Asian ideograph +673FEast Asian ideograph +6757East Asian ideograph +6745East Asian ideograph +6747East Asian ideograph +675DEast Asian ideograph +6755East Asian ideograph +674CEast Asian ideograph +6759East Asian ideograph +6748East Asian ideograph +6763East Asian ideograph +6753East Asian ideograph +674AEast Asian ideograph +6793East Asian ideograph +677CEast Asian ideograph +679FEast Asian ideograph +6785East Asian ideograph +677BEast Asian ideograph +6792East Asian ideograph +6776East Asian ideograph +6791East Asian ideograph +6799East Asian ideograph +67A4East Asian ideograph +678FEast Asian ideograph +6772East Asian ideograph +E9636798Variant of 4C3B31 which maps to 6798 +676AEast Asian ideograph +67ACEast Asian ideograph +67A0East Asian ideograph +67A1East Asian ideograph +67F9East Asian ideograph +678DEast Asian ideograph +678CEast Asian ideograph +67FCEast Asian ideograph +6810East Asian ideograph +67C8East Asian ideograph +67CCEast Asian ideograph +67C5East Asian ideograph +67BBEast Asian ideograph +67B0East Asian ideograph +6803East Asian ideograph +67F8East Asian ideograph +67D8East Asian ideograph +67B7East Asian ideograph +6802East Asian ideograph +67E4East Asian ideograph +67D9East Asian ideograph +67DBEast Asian ideograph +67B5East Asian ideograph +67DFEast Asian ideograph +67F7East Asian ideograph +67B3East Asian ideograph +6806East Asian ideograph +67AEEast Asian ideograph +67F6East Asian ideograph +67EEEast Asian ideograph +6AAFEast Asian ideograph +67B2East Asian ideograph +67B9East Asian ideograph +67C2East Asian ideograph +67E3East Asian ideograph +67CAEast Asian ideograph +67CEEast Asian ideograph +67E2East Asian ideograph +67F2East Asian ideograph +67C3East Asian ideograph +67DDEast Asian ideograph +67E7East Asian ideograph +6849East Asian ideograph +683EEast Asian ideograph +6814East Asian ideograph +684BEast Asian ideograph +681EEast Asian ideograph +6833East Asian ideograph +6831East Asian ideograph +6832East Asian ideograph +6835East Asian ideograph +683BEast Asian ideograph +684EEast Asian ideograph +682BEast Asian ideograph +682DEast Asian ideograph +684DEast Asian ideograph +6844East Asian ideograph +685DEast Asian ideograph +685EEast Asian ideograph +6834East Asian ideograph +6812East Asian ideograph +685AEast Asian ideograph +686BEast Asian ideograph +686CEast Asian ideograph +6879East Asian ideograph +68B2East Asian ideograph +689BEast Asian ideograph +687EEast Asian ideograph +68B6East Asian ideograph +6882East Asian ideograph +6890East Asian ideograph +6872East Asian ideograph +689CEast Asian ideograph +686DEast Asian ideograph +68A9East Asian ideograph +6898East Asian ideograph +688BEast Asian ideograph +68A0East Asian ideograph +686FEast Asian ideograph +68A3East Asian ideograph +6874East Asian ideograph +6875East Asian ideograph +6877East Asian ideograph +688FEast Asian ideograph +687BEast Asian ideograph +688EEast Asian ideograph +68B4East Asian ideograph +692CEast Asian ideograph +6917East Asian ideograph +690CEast Asian ideograph +690BEast Asian ideograph +68D3East Asian ideograph +6904East Asian ideograph +690AEast Asian ideograph +6909East Asian ideograph +6929East Asian ideograph +68ECEast Asian ideograph +692AEast Asian ideograph +68EAEast Asian ideograph +681FEast Asian ideograph +7439East Asian ideograph +6910East Asian ideograph +68D6East Asian ideograph +68EBEast Asian ideograph +68F1East Asian ideograph +68FDEast Asian ideograph +68FCEast Asian ideograph +68F3East Asian ideograph +6913East Asian ideograph +6907East Asian ideograph +691AEast Asian ideograph +6919East Asian ideograph +68DEEast Asian ideograph +691BEast Asian ideograph +68FBEast Asian ideograph +68E1East Asian ideograph +68D1East Asian ideograph +68D0East Asian ideograph +6908East Asian ideograph +68E8East Asian ideograph +68F0East Asian ideograph +68C3East Asian ideograph +6911East Asian ideograph +68D4East Asian ideograph +68EFEast Asian ideograph +68C6East Asian ideograph +68C7East Asian ideograph +6974East Asian ideograph +6938East Asian ideograph +6962East Asian ideograph +6958East Asian ideograph +6957East Asian ideograph +693FEast Asian ideograph +6971East Asian ideograph +6945East Asian ideograph +695DEast Asian ideograph +6932East Asian ideograph +696EEast Asian ideograph +6963East Asian ideograph +6948East Asian ideograph +6939East Asian ideograph +696AEast Asian ideograph +6937East Asian ideograph +696CEast Asian ideograph +694EEast Asian ideograph +6980East Asian ideograph +6933East Asian ideograph +6952East Asian ideograph +695BEast Asian ideograph +6985East Asian ideograph +693DEast Asian ideograph +6978East Asian ideograph +697BEast Asian ideograph +6934East Asian ideograph +6969East Asian ideograph +6944East Asian ideograph +696FEast Asian ideograph +698AEast Asian ideograph +69A0East Asian ideograph +69B1East Asian ideograph +69CEEast Asian ideograph +69CAEast Asian ideograph +698DEast Asian ideograph +6991East Asian ideograph +69AAEast Asian ideograph +69BCEast Asian ideograph +69A7East Asian ideograph +699EEast Asian ideograph +69D9East Asian ideograph +698EEast Asian ideograph +69D6East Asian ideograph +69A5East Asian ideograph +69BEEast Asian ideograph +69D1East Asian ideograph +69F6East Asian ideograph +69D5East Asian ideograph +69BFEast Asian ideograph +69A3East Asian ideograph +69A4East Asian ideograph +69D4East Asian ideograph +69C3East Asian ideograph +6A12East Asian ideograph +6A11East Asian ideograph +6A00East Asian ideograph +69E6East Asian ideograph +6A0BEast Asian ideograph +69E5East Asian ideograph +69E9East Asian ideograph +69FCEast Asian ideograph +6A17East Asian ideograph +69E7East Asian ideograph +69EBEast Asian ideograph +69F1East Asian ideograph +6A2BEast Asian ideograph +69FFEast Asian ideograph +6A20East Asian ideograph +69EDEast Asian ideograph +6A1BEast Asian ideograph +6A2DEast Asian ideograph +6A18East Asian ideograph +6A1DEast Asian ideograph +6A0CEast Asian ideograph +6A0FEast Asian ideograph +69EEEast Asian ideograph +69F0East Asian ideograph +69F2East Asian ideograph +6A14East Asian ideograph +6A63East Asian ideograph +6A67East Asian ideograph +6A43East Asian ideograph +6A33East Asian ideograph +6A32East Asian ideograph +6A5AEast Asian ideograph +6A28East Asian ideograph +6A48East Asian ideograph +6A50East Asian ideograph +6A52East Asian ideograph +6A72East Asian ideograph +6A3EEast Asian ideograph +6A77East Asian ideograph +6A5BEast Asian ideograph +6A5EEast Asian ideograph +6A5CEast Asian ideograph +6A51East Asian ideograph +6A56East Asian ideograph +6A36East Asian ideograph +6A7AEast Asian ideograph +6A3FEast Asian ideograph +69F9East Asian ideograph +6A64East Asian ideograph +6A8DEast Asian ideograph +6AA8East Asian ideograph +6AA5East Asian ideograph +6A96East Asian ideograph +6A7DEast Asian ideograph +6A7FEast Asian ideograph +6A89East Asian ideograph +6A91East Asian ideograph +6A9FEast Asian ideograph +6A92East Asian ideograph +6AA3East Asian ideograph +6A99East Asian ideograph +6A9DEast Asian ideograph +6A7EEast Asian ideograph +6A9BEast Asian ideograph +6AA0East Asian ideograph +6A90East Asian ideograph +6A9EEast Asian ideograph +6A87East Asian ideograph +6A8EEast Asian ideograph +6AABEast Asian ideograph +6AC8East Asian ideograph +6AAEEast Asian ideograph +6ABFEast Asian ideograph +6ACAEast Asian ideograph +6AB4East Asian ideograph +6AE6East Asian ideograph +6AEDEast Asian ideograph +6ACCEast Asian ideograph +6AD1East Asian ideograph +6ADFEast Asian ideograph +6ACDEast Asian ideograph +6ADEEast Asian ideograph +6AECEast Asian ideograph +6AF3East Asian ideograph +6AE7East Asian ideograph +6AEBEast Asian ideograph +6AEAEast Asian ideograph +6AF1East Asian ideograph +6AE8East Asian ideograph +6AF5East Asian ideograph +6AFDEast Asian ideograph +6AFAEast Asian ideograph +6B01East Asian ideograph +6B03East Asian ideograph +6AF8East Asian ideograph +6B0DEast Asian ideograph +6B09East Asian ideograph +6B0EEast Asian ideograph +6B11East Asian ideograph +6B19East Asian ideograph +6B17East Asian ideograph +6B1EEast Asian ideograph +6B2CEast Asian ideograph +6B35East Asian ideograph +6B37East Asian ideograph +6B3BEast Asian ideograph +6B39East Asian ideograph +6B3FEast Asian ideograph +6B46East Asian ideograph +6B41East Asian ideograph +6B40East Asian ideograph +6B42East Asian ideograph +6B43East Asian ideograph +6B48East Asian ideograph +6B4AEast Asian ideograph +E9646B4EVariant of 4C4446 which maps to 6B4E +6B57East Asian ideograph +6B54East Asian ideograph +6B55East Asian ideograph +6B5CEast Asian ideograph +6B5EEast Asian ideograph +6B60East Asian ideograph +6B6BEast Asian ideograph +6B6CEast Asian ideograph +6B6EEast Asian ideograph +6B71East Asian ideograph +6B7EEast Asian ideograph +6B82East Asian ideograph +6B84East Asian ideograph +6B8DEast Asian ideograph +6B95East Asian ideograph +6B99East Asian ideograph +6B9BEast Asian ideograph +6BA3East Asian ideograph +6BA2East Asian ideograph +6BAAEast Asian ideograph +6BABEast Asian ideograph +6BADEast Asian ideograph +6BB0East Asian ideograph +6BB3East Asian ideograph +6BBDEast Asian ideograph +6996East Asian ideograph +6BC8East Asian ideograph +6BD6East Asian ideograph +6BDAEast Asian ideograph +6BDCEast Asian ideograph +6BDDEast Asian ideograph +6BDFEast Asian ideograph +6BE7East Asian ideograph +6BEAEast Asian ideograph +6BE8East Asian ideograph +6BF6East Asian ideograph +6BF3East Asian ideograph +6BF8East Asian ideograph +6BFAEast Asian ideograph +6BF9East Asian ideograph +6BFFEast Asian ideograph +6C06East Asian ideograph +6C04East Asian ideograph +6C05East Asian ideograph +6C08East Asian ideograph +6C0CEast Asian ideograph +6C0DEast Asian ideograph +6C15East Asian ideograph +6C18East Asian ideograph +6C19East Asian ideograph +6C1AEast Asian ideograph +6C1DEast Asian ideograph +6C20East Asian ideograph +6C21East Asian ideograph +6C2AEast Asian ideograph +6C2DEast Asian ideograph +6C30East Asian ideograph +6C2CEast Asian ideograph +E9EBEast Asian ideograph not in Unicode +6C3BEast Asian ideograph +6C3FEast Asian ideograph +6C46East Asian ideograph +6C52East Asian ideograph +6C62East Asian ideograph +6C4AEast Asian ideograph +6C5CEast Asian ideograph +6C5BEast Asian ideograph +6C4DEast Asian ideograph +6C4BEast Asian ideograph +6C54East Asian ideograph +6C63East Asian ideograph +6C78East Asian ideograph +6C74East Asian ideograph +6C86East Asian ideograph +6C76East Asian ideograph +6C6CEast Asian ideograph +6C67East Asian ideograph +6C84East Asian ideograph +6C94East Asian ideograph +6C8FEast Asian ideograph +6C65East Asian ideograph +6C6FEast Asian ideograph +6C9DEast Asian ideograph +6C69East Asian ideograph +6C9AEast Asian ideograph +6C6DEast Asian ideograph +6C93East Asian ideograph +6C87East Asian ideograph +6C6EEast Asian ideograph +6C95East Asian ideograph +6C82East Asian ideograph +6CA0East Asian ideograph +6CEBEast Asian ideograph +6CEEEast Asian ideograph +6CC0East Asian ideograph +6CEFEast Asian ideograph +6CACEast Asian ideograph +E9656CADVariant of 4C476E which maps to 6CAD +6CAFEast Asian ideograph +6CF5East Asian ideograph +6CBAEast Asian ideograph +7553East Asian ideograph +6CC2East Asian ideograph +6CD8East Asian ideograph +6CC6East Asian ideograph +6CCEEast Asian ideograph +6CE9East Asian ideograph +6CF2East Asian ideograph +6CE0East Asian ideograph +6CD1East Asian ideograph +6CD2East Asian ideograph +6CB4East Asian ideograph +6D1DEast Asian ideograph +6D28East Asian ideograph +6D39East Asian ideograph +6D26East Asian ideograph +6D27East Asian ideograph +6D0FEast Asian ideograph +6D0AEast Asian ideograph +6D3FEast Asian ideograph +6D07East Asian ideograph +6D04East Asian ideograph +6CDAEast Asian ideograph +6D2EEast Asian ideograph +6D35East Asian ideograph +6D3AEast Asian ideograph +6D19East Asian ideograph +6D0EEast Asian ideograph +6D2BEast Asian ideograph +6D11East Asian ideograph +6D00East Asian ideograph +6D24East Asian ideograph +6D33East Asian ideograph +6D63East Asian ideograph +6DA5East Asian ideograph +6D92East Asian ideograph +6D6DEast Asian ideograph +6D6FEast Asian ideograph +6D61East Asian ideograph +6D91East Asian ideograph +6D81East Asian ideograph +6D8AEast Asian ideograph +E9666D34Variant of 34492F which maps to 6D34 +6D79East Asian ideograph +6DEFEast Asian ideograph +6D7FEast Asian ideograph +6D85East Asian ideograph +6D65East Asian ideograph +6D5EEast Asian ideograph +6D67East Asian ideograph +6D94East Asian ideograph +6D60East Asian ideograph +6D98East Asian ideograph +6D7CEast Asian ideograph +6D70East Asian ideograph +6D96East Asian ideograph +6DABEast Asian ideograph +6DB4East Asian ideograph +6DAAEast Asian ideograph +6DECEast Asian ideograph +6DACEast Asian ideograph +6DB7East Asian ideograph +6DE2East Asian ideograph +6DD5East Asian ideograph +6DE9East Asian ideograph +6DF6East Asian ideograph +6E0FEast Asian ideograph +6DBFEast Asian ideograph +6DDFEast Asian ideograph +6DD3East Asian ideograph +6DFCEast Asian ideograph +6DDDEast Asian ideograph +6DDCEast Asian ideograph +6DDBEast Asian ideograph +6DA4East Asian ideograph +6E12East Asian ideograph +6DF0East Asian ideograph +6DE6East Asian ideograph +6E1FEast Asian ideograph +6E27East Asian ideograph +6E49East Asian ideograph +6E3CEast Asian ideograph +6E8AEast Asian ideograph +6E4BEast Asian ideograph +6E62East Asian ideograph +6E51East Asian ideograph +6E44East Asian ideograph +6E63East Asian ideograph +6E73East Asian ideograph +6E4FEast Asian ideograph +6E4EEast Asian ideograph +6E28East Asian ideograph +6E5CEast Asian ideograph +6E31East Asian ideograph +6E5EEast Asian ideograph +6E84East Asian ideograph +6E2EEast Asian ideograph +6E36East Asian ideograph +6E5DEast Asian ideograph +6E72East Asian ideograph +6E30East Asian ideograph +6E53East Asian ideograph +6E39East Asian ideograph +6E71East Asian ideograph +6E69East Asian ideograph +6E6BEast Asian ideograph +6E8BEast Asian ideograph +6E76East Asian ideograph +6E2AEast Asian ideograph +6E4CEast Asian ideograph +6E22East Asian ideograph +6ECEEast Asian ideograph +6E9BEast Asian ideograph +6E9FEast Asian ideograph +6EC8East Asian ideograph +6ED8East Asian ideograph +6E8FEast Asian ideograph +6E93East Asian ideograph +6EA0East Asian ideograph +6EB1East Asian ideograph +6EA8East Asian ideograph +6E92East Asian ideograph +6EA7East Asian ideograph +6E8EEast Asian ideograph +6ED9East Asian ideograph +6EBDEast Asian ideograph +6EC1East Asian ideograph +6EBBEast Asian ideograph +6EC9East Asian ideograph +6EB3East Asian ideograph +6EB7East Asian ideograph +6EA4East Asian ideograph +6ECFEast Asian ideograph +6ECAEast Asian ideograph +6ED5East Asian ideograph +6EC3East Asian ideograph +6EB4East Asian ideograph +6EB2East Asian ideograph +6EB5East Asian ideograph +6EF8East Asian ideograph +6F37East Asian ideograph +6EFDEast Asian ideograph +6F09East Asian ideograph +6F3BEast Asian ideograph +6F63East Asian ideograph +6F12East Asian ideograph +6F26East Asian ideograph +6F1AEast Asian ideograph +6EF6East Asian ideograph +6F19East Asian ideograph +6F00East Asian ideograph +6F24East Asian ideograph +6F18East Asian ideograph +6F1FEast Asian ideograph +6F0AEast Asian ideograph +6F36East Asian ideograph +6EF9East Asian ideograph +6EEEEast Asian ideograph +6F41East Asian ideograph +6F95East Asian ideograph +6F2DEast Asian ideograph +6F34East Asian ideograph +6F49East Asian ideograph +6F30East Asian ideograph +6EFAEast Asian ideograph +6EEBEast Asian ideograph +6F08East Asian ideograph +6F0EEast Asian ideograph +6F35East Asian ideograph +6F7EEast Asian ideograph +6F9DEast Asian ideograph +6F87East Asian ideograph +6F6FEast Asian ideograph +6F5AEast Asian ideograph +6F60East Asian ideograph +6F90East Asian ideograph +6F8DEast Asian ideograph +6F92East Asian ideograph +6F89East Asian ideograph +6F8CEast Asian ideograph +E9676F62Variant of 4C4D3D which maps to 6F62 +6F0BEast Asian ideograph +6F6CEast Asian ideograph +6F8BEast Asian ideograph +6E88East Asian ideograph +6F55East Asian ideograph +6F72East Asian ideograph +6F57East Asian ideograph +6F5FEast Asian ideograph +6F5DEast Asian ideograph +6FB6East Asian ideograph +6F9FEast Asian ideograph +6FA6East Asian ideograph +6FC6East Asian ideograph +6FBCEast Asian ideograph +6FAAEast Asian ideograph +6FBFEast Asian ideograph +6FC7East Asian ideograph +6FC9East Asian ideograph +6F5EEast Asian ideograph +6FC8East Asian ideograph +6FA0East Asian ideograph +6FCAEast Asian ideograph +6FB4East Asian ideograph +6FAFEast Asian ideograph +6FA8East Asian ideograph +6FA5East Asian ideograph +6FB0East Asian ideograph +6FAEEast Asian ideograph +6FD9East Asian ideograph +6FDAEast Asian ideograph +6FD4East Asian ideograph +6FE9East Asian ideograph +6FF8East Asian ideograph +6FDEEast Asian ideograph +6FEEEast Asian ideograph +6FF0East Asian ideograph +7005East Asian ideograph +700CEast Asian ideograph +700DEast Asian ideograph +7026East Asian ideograph +7020East Asian ideograph +7027East Asian ideograph +E968701EVariant of 4C4F2B which maps to 701E +702EEast Asian ideograph +702DEast Asian ideograph +7021East Asian ideograph +7018East Asian ideograph +7023East Asian ideograph +703CEast Asian ideograph +7035East Asian ideograph +7034East Asian ideograph +7039East Asian ideograph +703AEast Asian ideograph +7043East Asian ideograph +7044East Asian ideograph +7047East Asian ideograph +7049East Asian ideograph +7055East Asian ideograph +7052East Asian ideograph +705CEast Asian ideograph +7059East Asian ideograph +705EEast Asian ideograph +7061East Asian ideograph +705DEast Asian ideograph +9E02East Asian ideograph +7066East Asian ideograph +7065East Asian ideograph +7068East Asian ideograph +7054East Asian ideograph +7074East Asian ideograph +707AEast Asian ideograph +7093East Asian ideograph +7086East Asian ideograph +E9ECEast Asian ideograph not in Unicode +7084East Asian ideograph +7081East Asian ideograph +7088East Asian ideograph +7098East Asian ideograph +708CEast Asian ideograph +70B7East Asian ideograph +70A1East Asian ideograph +70A3East Asian ideograph +7551East Asian ideograph +70A7East Asian ideograph +79CCEast Asian ideograph +70B5East Asian ideograph +70BFEast Asian ideograph +70A9East Asian ideograph +70EAEast Asian ideograph +70E5East Asian ideograph +70DCEast Asian ideograph +70D3East Asian ideograph +70DDEast Asian ideograph +70E1East Asian ideograph +70E3East Asian ideograph +70E0East Asian ideograph +70D4East Asian ideograph +70D1East Asian ideograph +70CBEast Asian ideograph +70D0East Asian ideograph +70C7East Asian ideograph +70DAEast Asian ideograph +70C6East Asian ideograph +70FAEast Asian ideograph +70F7East Asian ideograph +7104East Asian ideograph +70F3East Asian ideograph +7110East Asian ideograph +7103East Asian ideograph +70F4East Asian ideograph +7111East Asian ideograph +7112East Asian ideograph +710CEast Asian ideograph +70F6East Asian ideograph +7113East Asian ideograph +70EFEast Asian ideograph +7100East Asian ideograph +711EEast Asian ideograph +7134East Asian ideograph +7120East Asian ideograph +713FEast Asian ideograph +7131East Asian ideograph +712DEast Asian ideograph +7139East Asian ideograph +7135East Asian ideograph +713BEast Asian ideograph +711CEast Asian ideograph +713DEast Asian ideograph +712FEast Asian ideograph +7129East Asian ideograph +712EEast Asian ideograph +7177East Asian ideograph +7146East Asian ideograph +7152East Asian ideograph +714FEast Asian ideograph +715DEast Asian ideograph +7141East Asian ideograph +7160East Asian ideograph +7175East Asian ideograph +7173East Asian ideograph +7143East Asian ideograph +715AEast Asian ideograph +7176East Asian ideograph +714BEast Asian ideograph +7147East Asian ideograph +7168East Asian ideograph +7171East Asian ideograph +715FEast Asian ideograph +7150East Asian ideograph +7153East Asian ideograph +7144East Asian ideograph +7172East Asian ideograph +7178East Asian ideograph +7187East Asian ideograph +717BEast Asian ideograph +7192East Asian ideograph +7180East Asian ideograph +7189East Asian ideograph +7185East Asian ideograph +7196East Asian ideograph +717CEast Asian ideograph +7198East Asian ideograph +7197East Asian ideograph +71B5East Asian ideograph +71A9East Asian ideograph +71A5East Asian ideograph +719EEast Asian ideograph +71B2East Asian ideograph +719BEast Asian ideograph +71AFEast Asian ideograph +71A4East Asian ideograph +71A0East Asian ideograph +719AEast Asian ideograph +71B3East Asian ideograph +71B4East Asian ideograph +71D1East Asian ideograph +71C7East Asian ideograph +71B7East Asian ideograph +71CAEast Asian ideograph +71CFEast Asian ideograph +71D6East Asian ideograph +71BAEast Asian ideograph +71C2East Asian ideograph +71C5East Asian ideograph +71BFEast Asian ideograph +71B8East Asian ideograph +71DDEast Asian ideograph +71C0East Asian ideograph +71C1East Asian ideograph +71D4East Asian ideograph +71CBEast Asian ideograph +71DEEast Asian ideograph +71EBEast Asian ideograph +71E8East Asian ideograph +71F5East Asian ideograph +71F3East Asian ideograph +71E1East Asian ideograph +71E0East Asian ideograph +720CEast Asian ideograph +71FCEast Asian ideograph +71F9East Asian ideograph +720EEast Asian ideograph +5911East Asian ideograph +720AEast Asian ideograph +7217East Asian ideograph +7207East Asian ideograph +7215East Asian ideograph +7213East Asian ideograph +7218East Asian ideograph +720BEast Asian ideograph +721AEast Asian ideograph +721FEast Asian ideograph +721DEast Asian ideograph +7225East Asian ideograph +7226East Asian ideograph +723FEast Asian ideograph +7241East Asian ideograph +7242East Asian ideograph +7250East Asian ideograph +724FEast Asian ideograph +7253East Asian ideograph +7255East Asian ideograph +725AEast Asian ideograph +7263East Asian ideograph +7273East Asian ideograph +726EEast Asian ideograph +7276East Asian ideograph +7277East Asian ideograph +727EEast Asian ideograph +727CEast Asian ideograph +727FEast Asian ideograph +7289East Asian ideograph +728BEast Asian ideograph +728DEast Asian ideograph +728FEast Asian ideograph +72A8East Asian ideograph +72ABEast Asian ideograph +72B0East Asian ideograph +72B4East Asian ideograph +72C6East Asian ideograph +72B5East Asian ideograph +72BCEast Asian ideograph +72C3East Asian ideograph +72C1East Asian ideograph +72D6East Asian ideograph +72D2East Asian ideograph +72C9East Asian ideograph +72CCEast Asian ideograph +72DBEast Asian ideograph +72CDEast Asian ideograph +72E8East Asian ideograph +72EBEast Asian ideograph +72E5East Asian ideograph +72FAEast Asian ideograph +72F4East Asian ideograph +72FEEast Asian ideograph +7302East Asian ideograph +72FBEast Asian ideograph +7301East Asian ideograph +72F3East Asian ideograph +731DEast Asian ideograph +730BEast Asian ideograph +7317East Asian ideograph +7307East Asian ideograph +7318East Asian ideograph +731EEast Asian ideograph +7331East Asian ideograph +7338East Asian ideograph +7322East Asian ideograph +7332East Asian ideograph +732CEast Asian ideograph +7327East Asian ideograph +732BEast Asian ideograph +732FEast Asian ideograph +7328East Asian ideograph +7347East Asian ideograph +7348East Asian ideograph +7349East Asian ideograph +733BEast Asian ideograph +733AEast Asian ideograph +7340East Asian ideograph +734DEast Asian ideograph +7352East Asian ideograph +735EEast Asian ideograph +735DEast Asian ideograph +7360East Asian ideograph +7358East Asian ideograph +7362East Asian ideograph +734BEast Asian ideograph +7367East Asian ideograph +736CEast Asian ideograph +736BEast Asian ideograph +736FEast Asian ideograph +737CEast Asian ideograph +737EEast Asian ideograph +7381East Asian ideograph +7388East Asian ideograph +738EEast Asian ideograph +7395East Asian ideograph +7392East Asian ideograph +7397East Asian ideograph +7393East Asian ideograph +7394East Asian ideograph +739EEast Asian ideograph +73A6East Asian ideograph +73A5East Asian ideograph +73A2East Asian ideograph +73A0East Asian ideograph +73B6East Asian ideograph +73CFEast Asian ideograph +73C2East Asian ideograph +73D0East Asian ideograph +73BFEast Asian ideograph +73C8East Asian ideograph +73CCEast Asian ideograph +73D3East Asian ideograph +73EAEast Asian ideograph +73E5East Asian ideograph +73D9East Asian ideograph +73EFEast Asian ideograph +73D4East Asian ideograph +73DBEast Asian ideograph +73D6East Asian ideograph +73BCEast Asian ideograph +73E7East Asian ideograph +73E3East Asian ideograph +73DEEast Asian ideograph +73E6East Asian ideograph +73E9East Asian ideograph +73F6East Asian ideograph +73FAEast Asian ideograph +73F8East Asian ideograph +73F5East Asian ideograph +73FDEast Asian ideograph +7407East Asian ideograph +7412East Asian ideograph +743CEast Asian ideograph +742EEast Asian ideograph +742FEast Asian ideograph +7414East Asian ideograph +742CEast Asian ideograph +7430East Asian ideograph +742BEast Asian ideograph +73F7East Asian ideograph +741AEast Asian ideograph +7416East Asian ideograph +7426East Asian ideograph +7428East Asian ideograph +7429East Asian ideograph +7420East Asian ideograph +741BEast Asian ideograph +7424East Asian ideograph +7432East Asian ideograph +742DEast Asian ideograph +7415East Asian ideograph +743BEast Asian ideograph +7444East Asian ideograph +7447East Asian ideograph +7458East Asian ideograph +7442East Asian ideograph +744BEast Asian ideograph +744AEast Asian ideograph +7452East Asian ideograph +7457East Asian ideograph +7451East Asian ideograph +745DEast Asian ideograph +7454East Asian ideograph +7440East Asian ideograph +746DEast Asian ideograph +7462East Asian ideograph +7473East Asian ideograph +7474East Asian ideograph +746EEast Asian ideograph +7471East Asian ideograph +7468East Asian ideograph +7460East Asian ideograph +7472East Asian ideograph +7484East Asian ideograph +7487East Asian ideograph +7488East Asian ideograph +7489East Asian ideograph +747CEast Asian ideograph +7482East Asian ideograph +747EEast Asian ideograph +748AEast Asian ideograph +7486East Asian ideograph +747AEast Asian ideograph +7480East Asian ideograph +7481East Asian ideograph +747DEast Asian ideograph +7485East Asian ideograph +7497East Asian ideograph +7498East Asian ideograph +749AEast Asian ideograph +74A4East Asian ideograph +749FEast Asian ideograph +749DEast Asian ideograph +748DEast Asian ideograph +749EEast Asian ideograph +74A0East Asian ideograph +74A1East Asian ideograph +74B2East Asian ideograph +74B1East Asian ideograph +74B4East Asian ideograph +74ABEast Asian ideograph +74AAEast Asian ideograph +7490East Asian ideograph +74A5East Asian ideograph +74A8East Asian ideograph +74B8East Asian ideograph +74C0East Asian ideograph +74BFEast Asian ideograph +74B5East Asian ideograph +74BAEast Asian ideograph +74C8East Asian ideograph +74C5East Asian ideograph +74CCEast Asian ideograph +74D6East Asian ideograph +74D4East Asian ideograph +74D8East Asian ideograph +74DAEast Asian ideograph +74DBEast Asian ideograph +74DEEast Asian ideograph +74E4East Asian ideograph +74E7East Asian ideograph +74E9East Asian ideograph +74F1East Asian ideograph +74F0East Asian ideograph +74EEEast Asian ideograph +74F4East Asian ideograph +74F8East Asian ideograph +74FBEast Asian ideograph +74FFEast Asian ideograph +7505East Asian ideograph +7503East Asian ideograph +7507East Asian ideograph +750EEast Asian ideograph +750DEast Asian ideograph +7511East Asian ideograph +750FEast Asian ideograph +7512East Asian ideograph +7513East Asian ideograph +7517East Asian ideograph +7521East Asian ideograph +7524East Asian ideograph +752FEast Asian ideograph +753AEast Asian ideograph +753FEast Asian ideograph +7540East Asian ideograph +753EEast Asian ideograph +754AEast Asian ideograph +754EEast Asian ideograph +7547East Asian ideograph +754BEast Asian ideograph +7548East Asian ideograph +755FEast Asian ideograph +755BEast Asian ideograph +7564East Asian ideograph +7563East Asian ideograph +756FEast Asian ideograph +756CEast Asian ideograph +7579East Asian ideograph +757AEast Asian ideograph +7577East Asian ideograph +7571East Asian ideograph +757DEast Asian ideograph +757FEast Asian ideograph +7583East Asian ideograph +7590East Asian ideograph +7592East Asian ideograph +7594East Asian ideograph +7595East Asian ideograph +7598East Asian ideograph +75A2East Asian ideograph +75A3East Asian ideograph +75BAEast Asian ideograph +75B0East Asian ideograph +75C3East Asian ideograph +75BFEast Asian ideograph +75B4East Asian ideograph +75C2East Asian ideograph +75C1East Asian ideograph +75B1East Asian ideograph +75C4East Asian ideograph +75CDEast Asian ideograph +75CFEast Asian ideograph +75CCEast Asian ideograph +75D0East Asian ideograph +75E7East Asian ideograph +75E1East Asian ideograph +75E6East Asian ideograph +75E4East Asian ideograph +75E0East Asian ideograph +75D7East Asian ideograph +7602East Asian ideograph +7603East Asian ideograph +75F9East Asian ideograph +75FCEast Asian ideograph +7616East Asian ideograph +7608East Asian ideograph +7615East Asian ideograph +760CEast Asian ideograph +760FEast Asian ideograph +7610East Asian ideograph +760AEast Asian ideograph +7625East Asian ideograph +761AEast Asian ideograph +761BEast Asian ideograph +7619East Asian ideograph +761EEast Asian ideograph +761DEast Asian ideograph +7622East Asian ideograph +762FEast Asian ideograph +762DEast Asian ideograph +7633East Asian ideograph +763BEast Asian ideograph +7630East Asian ideograph +763CEast Asian ideograph +7635East Asian ideograph +7648East Asian ideograph +764EEast Asian ideograph +7647East Asian ideograph +7643East Asian ideograph +764DEast Asian ideograph +7649East Asian ideograph +7654East Asian ideograph +765CEast Asian ideograph +7657East Asian ideograph +7664East Asian ideograph +7659East Asian ideograph +765FEast Asian ideograph +7667East Asian ideograph +766AEast Asian ideograph +766DEast Asian ideograph +766FEast Asian ideograph +7670East Asian ideograph +7676East Asian ideograph +7677East Asian ideograph +7680East Asian ideograph +768BEast Asian ideograph +7695East Asian ideograph +656BEast Asian ideograph +7699East Asian ideograph +769CEast Asian ideograph +769DEast Asian ideograph +76A4East Asian ideograph +76A5East Asian ideograph +76A6East Asian ideograph +76AAEast Asian ideograph +76ADEast Asian ideograph +76B8East Asian ideograph +76BDEast Asian ideograph +76CBEast Asian ideograph +76CCEast Asian ideograph +76E6East Asian ideograph +76E9East Asian ideograph +76ECEast Asian ideograph +76EDEast Asian ideograph +76F1East Asian ideograph +7704East Asian ideograph +7708East Asian ideograph +7707East Asian ideograph +76F7East Asian ideograph +770AEast Asian ideograph +76FBEast Asian ideograph +772BEast Asian ideograph +770EEast Asian ideograph +771BEast Asian ideograph +7724East Asian ideograph +7722East Asian ideograph +771AEast Asian ideograph +7721East Asian ideograph +7740East Asian ideograph +7739East Asian ideograph +772FEast Asian ideograph +7731East Asian ideograph +7725East Asian ideograph +7735East Asian ideograph +7734East Asian ideograph +7747East Asian ideograph +7745East Asian ideograph +774DEast Asian ideograph +774AEast Asian ideograph +7743East Asian ideograph +774EEast Asian ideograph +775FEast Asian ideograph +7760East Asian ideograph +7752East Asian ideograph +7758East Asian ideograph +7756East Asian ideograph +775AEast Asian ideograph +7762East Asian ideograph +7780East Asian ideograph +776FEast Asian ideograph +777EEast Asian ideograph +7785East Asian ideograph +777AEast Asian ideograph +E969778BVariant of 4C6266 which maps to 778B +778DEast Asian ideograph +7798East Asian ideograph +7796East Asian ideograph +77A2East Asian ideograph +7799East Asian ideograph +77B5East Asian ideograph +77B7East Asian ideograph +77B6East Asian ideograph +77BEEast Asian ideograph +77B9East Asian ideograph +77BCEast Asian ideograph +77CDEast Asian ideograph +77D1East Asian ideograph +77DEEast Asian ideograph +77DFEast Asian ideograph +77E7East Asian ideograph +77E6East Asian ideograph +77ECEast Asian ideograph +77F0East Asian ideograph +77F1East Asian ideograph +77F4East Asian ideograph +77FCEast Asian ideograph +77F8East Asian ideograph +77FBEast Asian ideograph +7809East Asian ideograph +7806East Asian ideograph +7819East Asian ideograph +7811East Asian ideograph +7812East Asian ideograph +781BEast Asian ideograph +782CEast Asian ideograph +7823East Asian ideograph +782BEast Asian ideograph +7829East Asian ideograph +7822East Asian ideograph +7835East Asian ideograph +7833East Asian ideograph +782EEast Asian ideograph +7820East Asian ideograph +783DEast Asian ideograph +781FEast Asian ideograph +7831East Asian ideograph +784DEast Asian ideograph +7848East Asian ideograph +7853East Asian ideograph +7854East Asian ideograph +7845East Asian ideograph +7852East Asian ideograph +7850East Asian ideograph +7858East Asian ideograph +7826East Asian ideograph +7847East Asian ideograph +784CEast Asian ideograph +7868East Asian ideograph +786DEast Asian ideograph +7864East Asian ideograph +785CEast Asian ideograph +7876East Asian ideograph +786AEast Asian ideograph +7886East Asian ideograph +789AEast Asian ideograph +787FEast Asian ideograph +7887East Asian ideograph +7894East Asian ideograph +788FEast Asian ideograph +7899East Asian ideograph +7893East Asian ideograph +7892East Asian ideograph +7896East Asian ideograph +78B2East Asian ideograph +78A1East Asian ideograph +78B6East Asian ideograph +78B7East Asian ideograph +78A4East Asian ideograph +78B4East Asian ideograph +78ADEast Asian ideograph +78A3East Asian ideograph +789EEast Asian ideograph +78A8East Asian ideograph +78ABEast Asian ideograph +78BBEast Asian ideograph +78CCEast Asian ideograph +78C9East Asian ideograph +78D1East Asian ideograph +78D8East Asian ideograph +78C8East Asian ideograph +78D4East Asian ideograph +78DFEast Asian ideograph +78E7East Asian ideograph +78DBEast Asian ideograph +78E1East Asian ideograph +78E0East Asian ideograph +78EEEast Asian ideograph +78E3East Asian ideograph +78F2East Asian ideograph +7905East Asian ideograph +78F9East Asian ideograph +78FDEast Asian ideograph +78FEEast Asian ideograph +78FBEast Asian ideograph +7904East Asian ideograph +7912East Asian ideograph +790CEast Asian ideograph +7913East Asian ideograph +7911East Asian ideograph +791EEast Asian ideograph +7922East Asian ideograph +7924East Asian ideograph +7927East Asian ideograph +7929East Asian ideograph +7931East Asian ideograph +7934East Asian ideograph +7936East Asian ideograph +793DEast Asian ideograph +7942East Asian ideograph +793FEast Asian ideograph +794AEast Asian ideograph +794DEast Asian ideograph +7946East Asian ideograph +7958East Asian ideograph +795BEast Asian ideograph +795CEast Asian ideograph +794FEast Asian ideograph +7953East Asian ideograph +E9D07953Unrelated variant of EACC 22667C which maps to 7953 +7951East Asian ideograph +7954East Asian ideograph +7967East Asian ideograph +796BEast Asian ideograph +7972East Asian ideograph +797CEast Asian ideograph +7998East Asian ideograph +798AEast Asian ideograph +7999East Asian ideograph +7995East Asian ideograph +798BEast Asian ideograph +7996East Asian ideograph +7994East Asian ideograph +7993East Asian ideograph +799AEast Asian ideograph +79A1East Asian ideograph +799BEast Asian ideograph +79A3East Asian ideograph +799DEast Asian ideograph +79A9East Asian ideograph +79ABEast Asian ideograph +79A8East Asian ideograph +79B0East Asian ideograph +79B3East Asian ideograph +79B4East Asian ideograph +79B8East Asian ideograph +79BAEast Asian ideograph +79BCEast Asian ideograph +79C6East Asian ideograph +79C8East Asian ideograph +79D4East Asian ideograph +79D5East Asian ideograph +79D6East Asian ideograph +79ECEast Asian ideograph +E96A79EBVariant of 4C683E which maps to 79EB +79E1East Asian ideograph +79DDEast Asian ideograph +79EDEast Asian ideograph +79F8East Asian ideograph +7A02East Asian ideograph +7A0AEast Asian ideograph +7A09East Asian ideograph +7A03East Asian ideograph +7A0CEast Asian ideograph +7A11East Asian ideograph +7A18East Asian ideograph +E96B7A19Variant of 2E686F which maps to 7A19 +7A1EEast Asian ideograph +7A17East Asian ideograph +7A2DEast Asian ideograph +7A2CEast Asian ideograph +7A48East Asian ideograph +7A4BEast Asian ideograph +7A47East Asian ideograph +7A44East Asian ideograph +7A5CEast Asian ideograph +7A5FEast Asian ideograph +7A60East Asian ideograph +7A6EEast Asian ideograph +7A70East Asian ideograph +7A75East Asian ideograph +7A78East Asian ideograph +7A80East Asian ideograph +7A85East Asian ideograph +7A86East Asian ideograph +7A8AEast Asian ideograph +7A94East Asian ideograph +68A5East Asian ideograph +7AA3East Asian ideograph +7A9EEast Asian ideograph +7AA7East Asian ideograph +7AA8East Asian ideograph +7AACEast Asian ideograph +7AB3East Asian ideograph +7ABDEast Asian ideograph +7AB6East Asian ideograph +7AB8East Asian ideograph +7AB5East Asian ideograph +7ABBEast Asian ideograph +7ABFEast Asian ideograph +7ACDEast Asian ideograph +7ACFEast Asian ideograph +7AD1East Asian ideograph +7AD3East Asian ideograph +7AD4East Asian ideograph +7AD5East Asian ideograph +7ADAEast Asian ideograph +7AE1East Asian ideograph +7AE6East Asian ideograph +7AEBEast Asian ideograph +7AF0East Asian ideograph +7AF5East Asian ideograph +7AFEEast Asian ideograph +7B39East Asian ideograph +7B0FEast Asian ideograph +7B08East Asian ideograph +7B0AEast Asian ideograph +7B35East Asian ideograph +7B25East Asian ideograph +7B38East Asian ideograph +7B3BEast Asian ideograph +7B24East Asian ideograph +7B33East Asian ideograph +7B2AEast Asian ideograph +7B18East Asian ideograph +7B31East Asian ideograph +7B2BEast Asian ideograph +7B37East Asian ideograph +7B1FEast Asian ideograph +7B4AEast Asian ideograph +E9EDEast Asian ideograph not in Unicode +E96C7B04Variant of 2E6B54 which maps to 7B04 +7B47East Asian ideograph +7B58East Asian ideograph +7B6CEast Asian ideograph +7B48East Asian ideograph +7B45East Asian ideograph +7B4CEast Asian ideograph +7B4EEast Asian ideograph +7B66East Asian ideograph +7B64East Asian ideograph +7B69East Asian ideograph +7B6DEast Asian ideograph +7B62East Asian ideograph +7B6EEast Asian ideograph +7B74East Asian ideograph +7B72East Asian ideograph +7B78East Asian ideograph +7B6FEast Asian ideograph +7B67East Asian ideograph +7B65East Asian ideograph +7B71East Asian ideograph +7B70East Asian ideograph +7B73East Asian ideograph +7B9CEast Asian ideograph +7B92East Asian ideograph +7B91East Asian ideograph +7B90East Asian ideograph +7BA3East Asian ideograph +7B8DEast Asian ideograph +7B85East Asian ideograph +7B8EEast Asian ideograph +7B98East Asian ideograph +7B86East Asian ideograph +7B99East Asian ideograph +7BB2East Asian ideograph +7BCBEast Asian ideograph +7BB8East Asian ideograph +7BCFEast Asian ideograph +7BD0East Asian ideograph +7BBEEast Asian ideograph +7BCCEast Asian ideograph +7BDDEast Asian ideograph +7BE5East Asian ideograph +7BE8East Asian ideograph +7BF9East Asian ideograph +7BD4East Asian ideograph +7BDFEast Asian ideograph +7BD8East Asian ideograph +E9D17BEAUnrelated variant of EACC 3A6A7C which maps to 7BEA +7C06East Asian ideograph +7BF0East Asian ideograph +7C0FEast Asian ideograph +7C0BEast Asian ideograph +7C00East Asian ideograph +7C0CEast Asian ideograph +7BF4East Asian ideograph +7BF3East Asian ideograph +7C09East Asian ideograph +7C03East Asian ideograph +7BFCEast Asian ideograph +7C1CEast Asian ideograph +7C26East Asian ideograph +7C28East Asian ideograph +7C20East Asian ideograph +7C1FEast Asian ideograph +7C2FEast Asian ideograph +7C30East Asian ideograph +7C35East Asian ideograph +7C40East Asian ideograph +7C39East Asian ideograph +7C3BEast Asian ideograph +7C34East Asian ideograph +7C42East Asian ideograph +7C4EEast Asian ideograph +7C5DEast Asian ideograph +7C5CEast Asian ideograph +7C5AEast Asian ideograph +7C5BEast Asian ideograph +7C59East Asian ideograph +7C5EEast Asian ideograph +7C67East Asian ideograph +7C63East Asian ideograph +7C68East Asian ideograph +7C65East Asian ideograph +7C6FEast Asian ideograph +7C75East Asian ideograph +7C7EEast Asian ideograph +7C78East Asian ideograph +7C7DEast Asian ideograph +7C81East Asian ideograph +7C8EEast Asian ideograph +7C91East Asian ideograph +7C83East Asian ideograph +7C8DEast Asian ideograph +7C99East Asian ideograph +7C98East Asian ideograph +7C9CEast Asian ideograph +7C95East Asian ideograph +7CA7East Asian ideograph +7CA2East Asian ideograph +7C9EEast Asian ideograph +7CA9East Asian ideograph +7CA8East Asian ideograph +7CA1East Asian ideograph +7CACEast Asian ideograph +7CA6East Asian ideograph +7CB2East Asian ideograph +7CBBEast Asian ideograph +7CBFEast Asian ideograph +7CBAEast Asian ideograph +7CBCEast Asian ideograph +7CC2East Asian ideograph +7CCEEast Asian ideograph +7CC8East Asian ideograph +7CC5East Asian ideograph +7CCCEast Asian ideograph +7CC9East Asian ideograph +7CD2East Asian ideograph +7CD7East Asian ideograph +7CE1East Asian ideograph +E96D7CE8Variant of 4C6F7B which maps to 7CE8 +7CDDEast Asian ideograph +7CEDEast Asian ideograph +7CF0East Asian ideograph +7CF2East Asian ideograph +7CF4East Asian ideograph +7CF6East Asian ideograph +7D06East Asian ideograph +7D03East Asian ideograph +7D08East Asian ideograph +7D0FEast Asian ideograph +7D13East Asian ideograph +7D18East Asian ideograph +7D1EEast Asian ideograph +7D1DEast Asian ideograph +7D35East Asian ideograph +7D3DEast Asian ideograph +7D3AEast Asian ideograph +7D32East Asian ideograph +7D31East Asian ideograph +7D45East Asian ideograph +7D3FEast Asian ideograph +7D29East Asian ideograph +7D41East Asian ideograph +7D3EEast Asian ideograph +7D5CEast Asian ideograph +7D53East Asian ideograph +7D5AEast Asian ideograph +7D70East Asian ideograph +7D67East Asian ideograph +7D6AEast Asian ideograph +7D6BEast Asian ideograph +7D73East Asian ideograph +7D4EEast Asian ideograph +7D8BEast Asian ideograph +7D88East Asian ideograph +7D85East Asian ideograph +7D8EEast Asian ideograph +7D7FEast Asian ideograph +7D86East Asian ideograph +7D8DEast Asian ideograph +7D9BEast Asian ideograph +7D83East Asian ideograph +7D7DEast Asian ideograph +7D7BEast Asian ideograph +7D7AEast Asian ideograph +7D96East Asian ideograph +7D5BEast Asian ideograph +7D8CEast Asian ideograph +7DA3East Asian ideograph +7DAEEast Asian ideograph +7DCBEast Asian ideograph +7DAAEast Asian ideograph +7DCEEast Asian ideograph +7DC9East Asian ideograph +7DC5East Asian ideograph +7DA6East Asian ideograph +7DC4East Asian ideograph +7DACEast Asian ideograph +7DB9East Asian ideograph +7D9FEast Asian ideograph +7DE1East Asian ideograph +7DD9East Asian ideograph +7DE4East Asian ideograph +7DD7East Asian ideograph +7DF9East Asian ideograph +7E06East Asian ideograph +7DF2East Asian ideograph +7DE6East Asian ideograph +7DDCEast Asian ideograph +7DF1East Asian ideograph +7DF6East Asian ideograph +7DE5East Asian ideograph +7DF5East Asian ideograph +7E17East Asian ideograph +7E1EEast Asian ideograph +7E21East Asian ideograph +7E0BEast Asian ideograph +7E12East Asian ideograph +7E22East Asian ideograph +7E20East Asian ideograph +7E1DEast Asian ideograph +7E09East Asian ideograph +7E1FEast Asian ideograph +7E15East Asian ideograph +7E10East Asian ideograph +7E0FEast Asian ideograph +7E3BEast Asian ideograph +7E34East Asian ideograph +7E2DEast Asian ideograph +7E2FEast Asian ideograph +7E36East Asian ideograph +7E3AEast Asian ideograph +7E39East Asian ideograph +7E44East Asian ideograph +7E35East Asian ideograph +7E3FEast Asian ideograph +7E47East Asian ideograph +7E52East Asian ideograph +7E51East Asian ideograph +7E50East Asian ideograph +7E67East Asian ideograph +7E56East Asian ideograph +7E68East Asian ideograph +7E6EEast Asian ideograph +7E70East Asian ideograph +7E6FEast Asian ideograph +7E73East Asian ideograph +7E7BEast Asian ideograph +7E7EEast Asian ideograph +7E81East Asian ideograph +7E8AEast Asian ideograph +7E87East Asian ideograph +7E88East Asian ideograph +7E86East Asian ideograph +7E91East Asian ideograph +7E95East Asian ideograph +7E94East Asian ideograph +7E9BEast Asian ideograph +7E9AEast Asian ideograph +7E99East Asian ideograph +7E98East Asian ideograph +7F43East Asian ideograph +7F46East Asian ideograph +7F45East Asian ideograph +7F4BEast Asian ideograph +7F4CEast Asian ideograph +7F4DEast Asian ideograph +7F4EEast Asian ideograph +7F4FEast Asian ideograph +7F60East Asian ideograph +7F61East Asian ideograph +7F5DEast Asian ideograph +7F5BEast Asian ideograph +7F63East Asian ideograph +7F65East Asian ideograph +7F66East Asian ideograph +7F6DEast Asian ideograph +7F6BEast Asian ideograph +7F67East Asian ideograph +7F68East Asian ideograph +7F71East Asian ideograph +7F73East Asian ideograph +7F76East Asian ideograph +7F7FEast Asian ideograph +7F7EEast Asian ideograph +7F7DEast Asian ideograph +7F86East Asian ideograph +7F91East Asian ideograph +7F96East Asian ideograph +7F97East Asian ideograph +7F95East Asian ideograph +7FA2East Asian ideograph +7FA7East Asian ideograph +7FB0East Asian ideograph +7FADEast Asian ideograph +7FB1East Asian ideograph +7FB4East Asian ideograph +7FB5East Asian ideograph +7FBCEast Asian ideograph +7FBEEast Asian ideograph +7FC3East Asian ideograph +7FCAEast Asian ideograph +7FDBEast Asian ideograph +7FE3East Asian ideograph +7FE6East Asian ideograph +7FE5East Asian ideograph +7FECEast Asian ideograph +7FEBEast Asian ideograph +7FEFEast Asian ideograph +7FEEEast Asian ideograph +7FFDEast Asian ideograph +7FFEEast Asian ideograph +7FFFEast Asian ideograph +8004East Asian ideograph +8008East Asian ideograph +800BEast Asian ideograph +800EEast Asian ideograph +8011East Asian ideograph +800FEast Asian ideograph +8014East Asian ideograph +8016East Asian ideograph +801FEast Asian ideograph +801EEast Asian ideograph +801DEast Asian ideograph +8025East Asian ideograph +8026East Asian ideograph +802AEast Asian ideograph +8029East Asian ideograph +8028East Asian ideograph +8030East Asian ideograph +8031East Asian ideograph +8035East Asian ideograph +8039East Asian ideograph +8041East Asian ideograph +8043East Asian ideograph +8052East Asian ideograph +8062East Asian ideograph +8063East Asian ideograph +806CEast Asian ideograph +8075East Asian ideograph +807BEast Asian ideograph +8079East Asian ideograph +808AEast Asian ideograph +808EEast Asian ideograph +809FEast Asian ideograph +670AEast Asian ideograph +80A7East Asian ideograph +80B0East Asian ideograph +80B8East Asian ideograph +80B5East Asian ideograph +80A6East Asian ideograph +80E0East Asian ideograph +6711East Asian ideograph +80DFEast Asian ideograph +80C2East Asian ideograph +80D9East Asian ideograph +80DDEast Asian ideograph +80CFEast Asian ideograph +80CDEast Asian ideograph +80D7East Asian ideograph +80F2East Asian ideograph +80FAEast Asian ideograph +80FEEast Asian ideograph +8103East Asian ideograph +80F9East Asian ideograph +80EFEast Asian ideograph +80D4East Asian ideograph +811DEast Asian ideograph +8118East Asian ideograph +8130East Asian ideograph +8124East Asian ideograph +811BEast Asian ideograph +812AEast Asian ideograph +811EEast Asian ideograph +8121East Asian ideograph +8117East Asian ideograph +813AEast Asian ideograph +815AEast Asian ideograph +8148East Asian ideograph +814CEast Asian ideograph +8153East Asian ideograph +8141East Asian ideograph +814DEast Asian ideograph +6720East Asian ideograph +8160East Asian ideograph +8169East Asian ideograph +817CEast Asian ideograph +8161East Asian ideograph +8176East Asian ideograph +8174East Asian ideograph +8167East Asian ideograph +816FEast Asian ideograph +8182East Asian ideograph +818BEast Asian ideograph +8186East Asian ideograph +8183East Asian ideograph +819FEast Asian ideograph +81A3East Asian ideograph +8198East Asian ideograph +8195East Asian ideograph +8197East Asian ideograph +81AAEast Asian ideograph +81A6East Asian ideograph +6725East Asian ideograph +81B5East Asian ideograph +81B0East Asian ideograph +81B4East Asian ideograph +81B7East Asian ideograph +81BBEast Asian ideograph +81C1East Asian ideograph +81CCEast Asian ideograph +81CAEast Asian ideograph +81C4East Asian ideograph +81D1East Asian ideograph +81CEEast Asian ideograph +81D0East Asian ideograph +81DBEast Asian ideograph +81DDEast Asian ideograph +81DEEast Asian ideograph +81E0East Asian ideograph +81E2East Asian ideograph +81E7East Asian ideograph +81EFEast Asian ideograph +81F2East Asian ideograph +81F6East Asian ideograph +8201East Asian ideograph +E9EEEast Asian ideograph not in Unicode +8203East Asian ideograph +8204East Asian ideograph +820BEast Asian ideograph +821DEast Asian ideograph +8220East Asian ideograph +822DEast Asian ideograph +822FEast Asian ideograph +8238East Asian ideograph +823AEast Asian ideograph +8233East Asian ideograph +8234East Asian ideograph +8232East Asian ideograph +8248East Asian ideograph +8249East Asian ideograph +8244East Asian ideograph +8240East Asian ideograph +8241East Asian ideograph +8245East Asian ideograph +824BEast Asian ideograph +824FEast Asian ideograph +824EEast Asian ideograph +8256East Asian ideograph +8257East Asian ideograph +825AEast Asian ideograph +825FEast Asian ideograph +8262East Asian ideograph +8268East Asian ideograph +826DEast Asian ideograph +8278East Asian ideograph +827FEast Asian ideograph +828EEast Asian ideograph +8291East Asian ideograph +828FEast Asian ideograph +8284East Asian ideograph +8283East Asian ideograph +828AEast Asian ideograph +82AFEast Asian ideograph +82A7East Asian ideograph +82ABEast Asian ideograph +82B0East Asian ideograph +82A4East Asian ideograph +829AEast Asian ideograph +82A3East Asian ideograph +82B7East Asian ideograph +E96E82AEVariant of 4C7C45 which maps to 82AE +82A9East Asian ideograph +82BCEast Asian ideograph +82A8East Asian ideograph +82B4East Asian ideograph +82A1East Asian ideograph +82AAEast Asian ideograph +82D9East Asian ideograph +82FEEast Asian ideograph +82E0East Asian ideograph +82D0East Asian ideograph +8300East Asian ideograph +82EAEast Asian ideograph +82F7East Asian ideograph +82EFEast Asian ideograph +833AEast Asian ideograph +82E4East Asian ideograph +82D5East Asian ideograph +8307East Asian ideograph +82FAEast Asian ideograph +82F4East Asian ideograph +82E2East Asian ideograph +82D2East Asian ideograph +8314East Asian ideograph +82EBEast Asian ideograph +82D8East Asian ideograph +82E1East Asian ideograph +82F6East Asian ideograph +8310East Asian ideograph +82F3East Asian ideograph +830CEast Asian ideograph +82FBEast Asian ideograph +82FDEast Asian ideograph +8333East Asian ideograph +8328East Asian ideograph +8344East Asian ideograph +8351East Asian ideograph +831BEast Asian ideograph +8356East Asian ideograph +8322East Asian ideograph +832CEast Asian ideograph +833CEast Asian ideograph +834DEast Asian ideograph +E96F8343Variant of 4C7D4D which maps to 8343 +832FEast Asian ideograph +8348East Asian ideograph +8312East Asian ideograph +8316East Asian ideograph +831AEast Asian ideograph +8347East Asian ideograph +83A8East Asian ideograph +83ADEast Asian ideograph +8373East Asian ideograph +83B0East Asian ideograph +831DEast Asian ideograph +838FEast Asian ideograph +8395East Asian ideograph +8375East Asian ideograph +837FEast Asian ideograph +8399East Asian ideograph +83A6East Asian ideograph +8387East Asian ideograph +83B9East Asian ideograph +83A9East Asian ideograph +839BEast Asian ideograph +83AAEast Asian ideograph +839CEast Asian ideograph +839FEast Asian ideograph +83CFEast Asian ideograph +83F9East Asian ideograph +8421East Asian ideograph +8423East Asian ideograph +83EAEast Asian ideograph +8413East Asian ideograph +83FCEast Asian ideograph +83F6East Asian ideograph +8410East Asian ideograph +83E1East Asian ideograph +83C6East Asian ideograph +8407East Asian ideograph +83EBEast Asian ideograph +83BFEast Asian ideograph +83E2East Asian ideograph +8401East Asian ideograph +83D8East Asian ideograph +83E5East Asian ideograph +8418East Asian ideograph +83CEEast Asian ideograph +83D3East Asian ideograph +83D6East Asian ideograph +83FDEast Asian ideograph +841EEast Asian ideograph +83C9East Asian ideograph +83DFEast Asian ideograph +841FEast Asian ideograph +840FEast Asian ideograph +8411East Asian ideograph +839AEast Asian ideograph +83F3East Asian ideograph +83D1East Asian ideograph +8453East Asian ideograph +848EEast Asian ideograph +8439East Asian ideograph +8476East Asian ideograph +8479East Asian ideograph +8451East Asian ideograph +847DEast Asian ideograph +845AEast Asian ideograph +8459East Asian ideograph +8473East Asian ideograph +843EEast Asian ideograph +846DEast Asian ideograph +847AEast Asian ideograph +8484East Asian ideograph +8478East Asian ideograph +8432East Asian ideograph +845CEast Asian ideograph +842AEast Asian ideograph +8429East Asian ideograph +8471East Asian ideograph +845FEast Asian ideograph +8460East Asian ideograph +846EEast Asian ideograph +8446East Asian ideograph +8452East Asian ideograph +844AEast Asian ideograph +844EEast Asian ideograph +8497East Asian ideograph +84A1East Asian ideograph +849FEast Asian ideograph +84BAEast Asian ideograph +84B9East Asian ideograph +84B4East Asian ideograph +84C1East Asian ideograph +84BBEast Asian ideograph +84CDEast Asian ideograph +84B1East Asian ideograph +849DEast Asian ideograph +84D0East Asian ideograph +8494East Asian ideograph +84C7East Asian ideograph +84BDEast Asian ideograph +84C2East Asian ideograph +8495East Asian ideograph +84AFEast Asian ideograph +84ADEast Asian ideograph +84A8East Asian ideograph +84D6East Asian ideograph +84DAEast Asian ideograph +8493East Asian ideograph +84CFEast Asian ideograph +84CAEast Asian ideograph +8506East Asian ideograph +850BEast Asian ideograph +8500East Asian ideograph +851FEast Asian ideograph +853BEast Asian ideograph +84EAEast Asian ideograph +84F4East Asian ideograph +850CEast Asian ideograph +852FEast Asian ideograph +8515East Asian ideograph +84F7East Asian ideograph +84FCEast Asian ideograph +84EBEast Asian ideograph +84FDEast Asian ideograph +851EEast Asian ideograph +8518East Asian ideograph +8526East Asian ideograph +E9708507Variant of 2F252E which maps to 8507 +84E7East Asian ideograph +84F0East Asian ideograph +84EFEast Asian ideograph +8556East Asian ideograph +8541East Asian ideograph +8558East Asian ideograph +8553East Asian ideograph +8561East Asian ideograph +8540East Asian ideograph +8546East Asian ideograph +8564East Asian ideograph +855EEast Asian ideograph +8573East Asian ideograph +8551East Asian ideograph +8562East Asian ideograph +8563East Asian ideograph +848DEast Asian ideograph +8542East Asian ideograph +854EEast Asian ideograph +8555East Asian ideograph +855DEast Asian ideograph +858CEast Asian ideograph +8580East Asian ideograph +858FEast Asian ideograph +8579East Asian ideograph +857FEast Asian ideograph +8577East Asian ideograph +8578East Asian ideograph +8598East Asian ideograph +857BEast Asian ideograph +85A4East Asian ideograph +857AEast Asian ideograph +8597East Asian ideograph +8557East Asian ideograph +85A8East Asian ideograph +8586East Asian ideograph +8599East Asian ideograph +858AEast Asian ideograph +85A2East Asian ideograph +8590East Asian ideograph +8585East Asian ideograph +8588East Asian ideograph +85B8East Asian ideograph +85C1East Asian ideograph +85BAEast Asian ideograph +85CEEast Asian ideograph +85C2East Asian ideograph +85B7East Asian ideograph +85B9East Asian ideograph +85B3East Asian ideograph +85BDEast Asian ideograph +85C4East Asian ideograph +85BFEast Asian ideograph +85BEEast Asian ideograph +85B6East Asian ideograph +8624East Asian ideograph +85F7East Asian ideograph +85E6East Asian ideograph +85D4East Asian ideograph +85EDEast Asian ideograph +85DAEast Asian ideograph +85DFEast Asian ideograph +85D8East Asian ideograph +85DCEast Asian ideograph +85F5East Asian ideograph +8622East Asian ideograph +8610East Asian ideograph +85FCEast Asian ideograph +85FFEast Asian ideograph +85FEEast Asian ideograph +8600East Asian ideograph +8604East Asian ideograph +8605East Asian ideograph +862BEast Asian ideograph +8627East Asian ideograph +8629East Asian ideograph +8637East Asian ideograph +8636East Asian ideograph +863CEast Asian ideograph +8640East Asian ideograph +863AEast Asian ideograph +8645East Asian ideograph +864DEast Asian ideograph +8653East Asian ideograph +8659East Asian ideograph +8661East Asian ideograph +8662East Asian ideograph +8663East Asian ideograph +8669East Asian ideograph +866CEast Asian ideograph +8672East Asian ideograph +866FEast Asian ideograph +867BEast Asian ideograph +867AEast Asian ideograph +8673East Asian ideograph +867CEast Asian ideograph +8696East Asian ideograph +86A8East Asian ideograph +8691East Asian ideograph +869CEast Asian ideograph +8698East Asian ideograph +868DEast Asian ideograph +868BEast Asian ideograph +86A6East Asian ideograph +869DEast Asian ideograph +86A0East Asian ideograph +86A7East Asian ideograph +86BFEast Asian ideograph +86BAEast Asian ideograph +86B0East Asian ideograph +86B3East Asian ideograph +86C9East Asian ideograph +86B4East Asian ideograph +86D8East Asian ideograph +86E3East Asian ideograph +86E9East Asian ideograph +86ECEast Asian ideograph +86D5East Asian ideograph +86D0East Asian ideograph +86D1East Asian ideograph +86DEEast Asian ideograph +870BEast Asian ideograph +86FAEast Asian ideograph +86F8East Asian ideograph +8706East Asian ideograph +870EEast Asian ideograph +8709East Asian ideograph +870AEast Asian ideograph +870DEast Asian ideograph +874AEast Asian ideograph +8723East Asian ideograph +8737East Asian ideograph +8728East Asian ideograph +8740East Asian ideograph +872EEast Asian ideograph +873DEast Asian ideograph +871EEast Asian ideograph +8743East Asian ideograph +8744East Asian ideograph +873EEast Asian ideograph +8729East Asian ideograph +8739East Asian ideograph +871AEast Asian ideograph +8731East Asian ideograph +8711East Asian ideograph +8712East Asian ideograph +874FEast Asian ideograph +8771East Asian ideograph +8763East Asian ideograph +8764East Asian ideograph +8765East Asian ideograph +877DEast Asian ideograph +8758East Asian ideograph +877BEast Asian ideograph +8761East Asian ideograph +876AEast Asian ideograph +874EEast Asian ideograph +875FEast Asian ideograph +876FEast Asian ideograph +875DEast Asian ideograph +876EEast Asian ideograph +874DEast Asian ideograph +8753East Asian ideograph +87A3East Asian ideograph +8793East Asian ideograph +8799East Asian ideograph +8788East Asian ideograph +8798East Asian ideograph +8785East Asian ideograph +878BEast Asian ideograph +8784East Asian ideograph +87A9East Asian ideograph +8789East Asian ideograph +87ADEast Asian ideograph +87BEEast Asian ideograph +87C4East Asian ideograph +87AFEast Asian ideograph +87ACEast Asian ideograph +87AEEast Asian ideograph +87BFEast Asian ideograph +87BDEast Asian ideograph +87EEEast Asian ideograph +87F3East Asian ideograph +87F0East Asian ideograph +87EAEast Asian ideograph +87DBEast Asian ideograph +87E2East Asian ideograph +87EBEast Asian ideograph +87D6East Asian ideograph +87F5East Asian ideograph +87E0East Asian ideograph +87D3East Asian ideograph +87DCEast Asian ideograph +87E3East Asian ideograph +8801East Asian ideograph +8803East Asian ideograph +880AEast Asian ideograph +87F6East Asian ideograph +87F7East Asian ideograph +880BEast Asian ideograph +8806East Asian ideograph +87FEEast Asian ideograph +8810East Asian ideograph +8819East Asian ideograph +8811East Asian ideograph +8818East Asian ideograph +8813East Asian ideograph +8816East Asian ideograph +8834East Asian ideograph +881CEast Asian ideograph +881BEast Asian ideograph +8828East Asian ideograph +8832East Asian ideograph +882EEast Asian ideograph +882DEast Asian ideograph +883CEast Asian ideograph +8841East Asian ideograph +E9EFEast Asian ideograph not in Unicode +8844East Asian ideograph +8847East Asian ideograph +884AEast Asian ideograph +884EEast Asian ideograph +8852East Asian ideograph +8850East Asian ideograph +8856East Asian ideograph +8855East Asian ideograph +885CEast Asian ideograph +885AEast Asian ideograph +8869East Asian ideograph +886DEast Asian ideograph +887AEast Asian ideograph +8875East Asian ideograph +8872East Asian ideograph +887DEast Asian ideograph +8879East Asian ideograph +887FEast Asian ideograph +887EEast Asian ideograph +88A2East Asian ideograph +88A4East Asian ideograph +88AAEast Asian ideograph +889AEast Asian ideograph +8890East Asian ideograph +888CEast Asian ideograph +88A0East Asian ideograph +8899East Asian ideograph +8897East Asian ideograph +88C9East Asian ideograph +88BFEast Asian ideograph +88BAEast Asian ideograph +88C0East Asian ideograph +88B2East Asian ideograph +88BCEast Asian ideograph +88B7East Asian ideograph +88BDEast Asian ideograph +88C4East Asian ideograph +88CBEast Asian ideograph +88CCEast Asian ideograph +88DBEast Asian ideograph +88CEEast Asian ideograph +88D2East Asian ideograph +88F1East Asian ideograph +88FEEast Asian ideograph +88F2East Asian ideograph +8900East Asian ideograph +88F0East Asian ideograph +88FCEast Asian ideograph +88EFEast Asian ideograph +8903East Asian ideograph +8909East Asian ideograph +8918East Asian ideograph +8906East Asian ideograph +890CEast Asian ideograph +8919East Asian ideograph +890AEast Asian ideograph +8915East Asian ideograph +892FEast Asian ideograph +8930East Asian ideograph +8921East Asian ideograph +8927East Asian ideograph +891FEast Asian ideograph +8931East Asian ideograph +891EEast Asian ideograph +8926East Asian ideograph +8922East Asian ideograph +8935East Asian ideograph +8941East Asian ideograph +8933East Asian ideograph +8954East Asian ideograph +894FEast Asian ideograph +8947East Asian ideograph +894CEast Asian ideograph +8946East Asian ideograph +894DEast Asian ideograph +8962East Asian ideograph +895AEast Asian ideograph +895EEast Asian ideograph +895BEast Asian ideograph +895CEast Asian ideograph +895DEast Asian ideograph +8966East Asian ideograph +896DEast Asian ideograph +896BEast Asian ideograph +896EEast Asian ideograph +896CEast Asian ideograph +8976East Asian ideograph +8974East Asian ideograph +897BEast Asian ideograph +897CEast Asian ideograph +8984East Asian ideograph +8985East Asian ideograph +8991East Asian ideograph +8997East Asian ideograph +8998East Asian ideograph +899CEast Asian ideograph +89A1East Asian ideograph +89A5East Asian ideograph +89A9East Asian ideograph +89AFEast Asian ideograph +89B8East Asian ideograph +89B7East Asian ideograph +89B6East Asian ideograph +89BCEast Asian ideograph +89BFEast Asian ideograph +89D6East Asian ideograph +89D5East Asian ideograph +89DAEast Asian ideograph +89E5East Asian ideograph +89DCEast Asian ideograph +89E1East Asian ideograph +89E9East Asian ideograph +89EBEast Asian ideograph +89EDEast Asian ideograph +89F1East Asian ideograph +89F3East Asian ideograph +89F5East Asian ideograph +89F6East Asian ideograph +89F7East Asian ideograph +89FFEast Asian ideograph +8A06East Asian ideograph +8A07East Asian ideograph +8A04East Asian ideograph +8A0FEast Asian ideograph +8A11East Asian ideograph +8A12East Asian ideograph +8A0DEast Asian ideograph +8A27East Asian ideograph +8A29East Asian ideograph +8A22East Asian ideograph +8A51East Asian ideograph +8A4AEast Asian ideograph +8A4EEast Asian ideograph +8A56East Asian ideograph +8A57East Asian ideograph +8A48East Asian ideograph +8A58East Asian ideograph +8A52East Asian ideograph +8A3DEast Asian ideograph +8A45East Asian ideograph +8A7FEast Asian ideograph +8A86East Asian ideograph +8A61East Asian ideograph +8A3EEast Asian ideograph +8A82East Asian ideograph +8A84East Asian ideograph +8A75East Asian ideograph +8A8FEast Asian ideograph +8A96East Asian ideograph +8A9AEast Asian ideograph +8AB6East Asian ideograph +8ABEEast Asian ideograph +8ACFEast Asian ideograph +8AC6East Asian ideograph +8AD1East Asian ideograph +8AD3East Asian ideograph +8AAFEast Asian ideograph +8AD4East Asian ideograph +8ACDEast Asian ideograph +8AB9East Asian ideograph +8ADBEast Asian ideograph +8AD0East Asian ideograph +8AD7East Asian ideograph +8AF3East Asian ideograph +8AE2East Asian ideograph +8B4CEast Asian ideograph +8ADDEast Asian ideograph +8AF6East Asian ideograph +8AF4East Asian ideograph +8AF5East Asian ideograph +8ADFEast Asian ideograph +8B03East Asian ideograph +8AE4East Asian ideograph +8B14East Asian ideograph +8AFCEast Asian ideograph +8ADEEast Asian ideograph +8AE1East Asian ideograph +8B07East Asian ideograph +8B0CEast Asian ideograph +8B1CEast Asian ideograph +8B16East Asian ideograph +8B1FEast Asian ideograph +8B0BEast Asian ideograph +8B06East Asian ideograph +8B05East Asian ideograph +8B0FEast Asian ideograph +8B10East Asian ideograph +8B2BEast Asian ideograph +8B37East Asian ideograph +8B26East Asian ideograph +8B33East Asian ideograph +8B3EEast Asian ideograph +8B29East Asian ideograph +8B48East Asian ideograph +8B54East Asian ideograph +8B53East Asian ideograph +8B4AEast Asian ideograph +8B46East Asian ideograph +8B56East Asian ideograph +8B3FEast Asian ideograph +8B59East Asian ideograph +8B4DEast Asian ideograph +8B6BEast Asian ideograph +8B6DEast Asian ideograph +8B78East Asian ideograph +8B45East Asian ideograph +8B85East Asian ideograph +8B81East Asian ideograph +8B7EEast Asian ideograph +8B8BEast Asian ideograph +8B87East Asian ideograph +8B95East Asian ideograph +8B94East Asian ideograph +8B9CEast Asian ideograph +8B9FEast Asian ideograph +8C3AEast Asian ideograph +8C40East Asian ideograph +8C42East Asian ideograph +8C47East Asian ideograph +8C4BEast Asian ideograph +8C4FEast Asian ideograph +8C55East Asian ideograph +8C57East Asian ideograph +8C5CEast Asian ideograph +8C5DEast Asian ideograph +86C3East Asian ideograph +8C68East Asian ideograph +8C6DEast Asian ideograph +8C73East Asian ideograph +8C74East Asian ideograph +8C75East Asian ideograph +8C77East Asian ideograph +8C76East Asian ideograph +8C78East Asian ideograph +8C7BEast Asian ideograph +8C86East Asian ideograph +8C85East Asian ideograph +8C88East Asian ideograph +8C94East Asian ideograph +8C9BEast Asian ideograph +8C9FEast Asian ideograph +8CA4East Asian ideograph +8CB0East Asian ideograph +8CBAEast Asian ideograph +8CB5East Asian ideograph +8CB9East Asian ideograph +8CCDEast Asian ideograph +8CD8East Asian ideograph +8CD5East Asian ideograph +8CE8East Asian ideograph +8CE9East Asian ideograph +8CE1East Asian ideograph +8CEBEast Asian ideograph +8CDAEast Asian ideograph +8CDDEast Asian ideograph +8CD9East Asian ideograph +8CEEEast Asian ideograph +8CF1East Asian ideograph +8CF5East Asian ideograph +8CFBEast Asian ideograph +8CF7East Asian ideograph +8D04East Asian ideograph +8CFEEast Asian ideograph +8D07East Asian ideograph +8D09East Asian ideograph +8D0CEast Asian ideograph +8D11East Asian ideograph +8D10East Asian ideograph +8D12East Asian ideograph +8D14East Asian ideograph +8D18East Asian ideograph +8D6CEast Asian ideograph +8D78East Asian ideograph +8D7AEast Asian ideograph +8D84East Asian ideograph +8D94East Asian ideograph +8D8DEast Asian ideograph +8D96East Asian ideograph +8DA1East Asian ideograph +8DA6East Asian ideograph +8DABEast Asian ideograph +8DAFEast Asian ideograph +8DB0East Asian ideograph +8DB2East Asian ideograph +8DBCEast Asian ideograph +8DBAEast Asian ideograph +8DB9East Asian ideograph +8DC2East Asian ideograph +8DC1East Asian ideograph +8DBFEast Asian ideograph +8DCFEast Asian ideograph +8DD6East Asian ideograph +8DD0East Asian ideograph +8DC5East Asian ideograph +8DE4East Asian ideograph +8DECEast Asian ideograph +8DEBEast Asian ideograph +8DF4East Asian ideograph +8DE9East Asian ideograph +8DE6East Asian ideograph +8DE3East Asian ideograph +8DE7East Asian ideograph +8DF2East Asian ideograph +8E09East Asian ideograph +8DFDEast Asian ideograph +8DFFEast Asian ideograph +8E05East Asian ideograph +8E01East Asian ideograph +8E04East Asian ideograph +8E06East Asian ideograph +8E2AEast Asian ideograph +8E23East Asian ideograph +8E2EEast Asian ideograph +8E21East Asian ideograph +8E1EEast Asian ideograph +8E16East Asian ideograph +8E26East Asian ideograph +8E27East Asian ideograph +8E14East Asian ideograph +8E18East Asian ideograph +8E41East Asian ideograph +8E40East Asian ideograph +8E36East Asian ideograph +8E3DEast Asian ideograph +8E30East Asian ideograph +8E47East Asian ideograph +8E46East Asian ideograph +8E4CEast Asian ideograph +8E50East Asian ideograph +8E4FEast Asian ideograph +8E5CEast Asian ideograph +8E62East Asian ideograph +8E60East Asian ideograph +8E54East Asian ideograph +8E67East Asian ideograph +8E5AEast Asian ideograph +8E5EEast Asian ideograph +8E55East Asian ideograph +8E61East Asian ideograph +8E5DEast Asian ideograph +8E75East Asian ideograph +8E74East Asian ideograph +8E95East Asian ideograph +8E6DEast Asian ideograph +8E69East Asian ideograph +8E83East Asian ideograph +8E84East Asian ideograph +8E8BEast Asian ideograph +8E94East Asian ideograph +8E9AEast Asian ideograph +8E92East Asian ideograph +8E93East Asian ideograph +8E90East Asian ideograph +8E98East Asian ideograph +8E9EEast Asian ideograph +8EA5East Asian ideograph +8EA7East Asian ideograph +8EA9East Asian ideograph +8E99East Asian ideograph +8EB3East Asian ideograph +8EBCEast Asian ideograph +8EB6East Asian ideograph +8EC9East Asian ideograph +8ECFEast Asian ideograph +8ECEEast Asian ideograph +8ED5East Asian ideograph +8EFAEast Asian ideograph +8EF9East Asian ideograph +8EE8East Asian ideograph +8EEBEast Asian ideograph +8EFFEast Asian ideograph +8F00East Asian ideograph +8F05East Asian ideograph +8F08East Asian ideograph +8F07East Asian ideograph +8F27East Asian ideograph +8F2CEast Asian ideograph +8F1EEast Asian ideograph +8F25East Asian ideograph +8F20East Asian ideograph +8F17East Asian ideograph +8F36East Asian ideograph +8F2EEast Asian ideograph +8F33East Asian ideograph +8F2DEast Asian ideograph +8F39East Asian ideograph +8F34East Asian ideograph +8F40East Asian ideograph +8F46East Asian ideograph +8F4AEast Asian ideograph +8F47East Asian ideograph +8F52East Asian ideograph +8F56East Asian ideograph +8F57East Asian ideograph +8F55East Asian ideograph +8F58East Asian ideograph +8F5CEast Asian ideograph +8F5EEast Asian ideograph +8F5DEast Asian ideograph +8F62East Asian ideograph +8F63East Asian ideograph +8F64East Asian ideograph +8FA4East Asian ideograph +8FA5East Asian ideograph +8FB5East Asian ideograph +8FB7East Asian ideograph +8FBBEast Asian ideograph +8FBCEast Asian ideograph +8FBFEast Asian ideograph +8FD2East Asian ideograph +8FCBEast Asian ideograph +8FCAEast Asian ideograph +8FD3East Asian ideograph +8FCDEast Asian ideograph +8FDAEast Asian ideograph +8FD5East Asian ideograph +8FE4East Asian ideograph +8FEEEast Asian ideograph +8FF9East Asian ideograph +8FFBEast Asian ideograph +9004East Asian ideograph +9008East Asian ideograph +9011East Asian ideograph +900BEast Asian ideograph +900CEast Asian ideograph +9021East Asian ideograph +902DEast Asian ideograph +902CEast Asian ideograph +9037East Asian ideograph +9034East Asian ideograph +902FEast Asian ideograph +9036East Asian ideograph +9046East Asian ideograph +9052East Asian ideograph +9049East Asian ideograph +9044East Asian ideograph +9062East Asian ideograph +905DEast Asian ideograph +905BEast Asian ideograph +906BEast Asian ideograph +9070East Asian ideograph +906FEast Asian ideograph +9079East Asian ideograph +9076East Asian ideograph +907BEast Asian ideograph +9085East Asian ideograph +9083East Asian ideograph +9088East Asian ideograph +908BEast Asian ideograph +9099East Asian ideograph +9097East Asian ideograph +909BEast Asian ideograph +909CEast Asian ideograph +90A1East Asian ideograph +90A8East Asian ideograph +90A0East Asian ideograph +90AFEast Asian ideograph +90B3East Asian ideograph +90B6East Asian ideograph +90B0East Asian ideograph +90ADEast Asian ideograph +90B2East Asian ideograph +90C9East Asian ideograph +90BDEast Asian ideograph +90D5East Asian ideograph +90BEEast Asian ideograph +90C7East Asian ideograph +90C8East Asian ideograph +90C3East Asian ideograph +90DDEast Asian ideograph +90DFEast Asian ideograph +90E2East Asian ideograph +90D8East Asian ideograph +90DBEast Asian ideograph +90DCEast Asian ideograph +90D7East Asian ideograph +90E4East Asian ideograph +90EFEast Asian ideograph +90EAEast Asian ideograph +90F0East Asian ideograph +90F4East Asian ideograph +90F2East Asian ideograph +90EBEast Asian ideograph +90F3East Asian ideograph +90FCEast Asian ideograph +90FEEast Asian ideograph +9104East Asian ideograph +90FFEast Asian ideograph +9106East Asian ideograph +9100East Asian ideograph +9107East Asian ideograph +910FEast Asian ideograph +9111East Asian ideograph +9116East Asian ideograph +9114East Asian ideograph +910BEast Asian ideograph +9118East Asian ideograph +911CEast Asian ideograph +9120East Asian ideograph +9122East Asian ideograph +911EEast Asian ideograph +9124East Asian ideograph +911AEast Asian ideograph +9125East Asian ideograph +912FEast Asian ideograph +912BEast Asian ideograph +9132East Asian ideograph +9126East Asian ideograph +9134East Asian ideograph +9136East Asian ideograph +913AEast Asian ideograph +913BEast Asian ideograph +9143East Asian ideograph +9146East Asian ideograph +9145East Asian ideograph +9148East Asian ideograph +9147East Asian ideograph +9150East Asian ideograph +914EEast Asian ideograph +9159East Asian ideograph +915CEast Asian ideograph +9156East Asian ideograph +9158East Asian ideograph +915AEast Asian ideograph +9161East Asian ideograph +9164East Asian ideograph +916FEast Asian ideograph +916EEast Asian ideograph +917AEast Asian ideograph +9172East Asian ideograph +9179East Asian ideograph +9176East Asian ideograph +9174East Asian ideograph +9173East Asian ideograph +9185East Asian ideograph +9182East Asian ideograph +918AEast Asian ideograph +9186East Asian ideograph +918CEast Asian ideograph +9181East Asian ideograph +9191East Asian ideograph +9190East Asian ideograph +918EEast Asian ideograph +918DEast Asian ideograph +9193East Asian ideograph +919DEast Asian ideograph +919AEast Asian ideograph +91A2East Asian ideograph +E971919BVariant of 4D4134 which maps to 919B +91A8East Asian ideograph +91AAEast Asian ideograph +91AFEast Asian ideograph +91B1East Asian ideograph +91ADEast Asian ideograph +91AEEast Asian ideograph +91B4East Asian ideograph +91B2East Asian ideograph +91B5East Asian ideograph +91BFEast Asian ideograph +91BDEast Asian ideograph +91C2East Asian ideograph +91C4East Asian ideograph +91C3East Asian ideograph +91D4East Asian ideograph +91D3East Asian ideograph +91D5East Asian ideograph +91D9East Asian ideograph +91E2East Asian ideograph +91EDEast Asian ideograph +91F7East Asian ideograph +91FAEast Asian ideograph +91F2East Asian ideograph +91E8East Asian ideograph +91F6East Asian ideograph +91EEEast Asian ideograph +91F4East Asian ideograph +91F1East Asian ideograph +91E9East Asian ideograph +91F8East Asian ideograph +91F9East Asian ideograph +91E4East Asian ideograph +9204East Asian ideograph +9201East Asian ideograph +922BEast Asian ideograph +920AEast Asian ideograph +9225East Asian ideograph +9292East Asian ideograph +9228East Asian ideograph +9207East Asian ideograph +9203East Asian ideograph +9200East Asian ideograph +9218East Asian ideograph +91FEEast Asian ideograph +9208East Asian ideograph +9226East Asian ideograph +921CEast Asian ideograph +9224East Asian ideograph +9212East Asian ideograph +91FFEast Asian ideograph +9216East Asian ideograph +9211East Asian ideograph +9206East Asian ideograph +92A2East Asian ideograph +9230East Asian ideograph +9249East Asian ideograph +924DEast Asian ideograph +9248East Asian ideograph +923AEast Asian ideograph +922EEast Asian ideograph +9233East Asian ideograph +9266East Asian ideograph +925EEast Asian ideograph +9235East Asian ideograph +9250East Asian ideograph +926BEast Asian ideograph +9239East Asian ideograph +926DEast Asian ideograph +926CEast Asian ideograph +924FEast Asian ideograph +923FEast Asian ideograph +9260East Asian ideograph +9236East Asian ideograph +924EEast Asian ideograph +924CEast Asian ideograph +9256East Asian ideograph +925AEast Asian ideograph +9241East Asian ideograph +9283East Asian ideograph +92A5East Asian ideograph +9282East Asian ideograph +92A8East Asian ideograph +927CEast Asian ideograph +92A4East Asian ideograph +9276East Asian ideograph +928DEast Asian ideograph +92EEEast Asian ideograph +9288East Asian ideograph +927AEast Asian ideograph +928EEast Asian ideograph +92A0East Asian ideograph +9277East Asian ideograph +92AAEast Asian ideograph +92A6East Asian ideograph +927EEast Asian ideograph +929AEast Asian ideograph +92ABEast Asian ideograph +9291East Asian ideograph +929BEast Asian ideograph +927FEast Asian ideograph +92A3East Asian ideograph +92C8East Asian ideograph +92C3East Asian ideograph +92D0East Asian ideograph +92F1East Asian ideograph +92DFEast Asian ideograph +92E6East Asian ideograph +92B6East Asian ideograph +92C0East Asian ideograph +92BEEast Asian ideograph +92D9East Asian ideograph +92D5East Asian ideograph +92C6East Asian ideograph +92F4East Asian ideograph +92CFEast Asian ideograph +92B2East Asian ideograph +92E7East Asian ideograph +92C7East Asian ideograph +92F0East Asian ideograph +92DBEast Asian ideograph +92DCEast Asian ideograph +92D8East Asian ideograph +92E9East Asian ideograph +92DDEast Asian ideograph +92D1East Asian ideograph +92CAEast Asian ideograph +92C2East Asian ideograph +92CCEast Asian ideograph +92EFEast Asian ideograph +92E8East Asian ideograph +92EBEast Asian ideograph +92F5East Asian ideograph +92F2East Asian ideograph +9303East Asian ideograph +9307East Asian ideograph +931EEast Asian ideograph +9344East Asian ideograph +931DEast Asian ideograph +92FAEast Asian ideograph +931FEast Asian ideograph +9331East Asian ideograph +9306East Asian ideograph +92F9East Asian ideograph +930FEast Asian ideograph +9302East Asian ideograph +9324East Asian ideograph +9312East Asian ideograph +9338East Asian ideograph +9323East Asian ideograph +9321East Asian ideograph +9340East Asian ideograph +9301East Asian ideograph +9315East Asian ideograph +9329East Asian ideograph +932EEast Asian ideograph +932AEast Asian ideograph +933FEast Asian ideograph +933AEast Asian ideograph +9335East Asian ideograph +9314East Asian ideograph +92FEEast Asian ideograph +9342East Asian ideograph +9341East Asian ideograph +9319East Asian ideograph +934CEast Asian ideograph +9379East Asian ideograph +9386East Asian ideograph +936AEast Asian ideograph +935CEast Asian ideograph +934FEast Asian ideograph +9347East Asian ideograph +937AEast Asian ideograph +9356East Asian ideograph +9371East Asian ideograph +937CEast Asian ideograph +9377East Asian ideograph +9349East Asian ideograph +9358East Asian ideograph +935AEast Asian ideograph +E9F0East Asian ideograph not in Unicode +935FEast Asian ideograph +9376East Asian ideograph +9355East Asian ideograph +9354East Asian ideograph +9348East Asian ideograph +9374East Asian ideograph +9351East Asian ideograph +9364East Asian ideograph +936BEast Asian ideograph +936DEast Asian ideograph +9360East Asian ideograph +936EEast Asian ideograph +938FEast Asian ideograph +93ACEast Asian ideograph +9395East Asian ideograph +938BEast Asian ideograph +93B5East Asian ideograph +938CEast Asian ideograph +9388East Asian ideograph +93B9East Asian ideograph +93A1East Asian ideograph +93B0East Asian ideograph +93A3East Asian ideograph +93B7East Asian ideograph +939BEast Asian ideograph +9398East Asian ideograph +9389East Asian ideograph +93A4East Asian ideograph +93BCEast Asian ideograph +93A7East Asian ideograph +93BDEast Asian ideograph +93A6East Asian ideograph +939AEast Asian ideograph +93AAEast Asian ideograph +939EEast Asian ideograph +9397East Asian ideograph +93BBEast Asian ideograph +93F1East Asian ideograph +93DEEast Asian ideograph +93EEEast Asian ideograph +93C7East Asian ideograph +93F2East Asian ideograph +93D4East Asian ideograph +93E5East Asian ideograph +93F9East Asian ideograph +93CAEast Asian ideograph +93C4East Asian ideograph +93E8East Asian ideograph +93E7East Asian ideograph +93DAEast Asian ideograph +93D0East Asian ideograph +93EFEast Asian ideograph +93DBEast Asian ideograph +93CCEast Asian ideograph +93D3East Asian ideograph +93A9East Asian ideograph +93E6East Asian ideograph +940BEast Asian ideograph +9413East Asian ideograph +940FEast Asian ideograph +E9F1East Asian ideograph not in Unicode +93FBEast Asian ideograph +93FAEast Asian ideograph +9419East Asian ideograph +940DEast Asian ideograph +9426East Asian ideograph +9427East Asian ideograph +9409East Asian ideograph +9414East Asian ideograph +9404East Asian ideograph +9422East Asian ideograph +9406East Asian ideograph +9410East Asian ideograph +9423East Asian ideograph +93F5East Asian ideograph +93F7East Asian ideograph +9407East Asian ideograph +940EEast Asian ideograph +9411East Asian ideograph +943FEast Asian ideograph +9429East Asian ideograph +943DEast Asian ideograph +93F4East Asian ideograph +9436East Asian ideograph +943BEast Asian ideograph +9424East Asian ideograph +9437East Asian ideograph +9440East Asian ideograph +942BEast Asian ideograph +942DEast Asian ideograph +9441East Asian ideograph +9431East Asian ideograph +9467East Asian ideograph +944CEast Asian ideograph +9445East Asian ideograph +9450East Asian ideograph +944AEast Asian ideograph +9466East Asian ideograph +9464East Asian ideograph +9462East Asian ideograph +9465East Asian ideograph +9455East Asian ideograph +945EEast Asian ideograph +946AEast Asian ideograph +946BEast Asian ideograph +946DEast Asian ideograph +946FEast Asian ideograph +9471East Asian ideograph +9477East Asian ideograph +9482East Asian ideograph +9481East Asian ideograph +9585East Asian ideograph +9588East Asian ideograph +958CEast Asian ideograph +9597East Asian ideograph +958EEast Asian ideograph +959FEast Asian ideograph +95A0East Asian ideograph +95ACEast Asian ideograph +95ABEast Asian ideograph +95BCEast Asian ideograph +95BEEast Asian ideograph +95CDEast Asian ideograph +95B9East Asian ideograph +95BAEast Asian ideograph +95B6East Asian ideograph +95BFEast Asian ideograph +95BDEast Asian ideograph +95C9East Asian ideograph +95CEEast Asian ideograph +95D5East Asian ideograph +95D2East Asian ideograph +95D3East Asian ideograph +95D1East Asian ideograph +95C3East Asian ideograph +95DAEast Asian ideograph +95DEEast Asian ideograph +95E0East Asian ideograph +95E5East Asian ideograph +95E4East Asian ideograph +95E7East Asian ideograph +961EEast Asian ideograph +9624East Asian ideograph +9622East Asian ideograph +9627East Asian ideograph +9642East Asian ideograph +963DEast Asian ideograph +963CEast Asian ideograph +9651East Asian ideograph +9660East Asian ideograph +965CEast Asian ideograph +9658East Asian ideograph +965FEast Asian ideograph +9656East Asian ideograph +966CEast Asian ideograph +967BEast Asian ideograph +967FEast Asian ideograph +967EEast Asian ideograph +9684East Asian ideograph +9688East Asian ideograph +9689East Asian ideograph +9682East Asian ideograph +9683East Asian ideograph +9696East Asian ideograph +9697East Asian ideograph +96A4East Asian ideograph +96A9East Asian ideograph +96AEEast Asian ideograph +96B0East Asian ideograph +96B2East Asian ideograph +96B3East Asian ideograph +96B9East Asian ideograph +96BCEast Asian ideograph +96CEEast Asian ideograph +96CAEast Asian ideograph +96D2East Asian ideograph +96DFEast Asian ideograph +96D8East Asian ideograph +96DDEast Asian ideograph +96E9East Asian ideograph +96F1East Asian ideograph +96F0East Asian ideograph +96F4East Asian ideograph +96FAEast Asian ideograph +96F5East Asian ideograph +96FFEast Asian ideograph +9702East Asian ideograph +9708East Asian ideograph +9705East Asian ideograph +971BEast Asian ideograph +971DEast Asian ideograph +9719East Asian ideograph +9723East Asian ideograph +9722East Asian ideograph +9724East Asian ideograph +9728East Asian ideograph +9726East Asian ideograph +9731East Asian ideograph +9730East Asian ideograph +9736East Asian ideograph +9741East Asian ideograph +9747East Asian ideograph +9746East Asian ideograph +9749East Asian ideograph +9758East Asian ideograph +975AEast Asian ideograph +975DEast Asian ideograph +975FEast Asian ideograph +9764East Asian ideograph +9767East Asian ideograph +976BEast Asian ideograph +976EEast Asian ideograph +9777East Asian ideograph +9778East Asian ideograph +9773East Asian ideograph +9783East Asian ideograph +977AEast Asian ideograph +9780East Asian ideograph +9781East Asian ideograph +9784East Asian ideograph +977FEast Asian ideograph +9789East Asian ideograph +9794East Asian ideograph +979BEast Asian ideograph +979FEast Asian ideograph +979AEast Asian ideograph +979CEast Asian ideograph +97ACEast Asian ideograph +97AEEast Asian ideograph +97A8East Asian ideograph +97ABEast Asian ideograph +97A5East Asian ideograph +97B2East Asian ideograph +97B4East Asian ideograph +97B3East Asian ideograph +97B5East Asian ideograph +97B9East Asian ideograph +97B8East Asian ideograph +97BEEast Asian ideograph +97C0East Asian ideograph +97C5East Asian ideograph +97C9East Asian ideograph +97CEEast Asian ideograph +97CDEast Asian ideograph +97D0East Asian ideograph +97D4East Asian ideograph +97D8East Asian ideograph +97D9East Asian ideograph +97DDEast Asian ideograph +97DEEast Asian ideograph +97E0East Asian ideograph +97E1East Asian ideograph +97F5East Asian ideograph +97FAEast Asian ideograph +9807East Asian ideograph +980FEast Asian ideograph +980DEast Asian ideograph +980EEast Asian ideograph +9816East Asian ideograph +9826East Asian ideograph +981EEast Asian ideograph +982BEast Asian ideograph +9820East Asian ideograph +981FEast Asian ideograph +9833East Asian ideograph +982EEast Asian ideograph +982FEast Asian ideograph +9832East Asian ideograph +9847East Asian ideograph +9844East Asian ideograph +9852East Asian ideograph +984BEast Asian ideograph +983FEast Asian ideograph +985CEast Asian ideograph +9859East Asian ideograph +9857East Asian ideograph +9856East Asian ideograph +9862East Asian ideograph +9868East Asian ideograph +9865East Asian ideograph +9866East Asian ideograph +986CEast Asian ideograph +9873East Asian ideograph +9874East Asian ideograph +98ADEast Asian ideograph +98B4East Asian ideograph +98B8East Asian ideograph +98BFEast Asian ideograph +98BBEast Asian ideograph +98C0East Asian ideograph +98C6East Asian ideograph +98E1East Asian ideograph +98E3East Asian ideograph +98E4East Asian ideograph +98E5East Asian ideograph +98F1East Asian ideograph +98EBEast Asian ideograph +9907East Asian ideograph +9902East Asian ideograph +9916East Asian ideograph +9914East Asian ideograph +9917East Asian ideograph +9911East Asian ideograph +9915East Asian ideograph +9924East Asian ideograph +991FEast Asian ideograph +991CEast Asian ideograph +9929East Asian ideograph +9927East Asian ideograph +991AEast Asian ideograph +992EEast Asian ideograph +992CEast Asian ideograph +992AEast Asian ideograph +9933East Asian ideograph +E9729942Variant of 4D5154 which maps to 9942 +9932East Asian ideograph +992BEast Asian ideograph +9931East Asian ideograph +993BEast Asian ideograph +993AEast Asian ideograph +9941East Asian ideograph +9940East Asian ideograph +993CEast Asian ideograph +9948East Asian ideograph +9947East Asian ideograph +9949East Asian ideograph +9943East Asian ideograph +994DEast Asian ideograph +994CEast Asian ideograph +994EEast Asian ideograph +9950East Asian ideograph +9958East Asian ideograph +9954East Asian ideograph +9955East Asian ideograph +E9739957Variant of 475222 which maps to 9957 +995DEast Asian ideograph +995FEast Asian ideograph +9997East Asian ideograph +9998East Asian ideograph +99A3East Asian ideograph +99A1East Asian ideograph +99A6East Asian ideograph +99A9East Asian ideograph +99AAEast Asian ideograph +99B5East Asian ideograph +99BFEast Asian ideograph +99BCEast Asian ideograph +99C3East Asian ideograph +99B9East Asian ideograph +99BDEast Asian ideograph +99D3East Asian ideograph +99D4East Asian ideograph +99C9East Asian ideograph +99D8East Asian ideograph +99ECEast Asian ideograph +99F0East Asian ideograph +99E3East Asian ideograph +99EAEast Asian ideograph +9A02East Asian ideograph +99F8East Asian ideograph +99F4East Asian ideograph +99FBEast Asian ideograph +99FDEast Asian ideograph +9A0FEast Asian ideograph +9A0BEast Asian ideograph +9A09East Asian ideograph +9A04East Asian ideograph +9A11East Asian ideograph +9A05East Asian ideograph +9A10East Asian ideograph +9A24East Asian ideograph +9A22East Asian ideograph +9A20East Asian ideograph +9A27East Asian ideograph +9A2FEast Asian ideograph +9A38East Asian ideograph +9A2DEast Asian ideograph +9A35East Asian ideograph +9A32East Asian ideograph +9A36East Asian ideograph +9A2EEast Asian ideograph +9A41East Asian ideograph +9A3BEast Asian ideograph +9A42East Asian ideograph +9A44East Asian ideograph +9A48East Asian ideograph +9A4CEast Asian ideograph +9A4DEast Asian ideograph +9A52East Asian ideograph +9A4AEast Asian ideograph +9A58East Asian ideograph +9A56East Asian ideograph +9A64East Asian ideograph +9A66East Asian ideograph +9A6BEast Asian ideograph +9AADEast Asian ideograph +9AABEast Asian ideograph +9AB1East Asian ideograph +9AB3East Asian ideograph +9AB6East Asian ideograph +9ABBEast Asian ideograph +9ABAEast Asian ideograph +9ABDEast Asian ideograph +9AC1East Asian ideograph +9AC0East Asian ideograph +9AC2East Asian ideograph +9AC8East Asian ideograph +9AD0East Asian ideograph +9AD1East Asian ideograph +9AD6East Asian ideograph +9ADCEast Asian ideograph +9ADFEast Asian ideograph +9AE0East Asian ideograph +9AE2East Asian ideograph +9AE7East Asian ideograph +9AEBEast Asian ideograph +9AF2East Asian ideograph +9AEFEast Asian ideograph +9AF9East Asian ideograph +9AFDEast Asian ideograph +9B01East Asian ideograph +9B02East Asian ideograph +9B00East Asian ideograph +9B08East Asian ideograph +9B04East Asian ideograph +9B05East Asian ideograph +9B0BEast Asian ideograph +9B0EEast Asian ideograph +9B11East Asian ideograph +9B10East Asian ideograph +9B18East Asian ideograph +9B1DEast Asian ideograph +9B1FEast Asian ideograph +9B23East Asian ideograph +9B29East Asian ideograph +9B2DEast Asian ideograph +E9F2East Asian ideograph not in Unicode +9B2FEast Asian ideograph +9B34East Asian ideograph +9B35East Asian ideograph +9B37East Asian ideograph +9B43East Asian ideograph +9B48East Asian ideograph +9B4EEast Asian ideograph +9B4DEast Asian ideograph +9B4BEast Asian ideograph +9B51East Asian ideograph +9B74East Asian ideograph +9B68East Asian ideograph +9B80East Asian ideograph +9B8CEast Asian ideograph +9B95East Asian ideograph +9B7DEast Asian ideograph +9B83East Asian ideograph +9B8EEast Asian ideograph +9B90East Asian ideograph +9B93East Asian ideograph +9B97East Asian ideograph +9B92East Asian ideograph +9B98East Asian ideograph +9B9FEast Asian ideograph +9B9DEast Asian ideograph +9BADEast Asian ideograph +9B9AEast Asian ideograph +9BA8East Asian ideograph +9B9EEast Asian ideograph +9B99East Asian ideograph +9B86East Asian ideograph +9BA0East Asian ideograph +9BC7East Asian ideograph +9BD2East Asian ideograph +9BC6East Asian ideograph +9BBFEast Asian ideograph +9BC1East Asian ideograph +9BB9East Asian ideograph +9BBBEast Asian ideograph +9BD3East Asian ideograph +9BC0East Asian ideograph +9BC8East Asian ideograph +9BD7East Asian ideograph +9BD6East Asian ideograph +9BEBEast Asian ideograph +9BD5East Asian ideograph +9BE4East Asian ideograph +9BF1East Asian ideograph +9BE1East Asian ideograph +9BDBEast Asian ideograph +9BE2East Asian ideograph +9BF0East Asian ideograph +9BD4East Asian ideograph +9BFFEast Asian ideograph +9C06East Asian ideograph +9C15East Asian ideograph +9C0AEast Asian ideograph +9C08East Asian ideograph +9C14East Asian ideograph +9C04East Asian ideograph +9C02East Asian ideograph +9C10East Asian ideograph +9C12East Asian ideograph +9C09East Asian ideograph +9C1CEast Asian ideograph +9C2FEast Asian ideograph +9C23East Asian ideograph +9C2EEast Asian ideograph +9C28East Asian ideograph +9C21East Asian ideograph +9C24East Asian ideograph +9C46East Asian ideograph +9C32East Asian ideograph +9C44East Asian ideograph +9C48East Asian ideograph +9C39East Asian ideograph +9C33East Asian ideograph +9C47East Asian ideograph +9C35East Asian ideograph +9C37East Asian ideograph +9C52East Asian ideograph +9C58East Asian ideograph +9C51East Asian ideograph +9C63East Asian ideograph +9C67East Asian ideograph +9C5FEast Asian ideograph +9C60East Asian ideograph +9C6DEast Asian ideograph +9C68East Asian ideograph +9C6FEast Asian ideograph +9C6EEast Asian ideograph +9C7AEast Asian ideograph +9CE7East Asian ideograph +9CF0East Asian ideograph +9CF2East Asian ideograph +9D02East Asian ideograph +9D03East Asian ideograph +9CF7East Asian ideograph +9D04East Asian ideograph +9D07East Asian ideograph +9CF8East Asian ideograph +9D2AEast Asian ideograph +9D25East Asian ideograph +9D1EEast Asian ideograph +9D1DEast Asian ideograph +9D1FEast Asian ideograph +9D41East Asian ideograph +9D36East Asian ideograph +9D3EEast Asian ideograph +9D30East Asian ideograph +9D42East Asian ideograph +9D40East Asian ideograph +9D3DEast Asian ideograph +9D5CEast Asian ideograph +9D53East Asian ideograph +9D59East Asian ideograph +9D5AEast Asian ideograph +9D52East Asian ideograph +9D77East Asian ideograph +9D8AEast Asian ideograph +9D7AEast Asian ideograph +9D87East Asian ideograph +9D78East Asian ideograph +9D7EEast Asian ideograph +9D69East Asian ideograph +9D7BEast Asian ideograph +9D83East Asian ideograph +9D6FEast Asian ideograph +9DA9East Asian ideograph +9D92East Asian ideograph +9D98East Asian ideograph +9DA4East Asian ideograph +9DAAEast Asian ideograph +9DA1East Asian ideograph +9D9AEast Asian ideograph +9D96East Asian ideograph +9DB1East Asian ideograph +9DB6East Asian ideograph +9DBCEast Asian ideograph +9DC0East Asian ideograph +9DC1East Asian ideograph +9DB8East Asian ideograph +9DBAEast Asian ideograph +9DCFEast Asian ideograph +9DC7East Asian ideograph +9DC3East Asian ideograph +9DBBEast Asian ideograph +9DB9East Asian ideograph +9DACEast Asian ideograph +9DB2East Asian ideograph +9DDFEast Asian ideograph +9DD9East Asian ideograph +9DD6East Asian ideograph +9DDEEast Asian ideograph +9DE9East Asian ideograph +9DF2East Asian ideograph +9DF8East Asian ideograph +9DFCEast Asian ideograph +9DEBEast Asian ideograph +9DEFEast Asian ideograph +9DEDEast Asian ideograph +9DE6East Asian ideograph +9DEEEast Asian ideograph +9E07East Asian ideograph +9DFDEast Asian ideograph +9E0EEast Asian ideograph +9E11East Asian ideograph +9E15East Asian ideograph +9E18East Asian ideograph +9E1CEast Asian ideograph +9E1BEast Asian ideograph +9E1DEast Asian ideograph +9E75East Asian ideograph +9E7AEast Asian ideograph +9E7BEast Asian ideograph +9E80East Asian ideograph +9E83East Asian ideograph +9E84East Asian ideograph +9E88East Asian ideograph +9E87East Asian ideograph +9E90East Asian ideograph +9E8CEast Asian ideograph +9E95East Asian ideograph +9E91East Asian ideograph +9E9BEast Asian ideograph +9E9EEast Asian ideograph +9EADEast Asian ideograph +9EAFEast Asian ideograph +9EB0East Asian ideograph +9EC1East Asian ideograph +9EC6East Asian ideograph +9EC8East Asian ideograph +9ECCEast Asian ideograph +9ED0East Asian ideograph +9ED3East Asian ideograph +9EDAEast Asian ideograph +9EDFEast Asian ideograph +9EE3East Asian ideograph +9EE5East Asian ideograph +9EE7East Asian ideograph +9EEEEast Asian ideograph +9EF0East Asian ideograph +9EF6East Asian ideograph +9EF9East Asian ideograph +9EFBEast Asian ideograph +9EFCEast Asian ideograph +9EFDEast Asian ideograph +E9F3East Asian ideograph not in Unicode +9EFFEast Asian ideograph +9F02East Asian ideograph +9F0FEast Asian ideograph +9F10East Asian ideograph +9F12East Asian ideograph +9F16East Asian ideograph +9F17East Asian ideograph +9F1AEast Asian ideograph +9F22East Asian ideograph +9F2BEast Asian ideograph +9F26East Asian ideograph +9F2FEast Asian ideograph +9F39East Asian ideograph +9F37East Asian ideograph +9F3DEast Asian ideograph +9F41East Asian ideograph +9F45East Asian ideograph +9F46East Asian ideograph +9F48East Asian ideograph +9F49East Asian ideograph +9F4EEast Asian ideograph +9F4FEast Asian ideograph +9F54East Asian ideograph +9F55East Asian ideograph +9F57East Asian ideograph +9F60East Asian ideograph +9F6EEast Asian ideograph +9F6FEast Asian ideograph +9F76East Asian ideograph +9F8EEast Asian ideograph +9F93East Asian ideograph +9F95East Asian ideograph +9FA0East Asian ideograph +9FA5East Asian ideograph +9FA4East Asian ideograph +5E76East Asian ideograph +5E72East Asian ideograph +4E71East Asian ideograph +4E9AEast Asian ideograph +5E03East Asian ideograph +5360East Asian ideograph +6765East Asian ideograph +4ED1East Asian ideograph +4FA0East Asian ideograph +E901Duplicate simplified ideograph +4ED3East Asian ideograph +4EECEast Asian ideograph +4FE9East Asian ideograph +4E2AEast Asian ideograph +4F25East Asian ideograph +4F26East Asian ideograph +E902Duplicate simplified ideograph +4F1FEast Asian ideograph +4FA7East Asian ideograph +4FA6East Asian ideograph +5BB6East Asian ideograph +5907East Asian ideograph +6770East Asian ideograph +4F27East Asian ideograph +4F1EEast Asian ideograph +4F20East Asian ideograph +503AEast Asian ideograph +4EC5East Asian ideograph +503EEast Asian ideograph +4F24East Asian ideograph +4FA5East Asian ideograph +4EC6East Asian ideograph +4F2AEast Asian ideograph +8C61East Asian ideograph +4FA8East Asian ideograph +4EEAEast Asian ideograph +4EBFEast Asian ideograph +4EF7East Asian ideograph +4FACEast Asian ideograph +4FA9East Asian ideograph +4FEDEast Asian ideograph +50A7East Asian ideograph +E903Duplicate simplified ideograph +4FE6East Asian ideograph +4F18East Asian ideograph +507FEast Asian ideograph +50A8East Asian ideograph +4FEAEast Asian ideograph +4FE8East Asian ideograph +51F6East Asian ideograph +513FEast Asian ideograph +5156East Asian ideograph +4E24East Asian ideograph +51BBEast Asian ideograph +51EFEast Asian ideograph +514BEast Asian ideograph +5219East Asian ideograph +521AEast Asian ideograph +5240East Asian ideograph +521BEast Asian ideograph +5212East Asian ideograph +5267East Asian ideograph +5251East Asian ideograph +5218East Asian ideograph +5242East Asian ideograph +52B2East Asian ideograph +52A1East Asian ideograph +52A8East Asian ideograph +52B3East Asian ideograph +52CBEast Asian ideograph +80DCEast Asian ideograph +52BFEast Asian ideograph +52B1East Asian ideograph +529DEast Asian ideograph +6C47East Asian ideograph +532EEast Asian ideograph +533AEast Asian ideograph +5346East Asian ideograph +534FEast Asian ideograph +538CEast Asian ideograph +5389East Asian ideograph +53C2East Asian ideograph +4E1BEast Asian ideograph +5458East Asian ideograph +95EEEast Asian ideograph +54D1East Asian ideograph +4E27East Asian ideograph +5355East Asian ideograph +5524East Asian ideograph +4E54East Asian ideograph +54DFEast Asian ideograph +556CEast Asian ideograph +5417East Asian ideograph +545CEast Asian ideograph +545BEast Asian ideograph +5567East Asian ideograph +53F9East Asian ideograph +5455East Asian ideograph +5C1DEast Asian ideograph +55BDEast Asian ideograph +5520East Asian ideograph +5578East Asian ideograph +5480East Asian ideograph +53FDEast Asian ideograph +5428East Asian ideograph +55B7East Asian ideograph +E904Duplicate simplified ideograph +54DDEast Asian ideograph +55F3East Asian ideograph +549BEast Asian ideograph +5413East Asian ideograph +565CEast Asian ideograph +5411East Asian ideograph +5499East Asian ideograph +4E25East Asian ideograph +5624East Asian ideograph +556DEast Asian ideograph +55EBEast Asian ideograph +56A3East Asian ideograph +E905Duplicate simplified ideograph +5453East Asian ideograph +5631East Asian ideograph +56EFEast Asian ideograph +56F4East Asian ideograph +56EDEast Asian ideograph +5706East Asian ideograph +56E2East Asian ideograph +56FEEast Asian ideograph +6267East Asian ideograph +57A9East Asian ideograph +62A5East Asian ideograph +5C27East Asian ideograph +573AEast Asian ideograph +6D82East Asian ideograph +575EEast Asian ideograph +5757East Asian ideograph +5C18East Asian ideograph +57ABEast Asian ideograph +5811East Asian ideograph +575FEast Asian ideograph +5760East Asian ideograph +5815East Asian ideograph +575BEast Asian ideograph +57A6East Asian ideograph +538BEast Asian ideograph +5739East Asian ideograph +5792East Asian ideograph +5784East Asian ideograph +574FEast Asian ideograph +575CEast Asian ideograph +575DEast Asian ideograph +58EEEast Asian ideograph +58F6East Asian ideograph +5BFFEast Asian ideograph +4F19East Asian ideograph +68A6East Asian ideograph +5939East Asian ideograph +5941East Asian ideograph +593AEast Asian ideograph +594BEast Asian ideograph +5986East Asian ideograph +5987East Asian ideograph +5A04East Asian ideograph +5988East Asian ideograph +59AAEast Asian ideograph +5A34East Asian ideograph +5A75East Asian ideograph +5A07East Asian ideograph +59A9East Asian ideograph +5AD4East Asian ideograph +5A74East Asian ideograph +5A76East Asian ideograph +5B59East Asian ideograph +5B5AEast Asian ideograph +5B66East Asian ideograph +5B6AEast Asian ideograph +5BDDEast Asian ideograph +5B9EEast Asian ideograph +5B81East Asian ideograph +5BBDEast Asian ideograph +5BA1East Asian ideograph +5199East Asian ideograph +5BA0East Asian ideograph +5B9DEast Asian ideograph +4E13East Asian ideograph +5C06East Asian ideograph +5BFBEast Asian ideograph +5BF9East Asian ideograph +5BFCEast Asian ideograph +5C34East Asian ideograph +5C61East Asian ideograph +5C42East Asian ideograph +5C5EEast Asian ideograph +5188East Asian ideograph +5CE1East Asian ideograph +5C9BEast Asian ideograph +5C9AEast Asian ideograph +5D2DEast Asian ideograph +5C96East Asian ideograph +5C7FEast Asian ideograph +5CB3East Asian ideograph +5CE6East Asian ideograph +5DC5East Asian ideograph +5CA9East Asian ideograph +5E05East Asian ideograph +5E08East Asian ideograph +5E10East Asian ideograph +5E26East Asian ideograph +5E27East Asian ideograph +5E3CEast Asian ideograph +5E01East Asian ideograph +5E1CEast Asian ideograph +5E2EEast Asian ideograph +51E0East Asian ideograph +5E93East Asian ideograph +5750East Asian ideograph +5395East Asian ideograph +5E9FEast Asian ideograph +5E7FEast Asian ideograph +5E99East Asian ideograph +5382East Asian ideograph +5E9EEast Asian ideograph +5E90East Asian ideograph +5385East Asian ideograph +5F20East Asian ideograph +5F39East Asian ideograph +5F25East Asian ideograph +5F2FEast Asian ideograph +E906Duplicate simplified ideograph +540EEast Asian ideograph +5F84East Asian ideograph +4ECEEast Asian ideograph +590DEast Asian ideograph +5F7BEast Asian ideograph +5F81East Asian ideograph +5FF0East Asian ideograph +95F7East Asian ideograph +6005East Asian ideograph +6076East Asian ideograph +60ECEast Asian ideograph +607BEast Asian ideograph +7231East Asian ideograph +607CEast Asian ideograph +6001East Asian ideograph +5FFEEast Asian ideograph +6006East Asian ideograph +5E86East Asian ideograph +60EDEast Asian ideograph +5FE7East Asian ideograph +8651East Asian ideograph +60E8East Asian ideograph +60EFEast Asian ideograph +6078East Asian ideograph +6002East Asian ideograph +6B32East Asian ideograph +5BAAEast Asian ideograph +51EDEast Asian ideograph +60AFEast Asian ideograph +6124East Asian ideograph +60EEEast Asian ideograph +6187East Asian ideograph +60EBEast Asian ideograph +5FC6East Asian ideograph +5E94East Asian ideograph +601CEast Asian ideograph +6073East Asian ideograph +6000East Asian ideograph +61D2East Asian ideograph +60ACEast Asian ideograph +5FCFEast Asian ideograph +6151East Asian ideograph +60E7East Asian ideograph +604BEast Asian ideograph +6218East Asian ideograph +620FEast Asian ideograph +631FEast Asian ideograph +5377East Asian ideograph +626BEast Asian ideograph +626AEast Asian ideograph +6302East Asian ideograph +62A1East Asian ideograph +62E3East Asian ideograph +626CEast Asian ideograph +6325East Asian ideograph +635FEast Asian ideograph +6363East Asian ideograph +62A2East Asian ideograph +5C4FEast Asian ideograph +631AEast Asian ideograph +6402East Asian ideograph +63B4East Asian ideograph +635EEast Asian ideograph +62E8East Asian ideograph +6320East Asian ideograph +6251East Asian ideograph +629AEast Asian ideograph +62E5East Asian ideograph +51FBEast Asian ideograph +631EEast Asian ideograph +6321East Asian ideograph +636EEast Asian ideograph +63B3East Asian ideograph +62E9East Asian ideograph +62C5East Asian ideograph +6361East Asian ideograph +6324East Asian ideograph +62E7East Asian ideograph +62DFEast Asian ideograph +6401East Asian ideograph +6269East Asian ideograph +63B7East Asian ideograph +64B5East Asian ideograph +6270East Asian ideograph +64DEEast Asian ideograph +6446East Asian ideograph +62E2East Asian ideograph +62E6East Asian ideograph +6400East Asian ideograph +6444East Asian ideograph +631BEast Asian ideograph +644AEast Asian ideograph +6405East Asian ideograph +63FDEast Asian ideograph +8D25East Asian ideograph +542FEast Asian ideograph +654CEast Asian ideograph +6570East Asian ideograph +655BEast Asian ideograph +6BD9East Asian ideograph +65A9East Asian ideograph +65ADEast Asian ideograph +65F6East Asian ideograph +663CEast Asian ideograph +6656East Asian ideograph +6655East Asian ideograph +7545East Asian ideograph +6682East Asian ideograph +6653East Asian ideograph +E907Duplicate simplified ideograph +66A7East Asian ideograph +65F7East Asian ideograph +4E66East Asian ideograph +4F1AEast Asian ideograph +80E7East Asian ideograph +4E1CEast Asian ideograph +6761East Asian ideograph +67ADEast Asian ideograph +6800East Asian ideograph +5F03East Asian ideograph +6816East Asian ideograph +680BEast Asian ideograph +6808East Asian ideograph +67A3East Asian ideograph +832DEast Asian ideograph +6781East Asian ideograph +6768East Asian ideograph +6862East Asian ideograph +4E1AEast Asian ideograph +67ABEast Asian ideograph +8363East Asian ideograph +6784East Asian ideograph +67AAEast Asian ideograph +6837East Asian ideograph +6869East Asian ideograph +6807East Asian ideograph +67A2East Asian ideograph +697CEast Asian ideograph +6868East Asian ideograph +4E50East Asian ideograph +679EEast Asian ideograph +692DEast Asian ideograph +6811East Asian ideograph +6866East Asian ideograph +6734East Asian ideograph +6865East Asian ideograph +673AEast Asian ideograph +6863East Asian ideograph +68C0East Asian ideograph +6867East Asian ideograph +67E0East Asian ideograph +69DFEast Asian ideograph +67DCEast Asian ideograph +69DBEast Asian ideograph +6988East Asian ideograph +691FEast Asian ideograph +6809East Asian ideograph +6A79East Asian ideograph +680FEast Asian ideograph +6A31East Asian ideograph +6743East Asian ideograph +6984East Asian ideograph +94A6East Asian ideograph +E908Duplicate simplified ideograph +6B27East Asian ideograph +6B24East Asian ideograph +6B22East Asian ideograph +5C81East Asian ideograph +5386East Asian ideograph +5F52East Asian ideograph +6B8BEast Asian ideograph +6B87East Asian ideograph +6B93East Asian ideograph +6BA1East Asian ideograph +6B7CEast Asian ideograph +6740East Asian ideograph +58F3East Asian ideograph +6BB4East Asian ideograph +6C14East Asian ideograph +6C22East Asian ideograph +6CFEEast Asian ideograph +6CEAEast Asian ideograph +6D45East Asian ideograph +6E0AEast Asian ideograph +6CA6East Asian ideograph +6D8CEast Asian ideograph +6C64East Asian ideograph +6D4BEast Asian ideograph +6DA1East Asian ideograph +6D51East Asian ideograph +6C9FEast Asian ideograph +6C85East Asian ideograph +706DEast Asian ideograph +6E7FEast Asian ideograph +6CA7East Asian ideograph +51C6East Asian ideograph +6CAAEast Asian ideograph +6E0DEast Asian ideograph +6DA8East Asian ideograph +6C49East Asian ideograph +6EE1East Asian ideograph +6D9FEast Asian ideograph +6E10East Asian ideograph +6EDEEast Asian ideograph +6D46East Asian ideograph +6E17East Asian ideograph +6E14East Asian ideograph +6CFCEast Asian ideograph +6DA6East Asian ideograph +6DA7East Asian ideograph +6D01East Asian ideograph +6D47East Asian ideograph +6E83East Asian ideograph +6DC0East Asian ideograph +6D53East Asian ideograph +6CFDEast Asian ideograph +6D4AEast Asian ideograph +6D4EEast Asian ideograph +6CDEEast Asian ideograph +6EE8East Asian ideograph +6EE5East Asian ideograph +6D9BEast Asian ideograph +6DA9East Asian ideograph +6C88East Asian ideograph +6CFBEast Asian ideograph +6E0EEast Asian ideograph +6E85East Asian ideograph +6EE4East Asian ideograph +6D4FEast Asian ideograph +6FD1East Asian ideograph +6CA5East Asian ideograph +6FD2East Asian ideograph +6F47East Asian ideograph +6F9CEast Asian ideograph +6D12East Asian ideograph +6EE9East Asian ideograph +6E7EEast Asian ideograph +6EE6East Asian ideograph +707EEast Asian ideograph +4E3AEast Asian ideograph +4E4CEast Asian ideograph +65E0East Asian ideograph +70BCEast Asian ideograph +70E6East Asian ideograph +7080East Asian ideograph +6247East Asian ideograph +70EDEast Asian ideograph +70EBEast Asian ideograph +70BDEast Asian ideograph +7096East Asian ideograph +706FEast Asian ideograph +7116East Asian ideograph +70E7East Asian ideograph +8425East Asian ideograph +70DBEast Asian ideograph +707FEast Asian ideograph +70E9East Asian ideograph +70C1East Asian ideograph +7089East Asian ideograph +70C2East Asian ideograph +7237East Asian ideograph +5C14East Asian ideograph +5899East Asian ideograph +724DEast Asian ideograph +5B83East Asian ideograph +7275East Asian ideograph +8366East Asian ideograph +728AEast Asian ideograph +727AEast Asian ideograph +72B6East Asian ideograph +72EDEast Asian ideograph +72C8East Asian ideograph +72B9East Asian ideograph +72F1East Asian ideograph +72EFEast Asian ideograph +72EEEast Asian ideograph +72ECEast Asian ideograph +72DEEast Asian ideograph +83B7East Asian ideograph +72B7East Asian ideograph +517DEast Asian ideograph +730EEast Asian ideograph +736DEast Asian ideograph +732EEast Asian ideograph +7321East Asian ideograph +73B0East Asian ideograph +73F2East Asian ideograph +739BEast Asian ideograph +7410East Asian ideograph +7391East Asian ideograph +73AFEast Asian ideograph +7477East Asian ideograph +73BAEast Asian ideograph +73D1East Asian ideograph +74EFEast Asian ideograph +4EA7East Asian ideograph +4EA9East Asian ideograph +7544East Asian ideograph +6BD5East Asian ideograph +5F02East Asian ideograph +753BEast Asian ideograph +5F53East Asian ideograph +7574East Asian ideograph +8FEDEast Asian ideograph +75C9East Asian ideograph +75A1East Asian ideograph +759FEast Asian ideograph +75EAEast Asian ideograph +75AFEast Asian ideograph +75AEEast Asian ideograph +75E8East Asian ideograph +7597East Asian ideograph +75A0East Asian ideograph +75D2East Asian ideograph +765EEast Asian ideograph +763EEast Asian ideograph +7663East Asian ideograph +762BEast Asian ideograph +766BEast Asian ideograph +53D1East Asian ideograph +7691East Asian ideograph +76B1East Asian ideograph +76CFEast Asian ideograph +5C3DEast Asian ideograph +76D1East Asian ideograph +76D8East Asian ideograph +5362East Asian ideograph +4F17East Asian ideograph +56F0East Asian ideograph +7750East Asian ideograph +4E86East Asian ideograph +77A9East Asian ideograph +77EBEast Asian ideograph +781AEast Asian ideograph +7815East Asian ideograph +7855East Asian ideograph +786EEast Asian ideograph +7801East Asian ideograph +7816East Asian ideograph +77F6East Asian ideograph +7840East Asian ideograph +788DEast Asian ideograph +77FFEast Asian ideograph +77FEEast Asian ideograph +783AEast Asian ideograph +783EEast Asian ideograph +E909Duplicate simplified ideograph +7978East Asian ideograph +796FEast Asian ideograph +7985East Asian ideograph +793CEast Asian ideograph +7977East Asian ideograph +4E07East Asian ideograph +53B6East Asian ideograph +5E0CEast Asian ideograph +79F0East Asian ideograph +79CDEast Asian ideograph +8C37East Asian ideograph +79EFEast Asian ideograph +7A23East Asian ideograph +7A51East Asian ideograph +79FDEast Asian ideograph +E90ADuplicate simplified ideograph +7A33East Asian ideograph +6D3CEast Asian ideograph +7A9DEast Asian ideograph +7A77East Asian ideograph +7AA5East Asian ideograph +7A8DEast Asian ideograph +7A9CEast Asian ideograph +7AA6East Asian ideograph +7A83East Asian ideograph +7ADEEast Asian ideograph +E90BDuplicate simplified ideograph +7B14East Asian ideograph +7B0BEast Asian ideograph +8345East Asian ideograph +94B3East Asian ideograph +7B3AEast Asian ideograph +8303East Asian ideograph +8282East Asian ideograph +7BACEast Asian ideograph +7B03East Asian ideograph +7B51East Asian ideograph +7B5BEast Asian ideograph +7BD3East Asian ideograph +7B80East Asian ideograph +7BABEast Asian ideograph +7BAAEast Asian ideograph +7BD1East Asian ideograph +5E18East Asian ideograph +7B7EEast Asian ideograph +7BEEEast Asian ideograph +7B79East Asian ideograph +7B3CEast Asian ideograph +7C41East Asian ideograph +E90CDuplicate simplified ideograph +7BF1East Asian ideograph +7BA9East Asian ideograph +5401East Asian ideograph +7C8BEast Asian ideograph +E90DDuplicate simplified ideograph +7CAAEast Asian ideograph +7CAEEast Asian ideograph +7EA0East Asian ideograph +7EAAEast Asian ideograph +7EA3East Asian ideograph +7EA2East Asian ideograph +7EABEast Asian ideograph +7EA6East Asian ideograph +7EA5East Asian ideograph +7EBAEast Asian ideograph +7EB9East Asian ideograph +7EADEast Asian ideograph +7EB0East Asian ideograph +7EAFEast Asian ideograph +7EBDEast Asian ideograph +7EB1East Asian ideograph +7EB3East Asian ideograph +7EA7East Asian ideograph +7EB8East Asian ideograph +7EB7East Asian ideograph +7ECAEast Asian ideograph +7ECBEast Asian ideograph +624EEast Asian ideograph +7ECDEast Asian ideograph +7EC4East Asian ideograph +7EC6East Asian ideograph +7EC5East Asian ideograph +7ECCEast Asian ideograph +7EC8East Asian ideograph +7EDFEast Asian ideograph +7EDEEast Asian ideograph +7ED2East Asian ideograph +7ED3East Asian ideograph +7EDAEast Asian ideograph +7EDDEast Asian ideograph +7EDCEast Asian ideograph +7ED9East Asian ideograph +4E1DEast Asian ideograph +7ECFEast Asian ideograph +6346East Asian ideograph +7EE2East Asian ideograph +7EE5East Asian ideograph +7ED1East Asian ideograph +7EFCEast Asian ideograph +7EFDEast Asian ideograph +7EFEEast Asian ideograph +7D27East Asian ideograph +7EEBEast Asian ideograph +7F00East Asian ideograph +7F51East Asian ideograph +7EB2East Asian ideograph +7EF0East Asian ideograph +7EFFEast Asian ideograph +7EF8East Asian ideograph +7EF4East Asian ideograph +7EF5East Asian ideograph +7EB6East Asian ideograph +7F01East Asian ideograph +7F14East Asian ideograph +7EACEast Asian ideograph +7EC3East Asian ideograph +7EEAEast Asian ideograph +7F04East Asian ideograph +7F05East Asian ideograph +7F09East Asian ideograph +7F13East Asian ideograph +7F18East Asian ideograph +7F16East Asian ideograph +7EBFEast Asian ideograph +7F0DEast Asian ideograph +7F0EEast Asian ideograph +7F23East Asian ideograph +7F22East Asian ideograph +8426East Asian ideograph +7F1AEast Asian ideograph +81F4East Asian ideograph +E97453BFVariant of 455164 which maps to 53BF +7F29East Asian ideograph +7EE9East Asian ideograph +7F2AEast Asian ideograph +7F15East Asian ideograph +7F27East Asian ideograph +7F1DEast Asian ideograph +603BEast Asian ideograph +7EB5East Asian ideograph +7F2BEast Asian ideograph +7F2EEast Asian ideograph +7EC7East Asian ideograph +7EE3East Asian ideograph +7ED5East Asian ideograph +7F2DEast Asian ideograph +E90EDuplicate simplified ideograph +7EF3East Asian ideograph +8327East Asian ideograph +7ECEEast Asian ideograph +7ED8East Asian ideograph +8FABEast Asian ideograph +7F24East Asian ideograph +7EE7East Asian ideograph +7F20East Asian ideograph +7EEDEast Asian ideograph +7F28East Asian ideograph +7EA4East Asian ideograph +7F06East Asian ideograph +7F5AEast Asian ideograph +9A82East Asian ideograph +7F62East Asian ideograph +7F57East Asian ideograph +7F81East Asian ideograph +4E49East Asian ideograph +4E60East Asian ideograph +7FC6East Asian ideograph +7FD8East Asian ideograph +5723East Asian ideograph +95FBEast Asian ideograph +58F0East Asian ideograph +8038East Asian ideograph +806AEast Asian ideograph +8054East Asian ideograph +804CEast Asian ideograph +8042East Asian ideograph +804BEast Asian ideograph +542CEast Asian ideograph +8083East Asian ideograph +80C1East Asian ideograph +8090East Asian ideograph +8109East Asian ideograph +80BEEast Asian ideograph +80C0East Asian ideograph +80A0East Asian ideograph +80BFEast Asian ideograph +8111East Asian ideograph +80F6East Asian ideograph +80A4East Asian ideograph +817BEast Asian ideograph +8113East Asian ideograph +80C6East Asian ideograph +8138East Asian ideograph +810DEast Asian ideograph +8110East Asian ideograph +8191East Asian ideograph +814AEast Asian ideograph +80EAEast Asian ideograph +E90FDuplicate simplified ideograph +4E34East Asian ideograph +53F0East Asian ideograph +4E0EEast Asian ideograph +5174East Asian ideograph +4E3EEast Asian ideograph +65E7East Asian ideograph +8231East Asian ideograph +8230East Asian ideograph +8270East Asian ideograph +E910Duplicate simplified ideograph +520DEast Asian ideograph +835AEast Asian ideograph +830EEast Asian ideograph +82CBEast Asian ideograph +5E84East Asian ideograph +534EEast Asian ideograph +83B1East Asian ideograph +82C7East Asian ideograph +53F6East Asian ideograph +E911Duplicate simplified ideograph +8364East Asian ideograph +83B4East Asian ideograph +5E2DEast Asian ideograph +836AEast Asian ideograph +82CEEast Asian ideograph +82CDEast Asian ideograph +8298East Asian ideograph +83B2East Asian ideograph +836BEast Asian ideograph +848BEast Asian ideograph +535CEast Asian ideograph +8361East Asian ideograph +829CEast Asian ideograph +8427East Asian ideograph +59DCEast Asian ideograph +8537East Asian ideograph +84DDEast Asian ideograph +8428East Asian ideograph +501FEast Asian ideograph +827AEast Asian ideograph +85AEEast Asian ideograph +836FEast Asian ideograph +853CEast Asian ideograph +853AEast Asian ideograph +82A6East Asian ideograph +82F9East Asian ideograph +82CFEast Asian ideograph +8574East Asian ideograph +5170East Asian ideograph +85D3East Asian ideograph +841DEast Asian ideograph +4E47East Asian ideograph +5904East Asian ideograph +864FEast Asian ideograph +53F7East Asian ideograph +4E8FEast Asian ideograph +65E6East Asian ideograph +8680East Asian ideograph +E912Duplicate simplified ideograph +867EEast Asian ideograph +8424East Asian ideograph +8682East Asian ideograph +877CEast Asian ideograph +86F2East Asian ideograph +866BEast Asian ideograph +8749East Asian ideograph +8681East Asian ideograph +8747East Asian ideograph +86CEEast Asian ideograph +8721East Asian ideograph +86CAEast Asian ideograph +8695East Asian ideograph +86EEEast Asian ideograph +672EEast Asian ideograph +4E8DEast Asian ideograph +536BEast Asian ideograph +E913Duplicate simplified ideograph +8865East Asian ideograph +91CCEast Asian ideograph +88C5East Asian ideograph +5236East Asian ideograph +8934East Asian ideograph +88E4East Asian ideograph +4EB5East Asian ideograph +891BEast Asian ideograph +88C6East Asian ideograph +8884East Asian ideograph +889CEast Asian ideograph +886CEast Asian ideograph +88ADEast Asian ideograph +89C1East Asian ideograph +89C4East Asian ideograph +89C5East Asian ideograph +89C6East Asian ideograph +4EB2East Asian ideograph +89CEEast Asian ideograph +89CAEast Asian ideograph +89D0East Asian ideograph +89C9East Asian ideograph +89C8East Asian ideograph +89C2East Asian ideograph +89DEEast Asian ideograph +8BA1East Asian ideograph +8BA2East Asian ideograph +8BA3East Asian ideograph +8BA6East Asian ideograph +8BB0East Asian ideograph +8BA8East Asian ideograph +8BA7East Asian ideograph +8BAAEast Asian ideograph +8BAFEast Asian ideograph +8BABEast Asian ideograph +8BADEast Asian ideograph +8BBFEast Asian ideograph +8BC0East Asian ideograph +8BB6East Asian ideograph +8BB7East Asian ideograph +8BB8East Asian ideograph +8BBEEast Asian ideograph +8BB9East Asian ideograph +8BBCEast Asian ideograph +6CE8East Asian ideograph +8BC4East Asian ideograph +8BCDEast Asian ideograph +8BC2East Asian ideograph +8BCFEast Asian ideograph +8BC5East Asian ideograph +8BC8East Asian ideograph +8BCBEast Asian ideograph +8BC9East Asian ideograph +8BCAEast Asian ideograph +8BE7East Asian ideograph +8BE5East Asian ideograph +8BE6East Asian ideograph +8BD5East Asian ideograph +8BD7East Asian ideograph +8BD8East Asian ideograph +8BE3East Asian ideograph +8BD9East Asian ideograph +8BDAEast Asian ideograph +5938East Asian ideograph +8BDBEast Asian ideograph +8BE1East Asian ideograph +8BE2East Asian ideograph +8BDDEast Asian ideograph +8BE0East Asian ideograph +8BDFEast Asian ideograph +8BF4East Asian ideograph +8BF5East Asian ideograph +8BEBEast Asian ideograph +8BEDEast Asian ideograph +5FD7East Asian ideograph +8BECEast Asian ideograph +8BA4East Asian ideograph +8BEFEast Asian ideograph +8BF2East Asian ideograph +8BF0East Asian ideograph +8BF1East Asian ideograph +8BF3East Asian ideograph +8C0AEast Asian ideograph +8C06East Asian ideograph +8C05East Asian ideograph +8C08East Asian ideograph +8BF7East Asian ideograph +8BF8East Asian ideograph +8BFEEast Asian ideograph +8C03East Asian ideograph +8BFFEast Asian ideograph +8C04East Asian ideograph +8C01East Asian ideograph +8BDEEast Asian ideograph +8BBAEast Asian ideograph +8C1BEast Asian ideograph +8C1AEast Asian ideograph +8C0FEast Asian ideograph +8BB3East Asian ideograph +8C10East Asian ideograph +8C0DEast Asian ideograph +8C0BEast Asian ideograph +8C12East Asian ideograph +8C13East Asian ideograph +8BFAEast Asian ideograph +8BBDEast Asian ideograph +8C15East Asian ideograph +8C24East Asian ideograph +8C26East Asian ideograph +8C1CEast Asian ideograph +8BB2East Asian ideograph +8C0EEast Asian ideograph +8C23East Asian ideograph +8A8AEast Asian ideograph +8C22East Asian ideograph +8C28East Asian ideograph +8C2CEast Asian ideograph +8C1FEast Asian ideograph +8BC6East Asian ideograph +8C31East Asian ideograph +8C32East Asian ideograph +8BC1East Asian ideograph +8C2DEast Asian ideograph +8BA5East Asian ideograph +8BAEEast Asian ideograph +8BD1East Asian ideograph +8C34East Asian ideograph +62A4East Asian ideograph +8A89East Asian ideograph +8BFBEast Asian ideograph +53D8East Asian ideograph +8BA9East Asian ideograph +8C36East Asian ideograph +8C17East Asian ideograph +5C82East Asian ideograph +7AD6East Asian ideograph +4E30East Asian ideograph +4E88East Asian ideograph +7683East Asian ideograph +8D1DEast Asian ideograph +8D1EEast Asian ideograph +8D1FEast Asian ideograph +8D21East Asian ideograph +8D22East Asian ideograph +8D23East Asian ideograph +8D2FEast Asian ideograph +8D27East Asian ideograph +8D2AEast Asian ideograph +8D2BEast Asian ideograph +8D29East Asian ideograph +8D39East Asian ideograph +8D32East Asian ideograph +8D3AEast Asian ideograph +8D35East Asian ideograph +8D34East Asian ideograph +4E70East Asian ideograph +8D2CEast Asian ideograph +8D3BEast Asian ideograph +8D37East Asian ideograph +8D38East Asian ideograph +8D45East Asian ideograph +8D44East Asian ideograph +8D3CEast Asian ideograph +8D3EEast Asian ideograph +8D3FEast Asian ideograph +8D40East Asian ideograph +8D41East Asian ideograph +8D42East Asian ideograph +5BBEEast Asian ideograph +8D48East Asian ideograph +8D4AEast Asian ideograph +8D54East Asian ideograph +8D4BEast Asian ideograph +5356East Asian ideograph +8D24East Asian ideograph +8D31East Asian ideograph +8D4FEast Asian ideograph +8D50East Asian ideograph +8D28East Asian ideograph +8D4CEast Asian ideograph +8D56East Asian ideograph +8D5BEast Asian ideograph +8D5AEast Asian ideograph +8D58East Asian ideograph +8D2DEast Asian ideograph +8D60East Asian ideograph +8D5DEast Asian ideograph +8D5EEast Asian ideograph +8D62East Asian ideograph +8D61East Asian ideograph +8D43East Asian ideograph +8D4EEast Asian ideograph +8D63East Asian ideograph +8D75East Asian ideograph +8D76East Asian ideograph +8D8BEast Asian ideograph +8DF5East Asian ideograph +8E0AEast Asian ideograph +8E52East Asian ideograph +8DF7East Asian ideograph +8DB8East Asian ideograph +8E0CEast Asian ideograph +8DC3East Asian ideograph +8E2FEast Asian ideograph +8E51East Asian ideograph +8E8FEast Asian ideograph +8EAFEast Asian ideograph +8F66East Asian ideograph +8F67East Asian ideograph +519BEast Asian ideograph +8F68East Asian ideograph +8F69East Asian ideograph +8F6BEast Asian ideograph +8F6FEast Asian ideograph +8F6DEast Asian ideograph +8F72East Asian ideograph +8F74East Asian ideograph +8F76East Asian ideograph +8F83East Asian ideograph +8F7CEast Asian ideograph +8F7DEast Asian ideograph +8F7EEast Asian ideograph +8F85East Asian ideograph +8F84East Asian ideograph +8F7BEast Asian ideograph +8F87East Asian ideograph +8F86East Asian ideograph +8F8DEast Asian ideograph +8F89East Asian ideograph +8F88East Asian ideograph +8F6EEast Asian ideograph +8F8EEast Asian ideograph +8F90East Asian ideograph +8F91East Asian ideograph +8F93East Asian ideograph +8F96East Asian ideograph +8F97East Asian ideograph +8F95East Asian ideograph +6BC2East Asian ideograph +8206East Asian ideograph +8F99East Asian ideograph +8F6CEast Asian ideograph +8F9AEast Asian ideograph +8F7FEast Asian ideograph +8F70East Asian ideograph +8F94East Asian ideograph +529EEast Asian ideograph +8F9EEast Asian ideograph +8FA9East Asian ideograph +519CEast Asian ideograph +8FF0East Asian ideograph +8FD9East Asian ideograph +8FDEEast Asian ideograph +8FDBEast Asian ideograph +8FD0East Asian ideograph +8FBEEast Asian ideograph +8FDDEast Asian ideograph +8FC2East Asian ideograph +8FC7East Asian ideograph +8FDCEast Asian ideograph +900AEast Asian ideograph +9012East Asian ideograph +9002East Asian ideograph +9009East Asian ideograph +8FDFEast Asian ideograph +8FC1East Asian ideograph +8FBDEast Asian ideograph +9057East Asian ideograph +8FC8East Asian ideograph +8FD8East Asian ideograph +E9758FE9Variant of 2D5C5A which maps to 8FE9 +8FB9East Asian ideograph +9026East Asian ideograph +903BEast Asian ideograph +5369East Asian ideograph +90AEEast Asian ideograph +4E61East Asian ideograph +90B9East Asian ideograph +90D1East Asian ideograph +90BBEast Asian ideograph +9093East Asian ideograph +9154East Asian ideograph +915DEast Asian ideograph +4E11East Asian ideograph +533BEast Asian ideograph +9171East Asian ideograph +917FEast Asian ideograph +8845East Asian ideograph +91CAEast Asian ideograph +5398East Asian ideograph +9488East Asian ideograph +9489East Asian ideograph +948AEast Asian ideograph +9497East Asian ideograph +9493East Asian ideograph +948FEast Asian ideograph +9499East Asian ideograph +949DEast Asian ideograph +94AEEast Asian ideograph +94A0East Asian ideograph +949EEast Asian ideograph +94A7East Asian ideograph +94A4East Asian ideograph +94B4East Asian ideograph +94B9East Asian ideograph +94B8East Asian ideograph +94C0East Asian ideograph +94BEEast Asian ideograph +94C5East Asian ideograph +94A9East Asian ideograph +94C2East Asian ideograph +94C3East Asian ideograph +94F0East Asian ideograph +94F6East Asian ideograph +94D0East Asian ideograph +94DCEast Asian ideograph +94EDEast Asian ideograph +94E2East Asian ideograph +94ECEast Asian ideograph +94E8East Asian ideograph +8854East Asian ideograph +950CEast Asian ideograph +9511East Asian ideograph +9510East Asian ideograph +94FAEast Asian ideograph +9500East Asian ideograph +94DDEast Asian ideograph +9504East Asian ideograph +9509East Asian ideograph +950BEast Asian ideograph +952DEast Asian ideograph +952FEast Asian ideograph +9530East Asian ideograph +9519East Asian ideograph +94B1East Asian ideograph +94A2East Asian ideograph +9521East Asian ideograph +94EEEast Asian ideograph +5F55East Asian ideograph +9525East Asian ideograph +9526East Asian ideograph +9540East Asian ideograph +9541East Asian ideograph +952EEast Asian ideograph +9532East Asian ideograph +9505East Asian ideograph +951AEast Asian ideograph +953EEast Asian ideograph +949FEast Asian ideograph +9524East Asian ideograph +9539East Asian ideograph +953BEast Asian ideograph +9551East Asian ideograph +9547East Asian ideograph +9501East Asian ideograph +94A8East Asian ideograph +954DEast Asian ideograph +955CEast Asian ideograph +955DEast Asian ideograph +955EEast Asian ideograph +94F2East Asian ideograph +94FFEast Asian ideograph +94FEEast Asian ideograph +9556East Asian ideograph +9557East Asian ideograph +9542East Asian ideograph +9558East Asian ideograph +9559East Asian ideograph +9535East Asian ideograph +94D9East Asian ideograph +9570East Asian ideograph +9508East Asian ideograph +956DEast Asian ideograph +94C1East Asian ideograph +94DBEast Asian ideograph +94CEEast Asian ideograph +956FEast Asian ideograph +94F8East Asian ideograph +9573East Asian ideograph +94C4East Asian ideograph +9576East Asian ideograph +94A5East Asian ideograph +92AEEast Asian ideograph +9523East Asian ideograph +94BBEast Asian ideograph +51FFEast Asian ideograph +957FEast Asian ideograph +95E8East Asian ideograph +95E9East Asian ideograph +95EAEast Asian ideograph +95EDEast Asian ideograph +95F5East Asian ideograph +95F0East Asian ideograph +5F00East Asian ideograph +95F2East Asian ideograph +95F4East Asian ideograph +95F8East Asian ideograph +9602East Asian ideograph +95FAEast Asian ideograph +95FDEast Asian ideograph +9601East Asian ideograph +9600East Asian ideograph +5408East Asian ideograph +9605East Asian ideograph +95FEEast Asian ideograph +960EEast Asian ideograph +9614East Asian ideograph +9615East Asian ideograph +9611East Asian ideograph +95F1East Asian ideograph +677FEast Asian ideograph +95EFEast Asian ideograph +9617East Asian ideograph +5173East Asian ideograph +9610East Asian ideograph +E914Duplicate simplified ideograph +9635East Asian ideograph +9648East Asian ideograph +9646East Asian ideograph +9634East Asian ideograph +961FEast Asian ideograph +9636East Asian ideograph +9633East Asian ideograph +9645East Asian ideograph +968FEast Asian ideograph +9669East Asian ideograph +9690East Asian ideograph +9647East Asian ideograph +96B6East Asian ideograph +E915Duplicate simplified ideograph +867DEast Asian ideograph +6742East Asian ideograph +9E21East Asian ideograph +96CFEast Asian ideograph +53CCEast Asian ideograph +79BBEast Asian ideograph +96BEEast Asian ideograph +4E91East Asian ideograph +7535East Asian ideograph +96FEEast Asian ideograph +9701East Asian ideograph +972DEast Asian ideograph +96F3East Asian ideograph +7075East Asian ideograph +9765East Asian ideograph +5DE9East Asian ideograph +9791East Asian ideograph +97E6East Asian ideograph +97E7East Asian ideograph +97E9East Asian ideograph +97ECEast Asian ideograph +827DEast Asian ideograph +54CDEast Asian ideograph +9875East Asian ideograph +9876East Asian ideograph +9877East Asian ideograph +9879East Asian ideograph +987AEast Asian ideograph +987BEast Asian ideograph +9884East Asian ideograph +987CEast Asian ideograph +987DEast Asian ideograph +987FEast Asian ideograph +9881East Asian ideograph +9882East Asian ideograph +9887East Asian ideograph +9886East Asian ideograph +9889East Asian ideograph +5934East Asian ideograph +988AEast Asian ideograph +9888East Asian ideograph +9891East Asian ideograph +9893East Asian ideograph +9894East Asian ideograph +9890East Asian ideograph +9897East Asian ideograph +989CEast Asian ideograph +989DEast Asian ideograph +9898East Asian ideograph +989AEast Asian ideograph +989BEast Asian ideograph +7C7BEast Asian ideograph +98A0East Asian ideograph +613FEast Asian ideograph +987EEast Asian ideograph +98A4East Asian ideograph +663EEast Asian ideograph +9885East Asian ideograph +98A6East Asian ideograph +98CEEast Asian ideograph +98D2East Asian ideograph +E916Duplicate simplified ideograph +522EEast Asian ideograph +98D3East Asian ideograph +98D5East Asian ideograph +98D8East Asian ideograph +98DEEast Asian ideograph +9965East Asian ideograph +9968East Asian ideograph +996CEast Asian ideograph +996AEast Asian ideograph +996EEast Asian ideograph +996DEast Asian ideograph +9972East Asian ideograph +9974East Asian ideograph +9971East Asian ideograph +9970East Asian ideograph +997AEast Asian ideograph +517BEast Asian ideograph +9975East Asian ideograph +9977East Asian ideograph +9981East Asian ideograph +4F59East Asian ideograph +997FEast Asian ideograph +997CEast Asian ideograph +9986East Asian ideograph +996FEast Asian ideograph +9984East Asian ideograph +9985East Asian ideograph +998FEast Asian ideograph +998AEast Asian ideograph +9992East Asian ideograph +9976East Asian ideograph +990DEast Asian ideograph +998BEast Asian ideograph +9A6CEast Asian ideograph +51AFEast Asian ideograph +9A6DEast Asian ideograph +9A70East Asian ideograph +9A6EEast Asian ideograph +9A6FEast Asian ideograph +9A73East Asian ideograph +9A7BEast Asian ideograph +9A7CEast Asian ideograph +9A7EEast Asian ideograph +9A77East Asian ideograph +9A76East Asian ideograph +9A79East Asian ideograph +9A78East Asian ideograph +9A7DEast Asian ideograph +9A87East Asian ideograph +9A86East Asian ideograph +9A8BEast Asian ideograph +9A8FEast Asian ideograph +9A88East Asian ideograph +9A91East Asian ideograph +9A97East Asian ideograph +9A9BEast Asian ideograph +9A9EEast Asian ideograph +817EEast Asian ideograph +9A9AEast Asian ideograph +9AA0East Asian ideograph +9A71East Asian ideograph +84E6East Asian ideograph +9AA1East Asian ideograph +9A84East Asian ideograph +60CAEast Asian ideograph +9A7FEast Asian ideograph +9A8CEast Asian ideograph +9AA4East Asian ideograph +9A74East Asian ideograph +9AA5East Asian ideograph +9A8AEast Asian ideograph +80AEEast Asian ideograph +9AC5East Asian ideograph +4F53East Asian ideograph +810FEast Asian ideograph +E917Duplicate simplified ideograph +E918Duplicate simplified ideograph +E919Duplicate simplified ideograph +E91ADuplicate simplified ideograph +9B13East Asian ideograph +6597East Asian ideograph +95F9East Asian ideograph +90C1East Asian ideograph +9B47East Asian ideograph +9C7CEast Asian ideograph +9C7FEast Asian ideograph +9C81East Asian ideograph +9C8DEast Asian ideograph +9C9BEast Asian ideograph +9C9CEast Asian ideograph +9C94East Asian ideograph +9CA8East Asian ideograph +9CA4East Asian ideograph +9CB8East Asian ideograph +9CB3East Asian ideograph +9CC3East Asian ideograph +9CC5East Asian ideograph +9CABEast Asian ideograph +9CCDEast Asian ideograph +9CCFEast Asian ideograph +9CA2East Asian ideograph +9CD4East Asian ideograph +9CD7East Asian ideograph +9CDDEast Asian ideograph +9CDEEast Asian ideograph +9CDCEast Asian ideograph +9CD6East Asian ideograph +9C88East Asian ideograph +9E1FEast Asian ideograph +9E20East Asian ideograph +9E22East Asian ideograph +9E23East Asian ideograph +51E4East Asian ideograph +9E29East Asian ideograph +9E26East Asian ideograph +9E35East Asian ideograph +9E2AEast Asian ideograph +9E2DEast Asian ideograph +9E2FEast Asian ideograph +9E33East Asian ideograph +9E3FEast Asian ideograph +9E3DEast Asian ideograph +9E49East Asian ideograph +9E43East Asian ideograph +9E44East Asian ideograph +9E45East Asian ideograph +9E51East Asian ideograph +9E4AEast Asian ideograph +9E4CEast Asian ideograph +9E4FEast Asian ideograph +9E64East Asian ideograph +83BAEast Asian ideograph +9E5EEast Asian ideograph +9E67East Asian ideograph +9E25East Asian ideograph +9E36East Asian ideograph +9E70East Asian ideograph +9E6DEast Asian ideograph +9E66East Asian ideograph +9E3EEast Asian ideograph +54B8East Asian ideograph +76D0East Asian ideograph +7877East Asian ideograph +4E3DEast Asian ideograph +9EA6East Asian ideograph +9EB8East Asian ideograph +9762East Asian ideograph +4E48East Asian ideograph +70B9East Asian ideograph +515AEast Asian ideograph +9EE9East Asian ideograph +51ACEast Asian ideograph +9F50East Asian ideograph +658EEast Asian ideograph +9F7FEast Asian ideograph +9F83East Asian ideograph +9F84East Asian ideograph +9F88East Asian ideograph +9F87East Asian ideograph +9F89East Asian ideograph +9F8AEast Asian ideograph +9F8CEast Asian ideograph +9F8BEast Asian ideograph +9F99East Asian ideograph +9F9AEast Asian ideograph +9F9FEast Asian ideograph +4F1CEast Asian ideograph +4F65East Asian ideograph +4F1BEast Asian ideograph +507BEast Asian ideograph +507EEast Asian ideograph +4FAAEast Asian ideograph +50A9East Asian ideograph +50A5East Asian ideograph +522DEast Asian ideograph +5250East Asian ideograph +672DEast Asian ideograph +523FEast Asian ideograph +523DEast Asian ideograph +5326East Asian ideograph +538DEast Asian ideograph +53A3East Asian ideograph +5459East Asian ideograph +5457East Asian ideograph +5522East Asian ideograph +551BEast Asian ideograph +54D4East Asian ideograph +54D3East Asian ideograph +E91BDuplicate simplified ideograph +5452East Asian ideograph +54D2East Asian ideograph +54D5East Asian ideograph +54D9East Asian ideograph +54DCEast Asian ideograph +556EEast Asian ideograph +5456East Asian ideograph +55BEEast Asian ideograph +5181East Asian ideograph +56F5East Asian ideograph +57ADEast Asian ideograph +57DAEast Asian ideograph +57D8East Asian ideograph +57D9East Asian ideograph +57B2East Asian ideograph +5785East Asian ideograph +5786East Asian ideograph +5956East Asian ideograph +5A05East Asian ideograph +5A32East Asian ideograph +59ABEast Asian ideograph +5A06East Asian ideograph +5AF1East Asian ideograph +5AD2East Asian ideograph +5A08East Asian ideograph +5C66East Asian ideograph +5C98East Asian ideograph +5D03East Asian ideograph +5D5DEast Asian ideograph +5D02East Asian ideograph +5CE4East Asian ideograph +5CC4East Asian ideograph +5D58East Asian ideograph +5CBFEast Asian ideograph +5DEFEast Asian ideograph +5E0FEast Asian ideograph +5E3BEast Asian ideograph +5E31East Asian ideograph +5E91East Asian ideograph +5F2AEast Asian ideograph +607DEast Asian ideograph +607AEast Asian ideograph +6004East Asian ideograph +60ADEast Asian ideograph +60ABEast Asian ideograph +6126East Asian ideograph +6003East Asian ideograph +603FEast Asian ideograph +6079East Asian ideograph +603CEast Asian ideograph +6206East Asian ideograph +620BEast Asian ideograph +6217East Asian ideograph +629FEast Asian ideograph +62A0East Asian ideograph +63BAEast Asian ideograph +63BCEast Asian ideograph +63B8East Asian ideograph +6322East Asian ideograph +63FFEast Asian ideograph +6448East Asian ideograph +64B7East Asian ideograph +6445East Asian ideograph +6484East Asian ideograph +64BAEast Asian ideograph +6512East Asian ideograph +6593East Asian ideograph +6619East Asian ideograph +6654East Asian ideograph +4E2BEast Asian ideograph +E91CDuplicate simplified ideograph +67A7East Asian ideograph +67A8East Asian ideograph +6966East Asian ideograph +6769East Asian ideograph +6864East Asian ideograph +6920East Asian ideograph +67FDEast Asian ideograph +6861East Asian ideograph +6A2FEast Asian ideograph +68BCEast Asian ideograph +680EEast Asian ideograph +6A7CEast Asian ideograph +6987East Asian ideograph +680AEast Asian ideograph +69E0East Asian ideograph +67A5East Asian ideograph +680CEast Asian ideograph +68C2East Asian ideograph +6989East Asian ideograph +6924East Asian ideograph +6B9AEast Asian ideograph +6BF5East Asian ideograph +6BE1East Asian ideograph +6C07East Asian ideograph +6C29East Asian ideograph +6D43East Asian ideograph +6D9EEast Asian ideograph +6D48East Asian ideograph +8365East Asian ideograph +6D52East Asian ideograph +6CA4East Asian ideograph +988DEast Asian ideograph +6D9DEast Asian ideograph +6D54East Asian ideograph +6DA0East Asian ideograph +6CA9East Asian ideograph +6ED7East Asian ideograph +6E11East Asian ideograph +6CF6East Asian ideograph +6F4BEast Asian ideograph +6D4DEast Asian ideograph +6F4DEast Asian ideograph +6EE2East Asian ideograph +6CF7East Asian ideograph +6CF8East Asian ideograph +6CA3East Asian ideograph +6EE0East Asian ideograph +6F13East Asian ideograph +704FEast Asian ideograph +6EDFEast Asian ideograph +70C3East Asian ideograph +709CEast Asian ideograph +8367East Asian ideograph +709DEast Asian ideograph +70E8East Asian ideograph +70ECEast Asian ideograph +72B8East Asian ideograph +72F2East Asian ideograph +7303East Asian ideograph +7315East Asian ideograph +73AEEast Asian ideograph +740FEast Asian ideograph +748EEast Asian ideograph +74D2East Asian ideograph +7572East Asian ideograph +75D6East Asian ideograph +7617East Asian ideograph +7618East Asian ideograph +7605East Asian ideograph +762AEast Asian ideograph +75ACEast Asian ideograph +763FEast Asian ideograph +75C8East Asian ideograph +7726East Asian ideograph +770DEast Asian ideograph +7751East Asian ideograph +7817East Asian ideograph +7856East Asian ideograph +7800East Asian ideograph +789BEast Asian ideograph +789CEast Asian ideograph +7857East Asian ideograph +783BEast Asian ideograph +7AADEast Asian ideograph +7B15East Asian ideograph +7BA7East Asian ideograph +7BA6East Asian ideograph +7B5AEast Asian ideograph +7BA8East Asian ideograph +7B3EEast Asian ideograph +7C16East Asian ideograph +7CC1East Asian ideograph +E91DDuplicate simplified ideograph +7C9DEast Asian ideograph +7C74East Asian ideograph +7EA1East Asian ideograph +7EA8East Asian ideograph +7EBEEast Asian ideograph +7EC0East Asian ideograph +7EC1East Asian ideograph +7EC2East Asian ideograph +7ED0East Asian ideograph +7EDBEast Asian ideograph +7ED7East Asian ideograph +7EE8East Asian ideograph +7EE0East Asian ideograph +7EE1East Asian ideograph +7EFBEast Asian ideograph +7EEFEast Asian ideograph +7EF2East Asian ideograph +7EF6East Asian ideograph +7EFAEast Asian ideograph +7F17East Asian ideograph +7F02East Asian ideograph +7F03East Asian ideograph +7F07East Asian ideograph +7F08East Asian ideograph +7F0CEast Asian ideograph +7F11East Asian ideograph +7F0FEast Asian ideograph +7F1FEast Asian ideograph +7F12East Asian ideograph +7F1CEast Asian ideograph +7F19East Asian ideograph +7F1BEast Asian ideograph +7EC9East Asian ideograph +E91EDuplicate simplified ideograph +7F21East Asian ideograph +7D77East Asian ideograph +7F25East Asian ideograph +7F26East Asian ideograph +7F2FEast Asian ideograph +7F30East Asian ideograph +7F32East Asian ideograph +7F33East Asian ideograph +7F34East Asian ideograph +7F31East Asian ideograph +7EA9East Asian ideograph +7F2CEast Asian ideograph +624DEast Asian ideograph +7F35East Asian ideograph +7F42East Asian ideograph +E91FDuplicate simplified ideograph +7F74East Asian ideograph +7F9FEast Asian ideograph +8027East Asian ideograph +8069East Asian ideograph +804DEast Asian ideograph +80EBEast Asian ideograph +80E8East Asian ideograph +8136East Asian ideograph +8114East Asian ideograph +82CCEast Asian ideograph +836DEast Asian ideograph +836EEast Asian ideograph +83B3East Asian ideograph +E920Duplicate simplified ideograph +83BCEast Asian ideograph +835CEast Asian ideograph +848CEast Asian ideograph +8311East Asian ideograph +82C1East Asian ideograph +8368East Asian ideograph +835BEast Asian ideograph +8487East Asian ideograph +8489East Asian ideograph +836CEast Asian ideograph +835EEast Asian ideograph +83B8East Asian ideograph +8297East Asian ideograph +84E3East Asian ideograph +84DFEast Asian ideograph +835FEast Asian ideograph +83B6East Asian ideograph +8360East Asian ideograph +8369East Asian ideograph +830FEast Asian ideograph +82C8East Asian ideograph +8572East Asian ideograph +8539East Asian ideograph +84E0East Asian ideograph +86F1East Asian ideograph +86ACEast Asian ideograph +86F3East Asian ideograph +86F0East Asian ideograph +866EEast Asian ideograph +86CFEast Asian ideograph +867FEast Asian ideograph +86F4East Asian ideograph +877EEast Asian ideograph +8511East Asian ideograph +88E2East Asian ideograph +88E5East Asian ideograph +88E3East Asian ideograph +7962East Asian ideograph +89C7East Asian ideograph +89CBEast Asian ideograph +89CFEast Asian ideograph +89D1East Asian ideograph +89CCEast Asian ideograph +89EFEast Asian ideograph +8BB5East Asian ideograph +8BCEEast Asian ideograph +8BD2East Asian ideograph +8BD6East Asian ideograph +8BD3East Asian ideograph +8BE9East Asian ideograph +8BD4East Asian ideograph +8BDCEast Asian ideograph +8BEEEast Asian ideograph +8C07East Asian ideograph +8BF9East Asian ideograph +8BFCEast Asian ideograph +8BE4East Asian ideograph +8BFDEast Asian ideograph +8C00East Asian ideograph +8C02East Asian ideograph +8C19East Asian ideograph +8BE8East Asian ideograph +8C0CEast Asian ideograph +8C14East Asian ideograph +8C11East Asian ideograph +8C16East Asian ideograph +8C1DEast Asian ideograph +8C21East Asian ideograph +8BCCEast Asian ideograph +8C27East Asian ideograph +8BB4East Asian ideograph +8C29East Asian ideograph +8C2EEast Asian ideograph +8C2FEast Asian ideograph +8C35East Asian ideograph +8C30East Asian ideograph +8C20East Asian ideograph +8C33East Asian ideograph +8D33East Asian ideograph +8D36East Asian ideograph +8D47East Asian ideograph +8D53East Asian ideograph +8D55East Asian ideograph +8D49East Asian ideograph +8D59East Asian ideograph +8D3DEast Asian ideograph +8D5CEast Asian ideograph +8D46East Asian ideograph +8DB1East Asian ideograph +8DC4East Asian ideograph +8DF8East Asian ideograph +8E70East Asian ideograph +8DFBEast Asian ideograph +8DF9East Asian ideograph +8DDEEast Asian ideograph +8E2CEast Asian ideograph +8E7FEast Asian ideograph +8E9CEast Asian ideograph +8F71East Asian ideograph +8F7AEast Asian ideograph +8F75East Asian ideograph +8F77East Asian ideograph +8F78East Asian ideograph +8F82East Asian ideograph +8F81East Asian ideograph +8F8BEast Asian ideograph +8F8AEast Asian ideograph +8F8FEast Asian ideograph +8F98East Asian ideograph +8F79East Asian ideograph +8F73East Asian ideograph +8FF8East Asian ideograph +90CFEast Asian ideograph +90D3East Asian ideograph +90E7East Asian ideograph +90ACEast Asian ideograph +90F8East Asian ideograph +90BAEast Asian ideograph +90D0East Asian ideograph +909DEast Asian ideograph +90E6East Asian ideograph +917EEast Asian ideograph +917DEast Asian ideograph +9487East Asian ideograph +9486East Asian ideograph +948CEast Asian ideograph +948BEast Asian ideograph +948DEast Asian ideograph +948EEast Asian ideograph +9492East Asian ideograph +9495East Asian ideograph +9490East Asian ideograph +94ADEast Asian ideograph +94AAEast Asian ideograph +94ABEast Asian ideograph +94ACEast Asian ideograph +94AFEast Asian ideograph +949BEast Asian ideograph +94A3East Asian ideograph +94C8East Asian ideograph +94C9East Asian ideograph +94CBEast Asian ideograph +94CAEast Asian ideograph +94B0East Asian ideograph +94CCEast Asian ideograph +94B6East Asian ideograph +94B7East Asian ideograph +94B2East Asian ideograph +94BAEast Asian ideograph +94CDEast Asian ideograph +94BDEast Asian ideograph +94BFEast Asian ideograph +94C6East Asian ideograph +94F3East Asian ideograph +94F1East Asian ideograph +94F5East Asian ideograph +94D6East Asian ideograph +94D2East Asian ideograph +94D1East Asian ideograph +94D5East Asian ideograph +94DEEast Asian ideograph +94DFEast Asian ideograph +94EBEast Asian ideograph +94EFEast Asian ideograph +94E5East Asian ideograph +94E3East Asian ideograph +94EAEast Asian ideograph +94F7East Asian ideograph +9512East Asian ideograph +950DEast Asian ideograph +94FDEast Asian ideograph +9513East Asian ideograph +9514East Asian ideograph +94D8East Asian ideograph +94D7East Asian ideograph +9503East Asian ideograph +94A1East Asian ideograph +9502East Asian ideograph +950AEast Asian ideograph +94E4East Asian ideograph +9506East Asian ideograph +9507East Asian ideograph +952BEast Asian ideograph +9529East Asian ideograph +952CEast Asian ideograph +9516East Asian ideograph +9515East Asian ideograph +94FCEast Asian ideograph +951BEast Asian ideograph +951DEast Asian ideograph +951EEast Asian ideograph +951FEast Asian ideograph +9494East Asian ideograph +9522East Asian ideograph +9528East Asian ideograph +9531East Asian ideograph +9534East Asian ideograph +9545East Asian ideograph +9517East Asian ideograph +94E1East Asian ideograph +9536East Asian ideograph +9537East Asian ideograph +9518East Asian ideograph +9538East Asian ideograph +9550East Asian ideograph +9553East Asian ideograph +9552East Asian ideograph +84E5East Asian ideograph +9549East Asian ideograph +94E0East Asian ideograph +954FEast Asian ideograph +953CEast Asian ideograph +955BEast Asian ideograph +955FEast Asian ideograph +956AEast Asian ideograph +933EEast Asian ideograph +9546East Asian ideograph +94E9East Asian ideograph +94F4East Asian ideograph +9566East Asian ideograph +9568East Asian ideograph +94F9East Asian ideograph +956BEast Asian ideograph +950EEast Asian ideograph +950FEast Asian ideograph +9561East Asian ideograph +9562East Asian ideograph +9563East Asian ideograph +94E7East Asian ideograph +9564East Asian ideograph +9571East Asian ideograph +9554East Asian ideograph +9572East Asian ideograph +956CEast Asian ideograph +9565East Asian ideograph +9567East Asian ideograph +9569East Asian ideograph +954AEast Asian ideograph +95F3East Asian ideograph +9606East Asian ideograph +9603East Asian ideograph +960FEast Asian ideograph +9608East Asian ideograph +9609East Asian ideograph +960AEast Asian ideograph +960CEast Asian ideograph +960DEast Asian ideograph +9612East Asian ideograph +9619East Asian ideograph +961AEast Asian ideograph +95FCEast Asian ideograph +9655East Asian ideograph +9649East Asian ideograph +9753East Asian ideograph +97AFEast Asian ideograph +97EAEast Asian ideograph +97EBEast Asian ideograph +9878East Asian ideograph +9883East Asian ideograph +9880East Asian ideograph +988FEast Asian ideograph +98A1East Asian ideograph +989FEast Asian ideograph +98A2East Asian ideograph +98A5East Asian ideograph +989EEast Asian ideograph +98A7East Asian ideograph +98D9East Asian ideograph +996BEast Asian ideograph +997DEast Asian ideograph +9967East Asian ideograph +9969East Asian ideograph +9990East Asian ideograph +9991East Asian ideograph +998DEast Asian ideograph +9994East Asian ideograph +9993East Asian ideograph +98E8East Asian ideograph +9A75East Asian ideograph +9A80East Asian ideograph +9A90East Asian ideograph +9A92East Asian ideograph +9A93East Asian ideograph +9A9FEast Asian ideograph +9A98East Asian ideograph +9A7AEast Asian ideograph +9A9DEast Asian ideograph +9A9CEast Asian ideograph +9A96East Asian ideograph +9AA2East Asian ideograph +9AA3East Asian ideograph +9A81East Asian ideograph +9A85East Asian ideograph +9AA7East Asian ideograph +9ACBEast Asian ideograph +960BEast Asian ideograph +9604East Asian ideograph +9B49East Asian ideograph +9C82East Asian ideograph +9C86East Asian ideograph +9C87East Asian ideograph +9C90East Asian ideograph +9C8BEast Asian ideograph +9C9EEast Asian ideograph +9C91East Asian ideograph +9C92East Asian ideograph +9C95East Asian ideograph +9CA9East Asian ideograph +9CA0East Asian ideograph +9CA7East Asian ideograph +9CADEast Asian ideograph +9CB0East Asian ideograph +9CAEEast Asian ideograph +9CBAEast Asian ideograph +9CB2East Asian ideograph +9CB4East Asian ideograph +9CB1East Asian ideograph +9CB7East Asian ideograph +9CB5East Asian ideograph +9CB6East Asian ideograph +9CBBEast Asian ideograph +9CCAEast Asian ideograph +9CBDEast Asian ideograph +9CC4East Asian ideograph +9CC6East Asian ideograph +9CC7East Asian ideograph +9CCBEast Asian ideograph +9CA5East Asian ideograph +9CCEEast Asian ideograph +9CD9East Asian ideograph +9CCCEast Asian ideograph +9CD5East Asian ideograph +9CA3East Asian ideograph +9CD3East Asian ideograph +9CD8East Asian ideograph +9CDFEast Asian ideograph +9C85East Asian ideograph +9C9FEast Asian ideograph +9CBCEast Asian ideograph +9CE2East Asian ideograph +9C8EEast Asian ideograph +9C9AEast Asian ideograph +9CA1East Asian ideograph +9E28East Asian ideograph +9E32East Asian ideograph +9E31East Asian ideograph +9E38East Asian ideograph +9E39East Asian ideograph +9E3AEast Asian ideograph +9E48East Asian ideograph +9E41East Asian ideograph +9E46East Asian ideograph +9E2BEast Asian ideograph +9E4EEast Asian ideograph +9E5CEast Asian ideograph +9E5BEast Asian ideograph +9E55East Asian ideograph +9E57East Asian ideograph +9E4BEast Asian ideograph +9E63East Asian ideograph +9E5AEast Asian ideograph +9E58East Asian ideograph +9E37East Asian ideograph +9E68East Asian ideograph +9E47East Asian ideograph +9E6BEast Asian ideograph +9E6CEast Asian ideograph +9E69East Asian ideograph +9E6AEast Asian ideograph +9E71East Asian ideograph +9E2CEast Asian ideograph +9E73East Asian ideograph +9E42East Asian ideograph +5364East Asian ideograph +9E7EEast Asian ideograph +9EEAEast Asian ideograph +9EFEEast Asian ideograph +9F0BEast Asian ideograph +9F0DEast Asian ideograph +9F51East Asian ideograph +9F80East Asian ideograph +9F86East Asian ideograph +9F85East Asian ideograph +9F9BEast Asian ideograph +5F0CEast Asian ideograph +4E17East Asian ideograph +7ADDEast Asian ideograph +4E57East Asian ideograph +5F0DEast Asian ideograph +4E3CEast Asian ideograph +4E9CEast Asian ideograph +4EBEEast Asian ideograph +4EB0East Asian ideograph +8B8EEast Asian ideograph +4ECFEast Asian ideograph +62BBEast Asian ideograph +4F32East Asian ideograph +5002East Asian ideograph +5008East Asian ideograph +4FA3East Asian ideograph +7AE2East Asian ideograph +EA04East Asian ideography not found in unified han +5E78East Asian ideograph +7B87East Asian ideograph +510CEast Asian ideograph +50E3East Asian ideograph +E97650BBVariant of 4B325F which maps to 50BB +5039East Asian ideograph +4FADEast Asian ideograph +706EEast Asian ideograph +514EEast Asian ideograph +634CEast Asian ideograph +4E0CEast Asian ideograph +5190East Asian ideograph +5202East Asian ideograph +E9F4East Asian ideograph not in Unicode +52B5East Asian ideograph +5234East Asian ideograph +5C05East Asian ideograph +5265East Asian ideograph +8CF8East Asian ideograph +5294East Asian ideograph +5226East Asian ideograph +8274East Asian ideograph +52F3East Asian ideograph +52A2East Asian ideograph +52E7East Asian ideograph +758BEast Asian ideograph +62FEEast Asian ideograph +4EDFEast Asian ideograph +6607East Asian ideograph +5349East Asian ideograph +613DEast Asian ideograph +5918East Asian ideograph +5373East Asian ideograph +5374East Asian ideograph +52FEEast Asian ideograph +6B62East Asian ideograph +4EDDEast Asian ideograph +55ABEast Asian ideograph +7343East Asian ideograph +5434East Asian ideograph +8A36East Asian ideograph +546AEast Asian ideograph +8AEEEast Asian ideograph +95A7East Asian ideograph +8A7BEast Asian ideograph +6B38East Asian ideograph +5557East Asian ideograph +6199East Asian ideograph +751EEast Asian ideograph +8B5FEast Asian ideograph +5650East Asian ideograph +54BDEast Asian ideograph +8086East Asian ideograph +56ECEast Asian ideograph +5700East Asian ideograph +962CEast Asian ideograph +962FEast Asian ideograph +573BEast Asian ideograph +575AEast Asian ideograph +5872East Asian ideograph +51A2East Asian ideograph +5896East Asian ideograph +58CAEast Asian ideograph +58F7East Asian ideograph +5900East Asian ideograph +591FEast Asian ideograph +6B80East Asian ideograph +7287East Asian ideograph +67F0East Asian ideograph +7AD2East Asian ideograph +511EEast Asian ideograph +59ACEast Asian ideograph +7385East Asian ideograph +59D9East Asian ideograph +4F84East Asian ideograph +5A63East Asian ideograph +5B43East Asian ideograph +5A31East Asian ideograph +5A3FEast Asian ideograph +58FBEast Asian ideograph +5AFAEast Asian ideograph +5ACBEast Asian ideograph +6588East Asian ideograph +51A8East Asian ideograph +5EBDEast Asian ideograph +8A67East Asian ideograph +5C02East Asian ideograph +E9775C06Variant of 273B40 which maps to 5C06 +6EBAEast Asian ideograph +5C4AEast Asian ideograph +5D17East Asian ideograph +5CE9East Asian ideograph +5CEFEast Asian ideograph +5D8BEast Asian ideograph +5D08East Asian ideograph +57FCEast Asian ideograph +5D10East Asian ideograph +5D18East Asian ideograph +5DE3East Asian ideograph +9245East Asian ideograph +83F7East Asian ideograph +6A66East Asian ideograph +5E47East Asian ideograph +79CAEast Asian ideograph +51FCEast Asian ideograph +E921Duplicate simplified ideograph +7240East Asian ideograph +576BEast Asian ideograph +83F4East Asian ideograph +53A2East Asian ideograph +53A0East Asian ideograph +53AEEast Asian ideograph +5EBFEast Asian ideograph +5396East Asian ideograph +539BEast Asian ideograph +5EFEEast Asian ideograph +5F4AEast Asian ideograph +7BF2East Asian ideograph +5F5CEast Asian ideograph +9AF4East Asian ideograph +9015East Asian ideograph +5F93East Asian ideograph +60EAEast Asian ideograph +5FB4East Asian ideograph +6060East Asian ideograph +803BEast Asian ideograph +6052East Asian ideograph +6075East Asian ideograph +661AEast Asian ideograph +6120East Asian ideograph +5ABFEast Asian ideograph +6159East Asian ideograph +6185East Asian ideograph +61D0East Asian ideograph +621EEast Asian ideograph +6226East Asian ideograph +622FEast Asian ideograph +78A5East Asian ideograph +5214East Asian ideograph +64A6East Asian ideograph +67C6East Asian ideograph +6255East Asian ideograph +67B4East Asian ideograph +6283East Asian ideograph +6294East Asian ideograph +63CEEast Asian ideograph +62CFEast Asian ideograph +6485East Asian ideograph +642FEast Asian ideograph +63B2East Asian ideograph +6271East Asian ideograph +6428East Asian ideograph +6447East Asian ideograph +64E3East Asian ideograph +635CEast Asian ideograph +6534East Asian ideograph +62CAEast Asian ideograph +6483East Asian ideograph +5117East Asian ideograph +53D9East Asian ideograph +555FEast Asian ideograph +65E3East Asian ideograph +65EEEast Asian ideograph +6630East Asian ideograph +668EEast Asian ideograph +66ECEast Asian ideograph +6662East Asian ideograph +667BEast Asian ideograph +6636East Asian ideograph +6681East Asian ideograph +66A6East Asian ideograph +6716East Asian ideograph +6722East Asian ideograph +671EEast Asian ideograph +6736East Asian ideograph +686EEast Asian ideograph +6780East Asian ideograph +67FEEast Asian ideograph +6942East Asian ideograph +6822East Asian ideograph +69C5East Asian ideograph +6852East Asian ideograph +8308East Asian ideograph +6746East Asian ideograph +6973East Asian ideograph +6936East Asian ideograph +68CAEast Asian ideograph +E978690DVariant of 214474 which maps to 690D +684CEast Asian ideograph +6406East Asian ideograph +6760East Asian ideograph +6901East Asian ideograph +697DEast Asian ideograph +58ABEast Asian ideograph +681DEast Asian ideograph +68B9East Asian ideograph +6AC9East Asian ideograph +5FFBEast Asian ideograph +61FDEast Asian ideograph +6B7AEast Asian ideograph +6BD8East Asian ideograph +51B3East Asian ideograph +51B2East Asian ideograph +6CB2East Asian ideograph +6D29East Asian ideograph +51B5East Asian ideograph +6C4EEast Asian ideograph +6FFCEast Asian ideograph +6C79East Asian ideograph +6F94East Asian ideograph +51C9East Asian ideograph +51C4East Asian ideograph +E9796D45Variant of 274768 which maps to 6D45 +51CFEast Asian ideograph +6E07East Asian ideograph +6FD5East Asian ideograph +6E29East Asian ideograph +6EDAEast Asian ideograph +7001East Asian ideograph +6F44East Asian ideograph +6F82East Asian ideograph +E9F5East Asian ideograph not in Unicode +6F5CEast Asian ideograph +702CEast Asian ideograph +7AC8East Asian ideograph +70F1East Asian ideograph +70B0East Asian ideograph +70DFEast Asian ideograph +70A4East Asian ideograph +713CEast Asian ideograph +8B8CEast Asian ideograph +718FEast Asian ideograph +4E89East Asian ideograph +5C12East Asian ideograph +58BBEast Asian ideograph +7F9DEast Asian ideograph +7282East Asian ideograph +6C02East Asian ideograph +736AEast Asian ideograph +73C9East Asian ideograph +73CEEast Asian ideograph +746FEast Asian ideograph +6BECEast Asian ideograph +78AFEast Asian ideograph +7F3EEast Asian ideograph +7506East Asian ideograph +583AEast Asian ideograph +756EEast Asian ideograph +7567East Asian ideograph +53E0East Asian ideograph +758EEast Asian ideograph +7661East Asian ideograph +4F70East Asian ideograph +7681East Asian ideograph +76C7East Asian ideograph +76D7East Asian ideograph +771FEast Asian ideograph +7741East Asian ideograph +53E1East Asian ideograph +7792East Asian ideograph +7719East Asian ideograph +6998East Asian ideograph +78AAEast Asian ideograph +945BEast Asian ideograph +5FA1East Asian ideograph +9F9DEast Asian ideograph +7980East Asian ideograph +7A3EEast Asian ideograph +4E69East Asian ideograph +9834East Asian ideograph +7A42East Asian ideograph +7AB0East Asian ideograph +7AF8East Asian ideograph +7B5EEast Asian ideograph +693EEast Asian ideograph +7B5DEast Asian ideograph +84D1East Asian ideograph +7C58East Asian ideograph +7CFAEast Asian ideograph +5E0BEast Asian ideograph +7D25East Asian ideograph +6DD6East Asian ideograph +7D2CEast Asian ideograph +7DB3East Asian ideograph +7E62East Asian ideograph +7D99East Asian ideograph +9262East Asian ideograph +9475East Asian ideograph +8FA0East Asian ideograph +7F78East Asian ideograph +898AEast Asian ideograph +7FA1East Asian ideograph +7FA3East Asian ideograph +7FC4East Asian ideograph +98DCEast Asian ideograph +6537East Asian ideograph +79D0East Asian ideograph +79CFEast Asian ideograph +7085East Asian ideograph +8EADEast Asian ideograph +8074East Asian ideograph +7C9BEast Asian ideograph +5B8DEast Asian ideograph +6BD3East Asian ideograph +812CEast Asian ideograph +8107East Asian ideograph +80F7East Asian ideograph +8193East Asian ideograph +811AEast Asian ideograph +81C8East Asian ideograph +9AD7East Asian ideograph +5367East Asian ideograph +64E7East Asian ideograph +6841East Asian ideograph +8229East Asian ideograph +824AEast Asian ideograph +8306East Asian ideograph +6959East Asian ideograph +83C0East Asian ideograph +8318East Asian ideograph +E97A830EVariant of 275529 which maps to 830E +8358East Asian ideograph +E97B8393Variant of 21552E which maps to 8393 +837DEast Asian ideograph +585FEast Asian ideograph +855AEast Asian ideograph +8386East Asian ideograph +8385East Asian ideograph +76D6East Asian ideograph +83D4East Asian ideograph +8024East Asian ideograph +846FEast Asian ideograph +8613East Asian ideograph +6A97East Asian ideograph +9F04East Asian ideograph +9F05East Asian ideograph +8717East Asian ideograph +8797East Asian ideograph +8748East Asian ideograph +87C7East Asian ideograph +60F7East Asian ideograph +885EEast Asian ideograph +890EEast Asian ideograph +886EEast Asian ideograph +5E2CEast Asian ideograph +88E1East Asian ideograph +7D5DEast Asian ideograph +89A7East Asian ideograph +752AEast Asian ideograph +89E6East Asian ideograph +548FEast Asian ideograph +612CEast Asian ideograph +8ACCEast Asian ideograph +8B01East Asian ideograph +8AE9East Asian ideograph +5629East Asian ideograph +8B72East Asian ideograph +8B83East Asian ideograph +7AEAEast Asian ideograph +8277East Asian ideograph +732AEast Asian ideograph +72B2East Asian ideograph +8C98East Asian ideograph +72F8East Asian ideograph +8CADEast Asian ideograph +8CDBEast Asian ideograph +8D71East Asian ideograph +8D82East Asian ideograph +8E5FEast Asian ideograph +8DE5East Asian ideograph +8E7BEast Asian ideograph +8EB1East Asian ideograph +8F19East Asian ideograph +8EFDEast Asian ideograph +8FA2East Asian ideograph +8FA7East Asian ideograph +5EF5East Asian ideograph +8FEFEast Asian ideograph +8FE8East Asian ideograph +5FA7East Asian ideograph +5FA8East Asian ideograph +9013East Asian ideograph +8FE9East Asian ideograph +9089East Asian ideograph +96A3East Asian ideograph +9167East Asian ideograph +9196East Asian ideograph +920EEast Asian ideograph +8216East Asian ideograph +8021East Asian ideograph +9418East Asian ideograph +7145East Asian ideograph +7194East Asian ideograph +93C1East Asian ideograph +92B9East Asian ideograph +92F3East Asian ideograph +945AEast Asian ideograph +9587East Asian ideograph +6FF6East Asian ideograph +9665East Asian ideograph +5826East Asian ideograph +964FEast Asian ideograph +661CEast Asian ideograph +78D2East Asian ideograph +96A0East Asian ideograph +9CEBEast Asian ideograph +96BDEast Asian ideograph +96D1East Asian ideograph +9DC4East Asian ideograph +873AEast Asian ideograph +E9D2975AUnrelated variant of EACC 234C76 which maps to 975A +978CEast Asian ideograph +976DEast Asian ideograph +97EEEast Asian ideograph +980BEast Asian ideograph +9920East Asian ideograph +8218East Asian ideograph +99EEEast Asian ideograph +99DEEast Asian ideograph +99C8East Asian ideograph +9AC4East Asian ideograph +8EC6East Asian ideograph +9A0CEast Asian ideograph +6B1DEast Asian ideograph +9C0CEast Asian ideograph +9C53East Asian ideograph +9F08East Asian ideograph +9D76East Asian ideograph +9D5EEast Asian ideograph +5869East Asian ideograph +78B1East Asian ideograph +83FBEast Asian ideograph +5E85East Asian ideograph +9EC4East Asian ideograph +76B7East Asian ideograph +658BEast Asian ideograph +5C28East Asian ideograph +4E80East Asian ideograph +E9F6East Asian ideograph not in Unicode +5273East Asian ideograph +8123East Asian ideograph +55E2East Asian ideograph +E97C55D4Variant of 217164 which maps to 55D4 +56D3East Asian ideograph +9654East Asian ideograph +579BEast Asian ideograph +598DEast Asian ideograph +51A4East Asian ideograph +5D1FEast Asian ideograph +5ECFEast Asian ideograph +5F51East Asian ideograph +605AEast Asian ideograph +609BEast Asian ideograph +6128East Asian ideograph +6738East Asian ideograph +634DEast Asian ideograph +640BEast Asian ideograph +6332East Asian ideograph +651FEast Asian ideograph +5261East Asian ideograph +6528East Asian ideograph +630EEast Asian ideograph +52C5East Asian ideograph +69E3East Asian ideograph +657FEast Asian ideograph +65B5East Asian ideograph +714AEast Asian ideograph +66CDEast Asian ideograph +661DEast Asian ideograph +80ADEast Asian ideograph +690FEast Asian ideograph +684AEast Asian ideograph +7A1CEast Asian ideograph +7BA0East Asian ideograph +69B2East Asian ideograph +6AC1East Asian ideograph +6AA9East Asian ideograph +6CD0East Asian ideograph +6C73East Asian ideograph +E97D6C67Variant of 224739 which maps to 6C67 +6D64East Asian ideograph +6FA3East Asian ideograph +6CD9East Asian ideograph +6E7CEast Asian ideograph +6EA6East Asian ideograph +6DE5East Asian ideograph +6E86East Asian ideograph +6D38East Asian ideograph +7032East Asian ideograph +9800East Asian ideograph +6DE0East Asian ideograph +6F74East Asian ideograph +70B1East Asian ideograph +715BEast Asian ideograph +71FEEast Asian ideograph +73B3East Asian ideograph +74A2East Asian ideograph +75B8East Asian ideograph +7690East Asian ideograph +76A1East Asian ideograph +772DEast Asian ideograph +77C1East Asian ideograph +8020East Asian ideograph +7A19East Asian ideograph +7B04East Asian ideograph +7BE0East Asian ideograph +7B2EEast Asian ideograph +7B59East Asian ideograph +7BE6East Asian ideograph +6CD4East Asian ideograph +9908East Asian ideograph +7D4FEast Asian ideograph +7E27East Asian ideograph +7D63East Asian ideograph +5FADEast Asian ideograph +7D56East Asian ideograph +7E89East Asian ideograph +7516East Asian ideograph +7F48East Asian ideograph +7F82East Asian ideograph +7F58East Asian ideograph +8037East Asian ideograph +831CEast Asian ideograph +83F0East Asian ideograph +6A22East Asian ideograph +8507East Asian ideograph +E9D3868BUnrelated variant of EACC 23293D which maps to 868B +87B5East Asian ideograph +87CAEast Asian ideograph +88B5East Asian ideograph +7E48East Asian ideograph +89BBEast Asian ideograph +E9D489F5Unrelated variant of EACC 23315E which maps to 89F5 +8A7EEast Asian ideograph +8B1AEast Asian ideograph +8C7CEast Asian ideograph +8D91East Asian ideograph +8DD7East Asian ideograph +8E6EEast Asian ideograph +E9F7East Asian ideograph not in Unicode +8F3CEast Asian ideograph +900EEast Asian ideograph +914FEast Asian ideograph +E9D58019Unrelated variant of EACC 215266 which maps to 8019 +941AEast Asian ideograph +90B4East Asian ideograph +5F8FEast Asian ideograph +7CC7East Asian ideograph +9AE1East Asian ideograph +9ABEEast Asian ideograph +E9D69C51Unrelated variant of EACC 235945 which maps to 9C51 +9C1BEast Asian ideograph +9CECEast Asian ideograph +9D44East Asian ideograph +6EF7East Asian ideograph +9EA4East Asian ideograph +730AEast Asian ideograph +9EC9East Asian ideograph +9B12East Asian ideograph +6641East Asian ideograph +86A1East Asian ideograph +58F9East Asian ideograph +8FFAEast Asian ideograph +4E79East Asian ideograph +8CB3East Asian ideograph +4EAFEast Asian ideograph +5FC8East Asian ideograph +8B90East Asian ideograph +5F77East Asian ideograph +5FA0East Asian ideograph +4FFBEast Asian ideograph +5FBAEast Asian ideograph +4FA1East Asian ideograph +5150East Asian ideograph +4E21East Asian ideograph +4E93East Asian ideograph +518AEast Asian ideograph +6C37East Asian ideograph +51DBEast Asian ideograph +51FEEast Asian ideograph +5270East Asian ideograph +52E6East Asian ideograph +91FCEast Asian ideograph +5264East Asian ideograph +523CEast Asian ideograph +9628East Asian ideograph +53C1East Asian ideograph +53DCEast Asian ideograph +608BEast Asian ideograph +9A03East Asian ideograph +5449East Asian ideograph +5415East Asian ideograph +8656East Asian ideograph +9F69East Asian ideograph +9B28East Asian ideograph +8A92East Asian ideograph +5405East Asian ideograph +8FF4East Asian ideograph +576FEast Asian ideograph +9029East Asian ideograph +5B2DEast Asian ideograph +59C9East Asian ideograph +7895East Asian ideograph +8CECEast Asian ideograph +53A8East Asian ideograph +5E83East Asian ideograph +5E81East Asian ideograph +7D43East Asian ideograph +5F3AEast Asian ideograph +7030East Asian ideograph +4EFDEast Asian ideograph +5FB3East Asian ideograph +7652East Asian ideograph +E97E6168Variant of 213F22 which maps to 6168 +7718East Asian ideograph +51F4East Asian ideograph +5B3EEast Asian ideograph +61F4East Asian ideograph +6133East Asian ideograph +629BEast Asian ideograph +62D5East Asian ideograph +6425East Asian ideograph +629EEast Asian ideograph +62E1East Asian ideograph +53CEEast Asian ideograph +52B9East Asian ideograph +6559East Asian ideograph +6B5BEast Asian ideograph +89D4East Asian ideograph +65EFEast Asian ideograph +664BEast Asian ideograph +95C7East Asian ideograph +7156East Asian ideograph +6702East Asian ideograph +5932East Asian ideograph +76C3East Asian ideograph +6144East Asian ideograph +6918East Asian ideograph +7F47East Asian ideograph +826AEast Asian ideograph +8B99East Asian ideograph +E97F6B8BVariant of 274633 which maps to 6B8B +6BBBEast Asian ideograph +6C61East Asian ideograph +76C5East Asian ideograph +6CA1East Asian ideograph +6E2BEast Asian ideograph +6E5FEast Asian ideograph +6D1AEast Asian ideograph +6D1FEast Asian ideograph +6FECEast Asian ideograph +6FB9East Asian ideograph +60BDEast Asian ideograph +6D44East Asian ideograph +5A6CEast Asian ideograph +904AEast Asian ideograph +6CDDEast Asian ideograph +67D2East Asian ideograph +6F81East Asian ideograph +70D6East Asian ideograph +7133East Asian ideograph +934AEast Asian ideograph +91BCEast Asian ideograph +89DDEast Asian ideograph +754DEast Asian ideograph +E980753BVariant of 274C36 which maps to 753B +8E6FEast Asian ideograph +8E08East Asian ideograph +767AEast Asian ideograph +784EEast Asian ideograph +79A5East Asian ideograph +5EE9East Asian ideograph +7A49East Asian ideograph +7A93East Asian ideograph +7A91East Asian ideograph +54B2East Asian ideograph +9257East Asian ideograph +724BEast Asian ideograph +7A45East Asian ideograph +7E8DEast Asian ideograph +7D4CEast Asian ideograph +7EEEEast Asian ideograph +7DD1East Asian ideograph +7DABEast Asian ideograph +7DD0East Asian ideograph +6374East Asian ideograph +7D89East Asian ideograph +7E8EEast Asian ideograph +94B5East Asian ideograph +E9817F6EVariant of 215230 which maps to 7F6E +99E1East Asian ideograph +8989East Asian ideograph +8B71East Asian ideograph +7E59East Asian ideograph +71FFEast Asian ideograph +8061East Asian ideograph +80BBEast Asian ideograph +81D9East Asian ideograph +9AD5East Asian ideograph +67C1East Asian ideograph +8221East Asian ideograph +6CD6East Asian ideograph +8462East Asian ideograph +8406East Asian ideograph +8602East Asian ideograph +85ACEast Asian ideograph +87C1East Asian ideograph +8671East Asian ideograph +880EEast Asian ideograph +880FEast Asian ideograph +88E0East Asian ideograph +8943East Asian ideograph +88B4East Asian ideograph +97C8East Asian ideograph +658DEast Asian ideograph +89E7East Asian ideograph +54D7East Asian ideograph +8C4AEast Asian ideograph +8E28East Asian ideograph +5EF8East Asian ideograph +8A76East Asian ideograph +57DCEast Asian ideograph +9221East Asian ideograph +5257East Asian ideograph +9244East Asian ideograph +9452East Asian ideograph +90C4East Asian ideograph +96B7East Asian ideograph +9D08East Asian ideograph +9D70East Asian ideograph +9759East Asian ideograph +985BEast Asian ideograph +9855East Asian ideograph +98C3East Asian ideograph +8EB0East Asian ideograph +9A23East Asian ideograph +9C7BEast Asian ideograph +9EAAEast Asian ideograph +8534East Asian ideograph +76BCEast Asian ideograph +6589East Asian ideograph +6B6FEast Asian ideograph +7ADCEast Asian ideograph +524FEast Asian ideograph +6031East Asian ideograph +9F67East Asian ideograph +5CBDEast Asian ideograph +5FDEEast Asian ideograph +572CEast Asian ideograph +7BDAEast Asian ideograph +8022East Asian ideograph +8264East Asian ideograph +6D34East Asian ideograph +7162East Asian ideograph +7118East Asian ideograph +756DEast Asian ideograph +80ACEast Asian ideograph +75FEEast Asian ideograph +6900East Asian ideograph +589DEast Asian ideograph +7C7CEast Asian ideograph +7E1AEast Asian ideograph +58DCEast Asian ideograph +90C5East Asian ideograph +83C7East Asian ideograph +8B5BEast Asian ideograph +8B2DEast Asian ideograph +91BEEast Asian ideograph +98C8East Asian ideograph +9C76East Asian ideograph +8C8EEast Asian ideograph +82BEEast Asian ideograph +534BEast Asian ideograph +5EFCEast Asian ideograph +4E81East Asian ideograph +65BCEast Asian ideograph +4F0DEast Asian ideograph +9AE3East Asian ideograph +4F1DEast Asian ideograph +5227East Asian ideograph +61C3East Asian ideograph +965EEast Asian ideograph +604AEast Asian ideograph +5611East Asian ideograph +9FA2East Asian ideograph +8AE0East Asian ideograph +559EEast Asian ideograph +56F2East Asian ideograph +59B3East Asian ideograph +5BF3East Asian ideograph +5C97East Asian ideograph +E922Duplicate simplified ideograph +8D26East Asian ideograph +8907East Asian ideograph +8CC9East Asian ideograph +6142East Asian ideograph +60AAEast Asian ideograph +7609East Asian ideograph +6443East Asian ideograph +646DEast Asian ideograph +62E0East Asian ideograph +4FF2East Asian ideograph +5554East Asian ideograph +6644East Asian ideograph +8988East Asian ideograph +6AC2East Asian ideograph +826BEast Asian ideograph +E9826B96Variant of 214634 which maps to 6B96 +6C3EEast Asian ideograph +51C0East Asian ideograph +9061East Asian ideograph +6D5CEast Asian ideograph +6B12East Asian ideograph +792EEast Asian ideograph +9AE6East Asian ideograph +7546East Asian ideograph +7BEDEast Asian ideograph +9B3BEast Asian ideograph +9939East Asian ideograph +7D75East Asian ideograph +5BD8East Asian ideograph +66DCEast Asian ideograph +7094East Asian ideograph +85A6East Asian ideograph +5D0BEast Asian ideograph +6726East Asian ideograph +83DDEast Asian ideograph +854BEast Asian ideograph +56CCEast Asian ideograph +4E55East Asian ideograph +87A1East Asian ideograph +7DAFEast Asian ideograph +97E4East Asian ideograph +69FBEast Asian ideograph +8A3CEast Asian ideograph +58F2East Asian ideograph +983CEast Asian ideograph +91BBEast Asian ideograph +5277East Asian ideograph +9295East Asian ideograph +9274East Asian ideograph +7A7DEast Asian ideograph +5742East Asian ideograph +5F6BEast Asian ideograph +8987East Asian ideograph +55B0East Asian ideograph +9B2AEast Asian ideograph +5C20East Asian ideograph +E9839BFDVariant of 216223 which maps to 9BFD +521FEast Asian ideograph +E9F8East Asian ideograph not in Unicode +60A4East Asian ideograph +E98453A9Variant of 4C284C which maps to 53A9 +64C0East Asian ideograph +67B1East Asian ideograph +6855East Asian ideograph +7BEAEast Asian ideograph +80FCEast Asian ideograph +81D5East Asian ideograph +8842East Asian ideograph +8DB5East Asian ideograph +5E79East Asian ideograph +5023East Asian ideograph +84E1East Asian ideograph +8B3CEast Asian ideograph +8986East Asian ideograph +5379East Asian ideograph +614EEast Asian ideograph +638AEast Asian ideograph +E985542FVariant of 27424F which maps to 542F +7881East Asian ideograph +8263East Asian ideograph +9A69East Asian ideograph +4E97East Asian ideograph +5E30East Asian ideograph +51C8East Asian ideograph +6E08East Asian ideograph +7832East Asian ideograph +9DF0East Asian ideograph +7266East Asian ideograph +7582East Asian ideograph +6403East Asian ideograph +61DEEast Asian ideograph +517FEast Asian ideograph +8276East Asian ideograph +9586East Asian ideograph +E9F9East Asian ideograph not in Unicode +6B9EEast Asian ideograph +7431East Asian ideograph +99C5East Asian ideograph +5C1FEast Asian ideograph +69A6East Asian ideograph +8D30East Asian ideograph +5B82East Asian ideograph +5271East Asian ideograph +5AD0East Asian ideograph +56AEEast Asian ideograph +5EFBEast Asian ideograph +5F66East Asian ideograph +52E0East Asian ideograph +63DBEast Asian ideograph +6A10East Asian ideograph +7688East Asian ideograph +6C2FEast Asian ideograph +6CFAEast Asian ideograph +6E15East Asian ideograph +7523East Asian ideograph +7589East Asian ideograph +E986788CVariant of 214E43 which maps to 788C +7984East Asian ideograph +9896East Asian ideograph +7D0DEast Asian ideograph +53BFEast Asian ideograph +E987865EVariant of 21564B which maps to 865E +672FEast Asian ideograph +8BA0East Asian ideograph +E9888A25Variant of 215847 which maps to 8A25 +9485East Asian ideograph +953AEast Asian ideograph +97FFEast Asian ideograph +984FEast Asian ideograph +9963East Asian ideograph +98F0East Asian ideograph +9980East Asian ideograph +5E7AEast Asian ideograph +9F61East Asian ideograph +5ED0East Asian ideograph +76B2East Asian ideograph +E9898801Variant of 232C4D which maps to 8801 +8C2AEast Asian ideograph +8C2BEast Asian ideograph +8B9EEast Asian ideograph +8D4DEast Asian ideograph +949AEast Asian ideograph +94BCEast Asian ideograph +95F6East Asian ideograph +E98A97DEVariant of 234E5C which maps to 97DE +9957East Asian ideograph +E98B9BD6Variant of 23577A which maps to 9BD6 +9C3AEast Asian ideograph +58F1East Asian ideograph +4E8AEast Asian ideograph +5F10East Asian ideograph +6275East Asian ideograph +4E99East Asian ideograph +96E0East Asian ideograph +E98C4EE4Variant of 21306E which maps to 4EE4 +4EEDEast Asian ideograph +4F2BEast Asian ideograph +4FABEast Asian ideograph +E98D4F36Variant of 213144 which maps to 4F36 +5F95East Asian ideograph +723CEast Asian ideograph +E98E5029Variant of 213178 which maps to 5029 +5024East Asian ideograph +4EEEEast Asian ideograph +E9FAEast Asian ideograph not in Unicode +E98F50E7Variant of 21324E which maps to 50E7 +50BBEast Asian ideograph +5185East Asian ideograph +E9905168Variant of 213322 which maps to 5168 +E991634CVariant of 2D3324 which maps to 634C +F92EEast Asian ideograph +5204East Asian ideograph +82C5East Asian ideograph +520BEast Asian ideograph +522BEast Asian ideograph +5263East Asian ideograph +52B4East Asian ideograph +52F2East Asian ideograph +5DF5East Asian ideograph +E992537FVariant of 213474 which maps to 537F +55ECEast Asian ideograph +54CCEast Asian ideograph +8C18East Asian ideograph +8BF6East Asian ideograph +5A1AEast Asian ideograph +5358East Asian ideograph +5606East Asian ideograph +5C1CEast Asian ideograph +E9935668Variant of 213749 which maps to 5668 +5662East Asian ideograph +E99456A5Variant of 213758 which maps to 56A5 +53B3East Asian ideograph +56D8East Asian ideograph +56FDEast Asian ideograph +5186East Asian ideograph +56E3East Asian ideograph +56F3East Asian ideograph +57C0East Asian ideograph +E995586BVariant of 213850 which maps to 586B +E9FBEast Asian ideograph not in Unicode +5897East Asian ideograph +58C7East Asian ideograph +5727East Asian ideograph +5841East Asian ideograph +58CCEast Asian ideograph +57BBEast Asian ideograph +591BEast Asian ideograph +5942East Asian ideograph +5F09East Asian ideograph +5965East Asian ideograph +5333East Asian ideograph +5B22East Asian ideograph +5A2FEast Asian ideograph +805FEast Asian ideograph +88CAEast Asian ideograph +5B37East Asian ideograph +51A6East Asian ideograph +5B9FEast Asian ideograph +51A9East Asian ideograph +5BFEEast Asian ideograph +8132East Asian ideograph +5C64East Asian ideograph +6B67East Asian ideograph +5D8CEast Asian ideograph +5D15East Asian ideograph +5D5CEast Asian ideograph +5CE5East Asian ideograph +5DBAEast Asian ideograph +5DD3East Asian ideograph +5DCCEast Asian ideograph +949CEast Asian ideograph +5E2FEast Asian ideograph +5E64East Asian ideograph +53A6East Asian ideograph +5EC3East Asian ideograph +5EE3East Asian ideograph +53B0East Asian ideograph +5EF0East Asian ideograph +5F3EEast Asian ideograph +E9965F25Variant of 273D4C which maps to 5F25 +5F83East Asian ideograph +E9975F84Variant of 273D67 which maps to 5F84 +6035East Asian ideograph +6046East Asian ideograph +60C5East Asian ideograph +60A9East Asian ideograph +E998618EVariant of 213F40 which maps to 618E +5FDCEast Asian ideograph +E999601CVariant of 273F4B which maps to 601C +E99A61CAVariant of 213F50 which maps to 61CA +61D1East Asian ideograph +61F2East Asian ideograph +623BEast Asian ideograph +62DDEast Asian ideograph +629CEast Asian ideograph +62D0East Asian ideograph +627AEast Asian ideograph +62F4East Asian ideograph +6323East Asian ideograph +6368East Asian ideograph +6362East Asian ideograph +633FEast Asian ideograph +6442East Asian ideograph +643AEast Asian ideograph +64B9East Asian ideograph +6674East Asian ideograph +66A8East Asian ideograph +663FEast Asian ideograph +66F5East Asian ideograph +66FDEast Asian ideograph +67A9East Asian ideograph +6813East Asian ideograph +685FEast Asian ideograph +E99B6994Variant of 214534 which maps to 6994 +6804East Asian ideograph +69D8East Asian ideograph +6982East Asian ideograph +6955East Asian ideograph +6A2AEast Asian ideograph +9792East Asian ideograph +691CEast Asian ideograph +6A71East Asian ideograph +E99C6ADBVariant of 21456C which maps to 6ADB +823BEast Asian ideograph +685CEast Asian ideograph +6A29East Asian ideograph +6B53East Asian ideograph +6B74East Asian ideograph +6B81East Asian ideograph +6BB1East Asian ideograph +6C17East Asian ideograph +6C32East Asian ideograph +6C89East Asian ideograph +51BDEast Asian ideograph +6D99East Asian ideograph +6E05East Asian ideograph +E99D6DB5Variant of 214767 which maps to 6DB5 +51C5East Asian ideograph +6DA3East Asian ideograph +78C6East Asian ideograph +6E13East Asian ideograph +51D6East Asian ideograph +6F91East Asian ideograph +6F22East Asian ideograph +6E80East Asian ideograph +E99E6EDEVariant of 27485F which maps to 6EDE +6E89East Asian ideograph +6FF3East Asian ideograph +6CA2East Asian ideograph +E99F6FB3Variant of 214925 which maps to 6FB3 +6FEBEast Asian ideograph +6E0BEast Asian ideograph +6E16East Asian ideograph +56A0East Asian ideograph +6F45East Asian ideograph +7AC3East Asian ideograph +932CEast Asian ideograph +83F8East Asian ideograph +7115East Asian ideograph +6427East Asian ideograph +7188East Asian ideograph +55B6East Asian ideograph +71D7East Asian ideograph +7235East Asian ideograph +5C13East Asian ideograph +72A0East Asian ideograph +E9A0731CVariant of 214A74 which maps to 731C +72F0East Asian ideograph +7363East Asian ideograph +731FEast Asian ideograph +F9ADEast Asian ideograph +749CEast Asian ideograph +E9A17F3EVariant of 2D4B71 which maps to 7F3E +4EC0East Asian ideograph +7575East Asian ideograph +7573East Asian ideograph +75CAEast Asian ideograph +75F3East Asian ideograph +E9A2761FVariant of 214C67 which maps to 761F +7672East Asian ideograph +862FEast Asian ideograph +E9A376F4Variant of 214D45 which maps to 76F4 +8846East Asian ideograph +E9A4775BVariant of 214D59 which maps to 775B +66B8East Asian ideograph +E9A577D7Variant of 214D7B which maps to 77D7 +7B36East Asian ideograph +7814East Asian ideograph +5CFAEast Asian ideograph +78FAEast Asian ideograph +783FEast Asian ideograph +79D8East Asian ideograph +E9A67985Variant of 274E7B which maps to 7985 +7A50East Asian ideograph +E9A779F0Variant of 274F3C which maps to 79F0 +7A32East Asian ideograph +7A4FEast Asian ideograph +7B7AEast Asian ideograph +7C14East Asian ideograph +7C12East Asian ideograph +E9A87C27Variant of 215044 which maps to 7C27 +7C56East Asian ideograph +7CBEEast Asian ideograph +7CABEast Asian ideograph +7CF8East Asian ideograph +7DF4East Asian ideograph +7E01East Asian ideograph +770CEast Asian ideograph +7EF7East Asian ideograph +7DCFEast Asian ideograph +7E26East Asian ideograph +7E04East Asian ideograph +7F0BEast Asian ideograph +7E92East Asian ideograph +7D9AEast Asian ideograph +7E4AEast Asian ideograph +6B20East Asian ideograph +7F36East Asian ideograph +7F87East Asian ideograph +E9A97F9AVariant of 21523E which maps to 7F9A +7FAEEast Asian ideograph +7FCEEast Asian ideograph +7FFAEast Asian ideograph +E9AA66DCVariant of 39525B which maps to 66DC +8002East Asian ideograph +E9AB8046Variant of 21526E which maps to 8046 +8068East Asian ideograph +8080East Asian ideograph +695CEast Asian ideograph +E923Duplicate simplified ideograph +8133East Asian ideograph +9ACCEast Asian ideograph +81D3East Asian ideograph +E9AC81EDVariant of 215428 which maps to 81ED +6319East Asian ideograph +820EEast Asian ideograph +E9AD82D3Variant of 21546D which maps to 82D3 +8332East Asian ideograph +8392East Asian ideograph +E9AE83C1Variant of 21553A which maps to 83C1 +E9AF83BDVariant of 21553F which maps to 83BD +8420East Asian ideograph +77C7East Asian ideograph +85CDEast Asian ideograph +8535East Asian ideograph +82B8East Asian ideograph +7C54East Asian ideograph +E9B082A6Variant of 27563A which maps to 82A6 +6A98East Asian ideograph +51E6East Asian ideograph +E9B18708Variant of 21566A which maps to 8708 +E9B2873BVariant of 215671 which maps to 873B +86CDEast Asian ideograph +877FEast Asian ideograph +8827East Asian ideograph +8853East Asian ideograph +523EEast Asian ideograph +E9B38910Variant of 21576F which maps to 8910 +7ED4East Asian ideograph +7E7FEast Asian ideograph +897EEast Asian ideograph +E9B48983Variant of 215826 which maps to 8983 +899AEast Asian ideograph +89B3East Asian ideograph +4F89East Asian ideograph +8AA4East Asian ideograph +8ACBEast Asian ideograph +8B20East Asian ideograph +8A33East Asian ideograph +8AADEast Asian ideograph +5909East Asian ideograph +8273East Asian ideograph +734FEast Asian ideograph +72E2East Asian ideograph +8D2EEast Asian ideograph +621DEast Asian ideograph +8CCEEast Asian ideograph +8D08East Asian ideograph +E9B58DF5Variant of 275A68 which maps to 8DF5 +5C69East Asian ideograph +8E8DEast Asian ideograph +8F0CEast Asian ideograph +8F42East Asian ideograph +8EE2East Asian ideograph +8EE3East Asian ideograph +5F01East Asian ideograph +9038East Asian ideograph +9039East Asian ideograph +9059East Asian ideograph +9045East Asian ideograph +E924Duplicate simplified ideograph +8FBAEast Asian ideograph +961DEast Asian ideograph +E9B69119Variant of 215C72 which maps to 9119 +9139East Asian ideograph +9162East Asian ideograph +91B8East Asian ideograph +91C6East Asian ideograph +91C8East Asian ideograph +91E1East Asian ideograph +9234East Asian ideograph +8217East Asian ideograph +92ADEast Asian ideograph +93ADEast Asian ideograph +9421East Asian ideograph +922CEast Asian ideograph +95D4East Asian ideograph +95A2East Asian ideograph +E925Duplicate simplified ideograph +E9B79686Variant of 215F30 which maps to 9686 +6B92East Asian ideograph +967AEast Asian ideograph +51CBEast Asian ideograph +9D8FEast Asian ideograph +96E3East Asian ideograph +F9B2East Asian ideograph +7668East Asian ideograph +970AEast Asian ideograph +9752East Asian ideograph +9756East Asian ideograph +975BEast Asian ideograph +E9B8975CVariant of 215F73 which maps to 975C +9771East Asian ideograph +9818East Asian ideograph +981AEast Asian ideograph +985EEast Asian ideograph +991DEast Asian ideograph +994BEast Asian ideograph +99C4East Asian ideograph +9A08East Asian ideograph +9A12East Asian ideograph +99C6East Asian ideograph +9A13East Asian ideograph +81B8East Asian ideograph +9AEAEast Asian ideograph +95D8East Asian ideograph +9599East Asian ideograph +9D12East Asian ideograph +9D2CEast Asian ideograph +9D49East Asian ideograph +68BAEast Asian ideograph +E9B99EB8Variant of 27625C which maps to 9EB8 +9EBDEast Asian ideograph +9ED2East Asian ideograph +9ED9East Asian ideograph +9F21East Asian ideograph +9F62East Asian ideograph +4EB6East Asian ideography +4FE3East Asian ideograph +4EC2East Asian ideograph +7F83East Asian ideograph +6C8DEast Asian ideograph +F9A9East Asian ideograph +57D3East Asian ideograph +E9BA57F4Variant of 21763D which maps to 57F4 +590AEast Asian ideograph +5968East Asian ideograph +E9BB5BC3Variant of 217E6A which maps to 5BC3 +5C53East Asian ideograph +5C76East Asian ideograph +5D5BEast Asian ideograph +5D73East Asian ideograph +53A9East Asian ideograph +5EDBEast Asian ideograph +E9BC5F4DVariant of 222962 which maps to 5F4D +622CEast Asian ideograph +631DEast Asian ideograph +64B8East Asian ideograph +65D9East Asian ideograph +E9BD80ADVariant of 2E3A33 which maps to 80AD +6741East Asian ideograph +6859East Asian ideograph +6860East Asian ideograph +6798East Asian ideograph +6764East Asian ideograph +69C7East Asian ideograph +6922East Asian ideograph +8538East Asian ideograph +8223East Asian ideograph +6AAAEast Asian ideograph +69DEEast Asian ideograph +6A65East Asian ideograph +67A6East Asian ideograph +6B05East Asian ideograph +6B4EEast Asian ideograph +6CADEast Asian ideograph +6E0CEast Asian ideograph +6F62East Asian ideograph +6F99East Asian ideograph +6F46East Asian ideograph +6EDDEast Asian ideograph +701EEast Asian ideograph +8315East Asian ideograph +717AEast Asian ideograph +E9BE71E0Variant of 225447 which maps to 71E0 +4E2CEast Asian ideograph +729FEast Asian ideograph +73F1East Asian ideograph +E9BF74F4Variant of 225C61 which maps to 74F4 +7640East Asian ideograph +75EBEast Asian ideograph +7596East Asian ideograph +76B9East Asian ideograph +778BEast Asian ideograph +7839East Asian ideograph +78D9East Asian ideograph +78B9East Asian ideograph +E9D77962Unrelated variant of EACC 293032 which maps to 7962 +79EBEast Asian ideograph +7A06East Asian ideograph +7A63East Asian ideograph +E9C07B4CVariant of 226B62 which maps to 7B4C +7B9FEast Asian ideograph +7C31East Asian ideograph +7CCDEast Asian ideograph +7CE8East Asian ideograph +7EE6East Asian ideograph +7A39East Asian ideograph +7DFCEast Asian ideograph +E9C15FADVariant of 2E7328 which maps to 5FAD +7D4BEast Asian ideograph +80B7East Asian ideograph +817DEast Asian ideograph +815FEast Asian ideograph +82AEEast Asian ideograph +8343East Asian ideograph +8323East Asian ideograph +83B5East Asian ideograph +8770East Asian ideograph +E9C286C9Variant of 232962 which maps to 86C9 +87E5East Asian ideograph +E9C38872Variant of 232D75 which maps to 8872 +E9C48941Variant of 232F5D which maps to 8941 +7E5DEast Asian ideograph +891DEast Asian ideograph +88AEEast Asian ideograph +56AFEast Asian ideograph +8C25East Asian ideograph +544BEast Asian ideograph +8FB6East Asian ideograph +919BEast Asian ideograph +91DBEast Asian ideograph +E9C59306Variant of 23445B which maps to 9306 +954EEast Asian ideograph +952AEast Asian ideograph +9544East Asian ideograph +943EEast Asian ideograph +953FEast Asian ideograph +954CEast Asian ideograph +9229East Asian ideograph +9667East Asian ideograph +7EF1East Asian ideograph +988CEast Asian ideograph +98D1East Asian ideograph +98DAEast Asian ideograph +9942East Asian ideograph +9B2EEast Asian ideograph +9BE3East Asian ideograph +9CD0East Asian ideograph +9CA6East Asian ideograph +9BF5East Asian ideograph +51EBEast Asian ideograph +9D46East Asian ideograph +9DABEast Asian ideograph +9DC6East Asian ideograph +9D50East Asian ideograph +9E81East Asian ideograph +9F44East Asian ideograph +97F2East Asian ideograph +816DEast Asian ideograph +8CAEEast Asian ideograph +4E98East Asian ideograph +91D6East Asian ideograph +8BC3East Asian ideograph +51C3East Asian ideograph +8885East Asian ideograph +6C3DEast Asian ideograph +8FF3East Asian ideograph +822EEast Asian ideograph +852BEast Asian ideograph +9271East Asian ideograph +7E9FEast Asian ideograph +8616East Asian ideograph +9616East Asian ideograph +9988East Asian ideograph +51B4East Asian ideograph +734EEast Asian ideograph +E9C67E8AVariant of 22735D which maps to 7E8A +30FBIdeographic centered point +3005Ideographic iteration mark +30FCVowel elongation mark for kana +3008Ideographic less than sign +3009Ideographic greater than sign +300AIdeographic left double angle bracket +300BIdeographic right double angle bracket +3041Hiragana letter small A +3042Hiragana letter A +3043Hiragana letter small I +3044Hiragana letter I +3045Hiragana letter small U +3046Hiragana letter U +3047Hiragana letter small E +3048Hiragana letter E +3049Hiragana letter small O +304AHiragana letter O +304BHiragana letter KA +304CHiragana letter GA +304DHiragana letter KI +304EHiragana letter GI +304FHiragana letter KU +3050Hiragana letter GU +3051Hiragana letter KE +3052Hiragana letter GE +3053Hiragana letter KO +3054Hiragana letter GO +3055Hiragana letter SA +3056Hiragana letter ZA +3057Hiragana letter SI +3058Hiragana letter ZI +3059Hiragana letter SU +305AHiragana letter ZU +305BHiragana letter SE +305CHiragana letter ZE +305DHiragana letter SO +305EHiragana letter ZO +305FHiragana letter TA +3060Hiragana letter DA +3061Hiragana letter TI +3062Hiragana letter DI +3063Hiragana letter small TU +3064Hiragana letter TU +3065Hiragana letter DU +3066Hiragana letter TE +3067Hiragana letter DE +3068Hiragana letter TO +3069Hiragana letter DO +306AHiragana letter NA +306BHiragana letter NI +306CHiragana letter NU +306DHiragana letter NE +306EHiragana letter NO +306FHiragana letter HA +3070Hiragana letter BA +3071Hiragana letter PA +3072Hiragana letter HI +3073Hiragana letter BI +3074Hiragana letter PI +3075Hiragana letter HU +3076Hiragana letter BU +3077Hiragana letter PU +3078Hiragana letter HE +3079Hiragana letter BE +307AHiragana letter PE +307BHiragana letter HO +307CHiragana letter BO +307DHiragana letter PO +307EHiragana letter MA +307FHiragana letter MI +3080Hiragana letter MU +3081Hiragana letter ME +3082Hiragana letter MO +3083Hiragana letter small YA +3084Hiragana letter YA +3085Hiragana letter small YU +3086Hiragana letter YU +3087Hiragana letter small YO +3088Hiragana letter YO +3089Hiragana letter RA +308AHiragana letter RI +308BHiragana letter RU +308CHiragana letter RE +308DHiragana letter RO +308EHiragana letter small WA +308FHiragana letter WA +3090Hiragana letter WI +3091Hiragana letter WE +3092Hiragana letter WO +3093Hiragana letter N +30A1Katakana letter small A +30A2Katakana letter A +30A3Katakana letter small I +30A4Katakana letter I +30A5Katakana letter small U +30A6Katakana letter U +30A7Katakana letter small E +30A8Katakana letter E +30A9Katakana letter small O +30AAKatakana letter O +30ABKatakana letter KA +30ACKatakana letter GA +30ADKatakana letter KI +30AEKatakana letter GI +30AFKatakana letter KU +30B0Katakana letter GU +30B1Katakana letter KE +30B2Katakana letter GE +30B3Katakana letter KO +30B4Katakana letter GO +30B5Katakana letter SA +30B6Katakana letter ZA +30B7Katakana letter SI +30B8Katakana letter ZI +30B9Katakana letter SU +30BAKatakana letter ZU +30BBKatakana letter SE +30BCKatakana letter ZE +30BDKatakana letter SO +30BFKatakana letter TA +30C0Katakana letter DA +30C1Katakana letter TI +30C2Katakana letter DI +30C3Katakana letter small TU +30C4Katakana letter TU +30C5Katakana letter DU +30C6Katakana letter TE +30C7Katakana letter DE +30C8Katakana letter TO +30C9Katakana letter DO +30CAKatakana letter NA +30CBKatakana letter NI +30CCKatakana letter NU +30CDKatakana letter NE +30CEKatakana letter NO +30CFKatakana letter HA +30D0Katakana letter BA +30D1Katakana letter PA +30D2Katakana letter HI +30D3Katakana letter BI +30D4Katakana letter PI +30D5Katakana letter HU +30D6Katakana letter BU +30D7Katakana letter PU +30D8Katakana letter HE +30D9Katakana letter BE +30DAKatakana letter PE +30DBKatakana letter HO +30DCKatakana letter BO +30DDKatakana letter PO +30DEKatakana letter MA +30DFKatakana letter MI +30E0Katakana letter MU +30E1Katakana letter ME +30E2Katakana letter MO +30E3Katakana letter small YA +30E4Katakana letter YA +30E5Katakana letter small YU +30E6Katakana letter YU +30E7Katakana letter small YO +30E8Katakana letter YO +30E9Katakana letter RA +30EAKatakana letter RI +30EBKatakana letter RU +30ECKatakana letter RE +30EDKatakana letter RO +30EEKatakana letter small WA +30EFKatakana letter WA +30F0Katakana letter WI +30F1Katakana letter WE +30F2Katakana letter WO +30F3Katakana letter N +30F4Katakana letter VU +30F5Katakana letter small KA +30F6Katakana letter small KE +309BKatakana-hiragana voiced sound mark +309CKatakana-hiragana semi-voiced sound mark +7C82East Asian ideograph +9D2BEast Asian ideograph +96EBEast Asian ideograph +51EAEast Asian ideograph +5302East Asian ideograph +7872East Asian ideograph +7560East Asian ideograph +567AEast Asian ideograph +9EBFEast Asian ideograph +6762East Asian ideograph +5301East Asian ideograph +9453East Asian ideograph +5116East Asian ideograph +51E9East Asian ideograph +53FAEast Asian ideograph +54D8East Asian ideograph +555DEast Asian ideograph +56CEEast Asian ideograph +5726East Asian ideograph +5737East Asian ideograph +57B3East Asian ideograph +57AAEast Asian ideograph +57B0East Asian ideograph +57D6East Asian ideograph +5870East Asian ideograph +58B9East Asian ideograph +58B8East Asian ideograph +58D7East Asian ideograph +58E5East Asian ideograph +5B36East Asian ideograph +4E62East Asian ideograph +599BEast Asian ideograph +5CBBEast Asian ideograph +5CBCEast Asian ideograph +5CC5East Asian ideograph +5CBEEast Asian ideograph +5D76East Asian ideograph +5D90East Asian ideograph +5F16East Asian ideograph +5F41East Asian ideograph +603AEast Asian ideograph +6327East Asian ideograph +63B5East Asian ideograph +64F6East Asian ideograph +6683East Asian ideograph +66BCEast Asian ideograph +6737East Asian ideograph +6926East Asian ideograph +6925East Asian ideograph +6928East Asian ideograph +6923East Asian ideograph +6921East Asian ideograph +697EEast Asian ideograph +6981East Asian ideograph +69DDEast Asian ideograph +6A2EEast Asian ideograph +6A78East Asian ideograph +6B1FEast Asian ideograph +6E82East Asian ideograph +7195East Asian ideograph +74F2East Asian ideograph +753CEast Asian ideograph +7549East Asian ideograph +7569East Asian ideograph +7874East Asian ideograph +78B5East Asian ideograph +7907East Asian ideograph +7A43East Asian ideograph +7B02East Asian ideograph +7C13East Asian ideograph +7C17East Asian ideograph +7BF6East Asian ideograph +7C90East Asian ideograph +7CADEast Asian ideograph +7CC0East Asian ideograph +7CD8East Asian ideograph +7E05East Asian ideograph +7E83East Asian ideograph +7DD5East Asian ideograph +7E90East Asian ideograph +81A4East Asian ideograph +825DEast Asian ideograph +8422East Asian ideograph +84D9East Asian ideograph +8630East Asian ideograph +86ABEast Asian ideograph +86EFEast Asian ideograph +87D0East Asian ideograph +88B0East Asian ideograph +88C3East Asian ideograph +8904East Asian ideograph +8977East Asian ideograph +8ADAEast Asian ideograph +8EBEEast Asian ideograph +8EC5East Asian ideograph +8EC8East Asian ideograph +8F4CEast Asian ideograph +9027East Asian ideograph +9056East Asian ideograph +91DFEast Asian ideograph +933BEast Asian ideograph +958AEast Asian ideograph +9596East Asian ideograph +9666East Asian ideograph +9779East Asian ideograph +9786East Asian ideograph +9790East Asian ideograph +98AAEast Asian ideograph +99F2East Asian ideograph +9ADEEast Asian ideograph +9AF1East Asian ideograph +9AF7East Asian ideograph +9B96East Asian ideograph +9BB4East Asian ideograph +9BCFEast Asian ideograph +9BD1East Asian ideograph +9BF2East Asian ideograph +9C30East Asian ideograph +9C5AEast Asian ideograph +9D48East Asian ideograph +9D64East Asian ideograph +3131Korean hangul +3134Korean hangul +3137Korean hangul +3139Korean hangul +3141Korean hangul +3142Korean hangul +3145Korean hangul +3147Korean hangul +3148Korean hangul +314AKorean hangul +314BKorean hangul +314CKorean hangul +314DKorean hangul +314EKorean hangul +3132Korean hangul +3138Korean hangul +3143Korean hangul +3146Korean hangul +3149Korean hangul +314FKorean hangul +3150Korean hangul +3151Korean hangul +3153Korean hangul +3154Korean hangul +3155Korean hangul +3157Korean hangul +3158Korean hangul +315BKorean hangul +315CKorean hangul +3160Korean hangul +3161Korean hangul +3162Korean hangul +3163Korean hangul +AC00Korean hangul +AC01Korean hangul +AC02Korean hangul +AC04Korean hangul +AC07Korean hangul +AC08Korean hangul +AC09Korean hangul +AC10Korean hangul +AC11Korean hangul +AC12Korean hangul +AC13Korean hangul +AC14Korean hangul +AC15Korean hangul +AC16Korean hangul +AC17Korean hangul +AC19Korean hangul +AC1AKorean hangul +AC1BKorean hangul +AC1CKorean hangul +AC1DKorean hangul +AC20Korean hangul +AC24Korean hangul +AC2CKorean hangul +AC2DKorean hangul +AC2FKorean hangul +AC30Korean hangul +AC31Korean hangul +AC38Korean hangul +AC39Korean hangul +AC40Korean hangul +AC54Korean hangul +AC70Korean hangul +AC71Korean hangul +AC74Korean hangul +AC77Korean hangul +AC78Korean hangul +AC79Korean hangul +AC80Korean hangul +AC81Korean hangul +AC83Korean hangul +AC84Korean hangul +AC85Korean hangul +AC86Korean hangul +AC89Korean hangul +AC8AKorean hangul +AC8BKorean hangul +AC8CKorean hangul +AC90Korean hangul +AC94Korean hangul +AC9CKorean hangul +AC9FKorean hangul +ACA0Korean hangul +ACA1Korean hangul +ACA8Korean hangul +ACA9Korean hangul +ACAAKorean hangul +ACACKorean hangul +ACAFKorean hangul +ACB0Korean hangul +ACB8Korean hangul +ACB9Korean hangul +ACBCKorean hangul +ACBDKorean hangul +ACC1Korean hangul +ACC4Korean hangul +ACD7Korean hangul +ACE0Korean hangul +ACE1Korean hangul +ACE4Korean hangul +ACE7Korean hangul +ACE8Korean hangul +ACEAKorean hangul +ACECKorean hangul +ACEFKorean hangul +ACF0Korean hangul +ACF1Korean hangul +ACF3Korean hangul +ACF5Korean hangul +ACF6Korean hangul +ACFAKorean hangul +ACFCKorean hangul +ACFDKorean hangul +AD00Korean hangul +AD04Korean hangul +AD0CKorean hangul +AD0DKorean hangul +AD0FKorean hangul +AD11Korean hangul +AD18Korean hangul +AD19Korean hangul +AD1CKorean hangul +AD20Korean hangul +AD28Korean hangul +AD29Korean hangul +AD2DKorean hangul +AD34Korean hangul +AD38Korean hangul +AD3CKorean hangul +AD44Korean hangul +AD49Korean hangul +AD50Korean hangul +AD6CKorean hangul +AD6DKorean hangul +AD70Korean hangul +AD73Korean hangul +AD74Korean hangul +AD75Korean hangul +AD76Korean hangul +AD7CKorean hangul +AD7DKorean hangul +AD7FKorean hangul +AD81Korean hangul +AD82Korean hangul +AD88Korean hangul +AD8CKorean hangul +AD90Korean hangul +ADA4Korean hangul +ADC0Korean hangul +ADC4Korean hangul +ADC8Korean hangul +ADD0Korean hangul +ADD1Korean hangul +ADD3Korean hangul +ADDCKorean hangul +ADE0Korean hangul +ADE4Korean hangul +ADECKorean hangul +ADF8Korean hangul +ADF9Korean hangul +ADFCKorean hangul +ADFFKorean hangul +AE00Korean hangul +AE01Korean hangul +AE08Korean hangul +AE09Korean hangul +AE0BKorean hangul +AE0DKorean hangul +AE30Korean hangul +AE31Korean hangul +AE34Korean hangul +AE37Korean hangul +AE38Korean hangul +AE40Korean hangul +AE41Korean hangul +AE43Korean hangul +AE44Korean hangul +AE45Korean hangul +AE4AKorean hangul +AE4CKorean hangul +AE4DKorean hangul +AE4EKorean hangul +AE50Korean hangul +AE54Korean hangul +AE5CKorean hangul +AE5DKorean hangul +AE60Korean hangul +AE61Korean hangul +AE62Korean hangul +AE65Korean hangul +AE68Korean hangul +AE69Korean hangul +AE6CKorean hangul +AE70Korean hangul +AE78Korean hangul +AE79Korean hangul +AE7BKorean hangul +AE7CKorean hangul +AE7DKorean hangul +AE84Korean hangul +AE85Korean hangul +AEBCKorean hangul +AEBDKorean hangul +AEBEKorean hangul +AEC0Korean hangul +AEC4Korean hangul +AECCKorean hangul +AECDKorean hangul +AECFKorean hangul +AED0Korean hangul +AED1Korean hangul +AED8Korean hangul +AEDCKorean hangul +AEF4Korean hangul +AF0DKorean hangul +AF2CKorean hangul +AF2DKorean hangul +AF30Korean hangul +AF34Korean hangul +AF3CKorean hangul +AF3DKorean hangul +AF3FKorean hangul +AF41Korean hangul +AF42Korean hangul +AF43Korean hangul +AF48Korean hangul +AF49Korean hangul +AF4CKorean hangul +AF58Korean hangul +AF5CKorean hangul +AF5DKorean hangul +AF64Korean hangul +AF65Korean hangul +AF79Korean hangul +AF80Korean hangul +AF84Korean hangul +AF88Korean hangul +AF90Korean hangul +AF95Korean hangul +AF9CKorean hangul +AFB8Korean hangul +AFB9Korean hangul +AFBCKorean hangul +AFC0Korean hangul +AFC7Korean hangul +AFC8Korean hangul +AFC9Korean hangul +AFCBKorean hangul +AFCDKorean hangul +AFCEKorean hangul +AFD4Korean hangul +AFD8Korean hangul +AFE9Korean hangul +AFF0Korean hangul +B000Korean hangul +B00CKorean hangul +B00DKorean hangul +B010Korean hangul +B014Korean hangul +B01CKorean hangul +B01DKorean hangul +B028Korean hangul +B044Korean hangul +B045Korean hangul +B048Korean hangul +B04AKorean hangul +B04CKorean hangul +B053Korean hangul +B054Korean hangul +B055Korean hangul +B057Korean hangul +B059Korean hangul +B05DKorean hangul +B07CKorean hangul +B07DKorean hangul +B080Korean hangul +B084Korean hangul +B08CKorean hangul +B08DKorean hangul +B08FKorean hangul +B090Korean hangul +B091Korean hangul +B098Korean hangul +B099Korean hangul +B09AKorean hangul +B09CKorean hangul +B09FKorean hangul +B0A0Korean hangul +B0A1Korean hangul +B0A8Korean hangul +B0A9Korean hangul +B0ABKorean hangul +B0ACKorean hangul +B0ADKorean hangul +B0AEKorean hangul +B0AFKorean hangul +B0B1Korean hangul +B0B3Korean hangul +B0B4Korean hangul +B0B5Korean hangul +B0B8Korean hangul +B0BBKorean hangul +B0BCKorean hangul +B0C4Korean hangul +B0C5Korean hangul +B0C7Korean hangul +B0C8Korean hangul +B0C9Korean hangul +B0D0Korean hangul +B0D1Korean hangul +B0E0Korean hangul +B0E5Korean hangul +B0ECKorean hangul +B108Korean hangul +B109Korean hangul +B10BKorean hangul +B10CKorean hangul +B10FKorean hangul +B110Korean hangul +B113Korean hangul +B118Korean hangul +B119Korean hangul +B11BKorean hangul +B11CKorean hangul +B11DKorean hangul +B11EKorean hangul +B123Korean hangul +B124Korean hangul +B125Korean hangul +B128Korean hangul +B12CKorean hangul +B134Korean hangul +B135Korean hangul +B137Korean hangul +B140Korean hangul +B141Korean hangul +B144Korean hangul +B150Korean hangul +B151Korean hangul +B153Korean hangul +B154Korean hangul +B155Korean hangul +B158Korean hangul +B15CKorean hangul +B178Korean hangul +B179Korean hangul +B17AKorean hangul +B17CKorean hangul +B180Korean hangul +B188Korean hangul +B189Korean hangul +B18BKorean hangul +B18DKorean hangul +B192Korean hangul +B193Korean hangul +B194Korean hangul +B1A8Korean hangul +B1CCKorean hangul +B1D0Korean hangul +B1D4Korean hangul +B1DCKorean hangul +B1E8Korean hangul +B1FDKorean hangul +B204Korean hangul +B205Korean hangul +B208Korean hangul +B20BKorean hangul +B20CKorean hangul +B213Korean hangul +B214Korean hangul +B215Korean hangul +B217Korean hangul +B220Korean hangul +B233Korean hangul +B234Korean hangul +B258Korean hangul +B25CKorean hangul +B260Korean hangul +B268Korean hangul +B269Korean hangul +B274Korean hangul +B284Korean hangul +B289Korean hangul +B290Korean hangul +B291Korean hangul +B294Korean hangul +B298Korean hangul +B299Korean hangul +B2A0Korean hangul +B2A1Korean hangul +B2A5Korean hangul +B2A6Korean hangul +B2AAKorean hangul +B2ACKorean hangul +B2C8Korean hangul +B2C9Korean hangul +B2CCKorean hangul +B2D0Korean hangul +B2D8Korean hangul +B2D9Korean hangul +B2DBKorean hangul +B2DDKorean hangul +B2E2Korean hangul +B2E4Korean hangul +B2E5Korean hangul +B2E6Korean hangul +B2E8Korean hangul +B2EBKorean hangul +B2ECKorean hangul +B2EDKorean hangul +B2EEKorean hangul +B2F3Korean hangul +B2F4Korean hangul +B2F5Korean hangul +B2F7Korean hangul +B2F9Korean hangul +B2FAKorean hangul +B2FBKorean hangul +B2FFKorean hangul +B300Korean hangul +B301Korean hangul +B304Korean hangul +B308Korean hangul +B310Korean hangul +B311Korean hangul +B313Korean hangul +B314Korean hangul +B315Korean hangul +B354Korean hangul +B355Korean hangul +B358Korean hangul +B35BKorean hangul +B35CKorean hangul +B35FKorean hangul +B364Korean hangul +B365Korean hangul +B367Korean hangul +B368Korean hangul +B369Korean hangul +B36AKorean hangul +B36BKorean hangul +B36EKorean hangul +B370Korean hangul +B371Korean hangul +B374Korean hangul +B378Korean hangul +B380Korean hangul +B383Korean hangul +B385Korean hangul +B38CKorean hangul +B3C4Korean hangul +B3C5Korean hangul +B3C8Korean hangul +B3CBKorean hangul +B3CCKorean hangul +B3D0Korean hangul +B3D4Korean hangul +B3D5Korean hangul +B3D7Korean hangul +B3D9Korean hangul +B3DBKorean hangul +B3FCKorean hangul +B400Korean hangul +B410Korean hangul +B418Korean hangul +B41CKorean hangul +B420Korean hangul +B428Korean hangul +B429Korean hangul +B42BKorean hangul +B42CKorean hangul +B450Korean hangul +B451Korean hangul +B454Korean hangul +B458Korean hangul +B460Korean hangul +B461Korean hangul +B463Korean hangul +B465Korean hangul +B46CKorean hangul +B480Korean hangul +B488Korean hangul +B4A4Korean hangul +B4B7Korean hangul +B4C0Korean hangul +B4D0Korean hangul +B4DCKorean hangul +B4DDKorean hangul +B4E0Korean hangul +B4E3Korean hangul +B4E4Korean hangul +B4ECKorean hangul +B4EDKorean hangul +B4EFKorean hangul +B4F1Korean hangul +B514Korean hangul +B515Korean hangul +B518Korean hangul +B51BKorean hangul +B51CKorean hangul +B524Korean hangul +B525Korean hangul +B527Korean hangul +B528Korean hangul +B529Korean hangul +B52AKorean hangul +B530Korean hangul +B531Korean hangul +B532Korean hangul +B534Korean hangul +B537Korean hangul +B538Korean hangul +B540Korean hangul +B541Korean hangul +B543Korean hangul +B544Korean hangul +B545Korean hangul +B54BKorean hangul +B54CKorean hangul +B54DKorean hangul +B550Korean hangul +B554Korean hangul +B55CKorean hangul +B55DKorean hangul +B55FKorean hangul +B560Korean hangul +B561Korean hangul +B5A0Korean hangul +B5A1Korean hangul +B5A4Korean hangul +B5A8Korean hangul +B5ABKorean hangul +B5B0Korean hangul +B5B1Korean hangul +B5B3Korean hangul +B5B4Korean hangul +B5B5Korean hangul +B5BBKorean hangul +B5BCKorean hangul +B5C0Korean hangul +B5C4Korean hangul +B5CCKorean hangul +B5CFKorean hangul +B5D1Korean hangul +B610Korean hangul +B611Korean hangul +B614Korean hangul +B618Korean hangul +B625Korean hangul +B664Korean hangul +B69CKorean hangul +B69DKorean hangul +B6A4Korean hangul +B6ABKorean hangul +B6ACKorean hangul +B6B1Korean hangul +B6F0Korean hangul +B6F4Korean hangul +B6F8Korean hangul +B700Korean hangul +B701Korean hangul +B728Korean hangul +B729Korean hangul +B72CKorean hangul +B72FKorean hangul +B730Korean hangul +B738Korean hangul +B739Korean hangul +B73BKorean hangul +B744Korean hangul +B748Korean hangul +B760Korean hangul +B764Korean hangul +B768Korean hangul +B770Korean hangul +B771Korean hangul +B775Korean hangul +B77CKorean hangul +B77DKorean hangul +B780Korean hangul +B784Korean hangul +B78CKorean hangul +B78DKorean hangul +B78FKorean hangul +B790Korean hangul +B791Korean hangul +B797Korean hangul +B798Korean hangul +B799Korean hangul +B79CKorean hangul +B7A0Korean hangul +B7A8Korean hangul +B7A9Korean hangul +B7ABKorean hangul +B7ACKorean hangul +B7ADKorean hangul +B7B4Korean hangul +B7B5Korean hangul +B7C9Korean hangul +B7ECKorean hangul +B7EDKorean hangul +B7F0Korean hangul +B7F4Korean hangul +B7FCKorean hangul +B7FDKorean hangul +B7FFKorean hangul +B800Korean hangul +B801Korean hangul +B807Korean hangul +B808Korean hangul +B809Korean hangul +B80CKorean hangul +B810Korean hangul +B818Korean hangul +B819Korean hangul +B81BKorean hangul +B81DKorean hangul +B824Korean hangul +B825Korean hangul +B828Korean hangul +B82CKorean hangul +B834Korean hangul +B835Korean hangul +B837Korean hangul +B838Korean hangul +B839Korean hangul +B840Korean hangul +B85CKorean hangul +B85DKorean hangul +B860Korean hangul +B864Korean hangul +B86CKorean hangul +B86DKorean hangul +B86FKorean hangul +B871Korean hangul +B8B0Korean hangul +B8CCKorean hangul +B8E1Korean hangul +B8E8Korean hangul +B8E9Korean hangul +B8ECKorean hangul +B8F0Korean hangul +B8F8Korean hangul +B8F9Korean hangul +B8FBKorean hangul +B8FDKorean hangul +B904Korean hangul +B93CKorean hangul +B958Korean hangul +B959Korean hangul +B95CKorean hangul +B960Korean hangul +B968Korean hangul +B96DKorean hangul +B974Korean hangul +B975Korean hangul +B978Korean hangul +B97CKorean hangul +B984Korean hangul +B985Korean hangul +B987Korean hangul +B989Korean hangul +B98EKorean hangul +B9ACKorean hangul +B9ADKorean hangul +B9B0Korean hangul +B9B4Korean hangul +B9BCKorean hangul +B9BDKorean hangul +B9BFKorean hangul +B9C1Korean hangul +B9C8Korean hangul +B9C9Korean hangul +B9CCKorean hangul +B9CEKorean hangul +B9CFKorean hangul +B9D0Korean hangul +B9D1Korean hangul +B9D8Korean hangul +B9D9Korean hangul +B9DBKorean hangul +B9DDKorean hangul +B9DEKorean hangul +B9E1Korean hangul +B9E3Korean hangul +B9E4Korean hangul +B9E5Korean hangul +B9E8Korean hangul +B9ECKorean hangul +B9F4Korean hangul +B9F5Korean hangul +B9F7Korean hangul +B9F8Korean hangul +B9F9Korean hangul +B9FAKorean hangul +BA00Korean hangul +BA38Korean hangul +BA39Korean hangul +BA3CKorean hangul +BA40Korean hangul +BA48Korean hangul +BA49Korean hangul +BA4BKorean hangul +BA4DKorean hangul +BA4EKorean hangul +BA53Korean hangul +BA54Korean hangul +BA55Korean hangul +BA58Korean hangul +BA5CKorean hangul +BA64Korean hangul +BA65Korean hangul +BA67Korean hangul +BA70Korean hangul +BA71Korean hangul +BA74Korean hangul +BA78Korean hangul +BA83Korean hangul +BA84Korean hangul +BA85Korean hangul +BA87Korean hangul +BAA8Korean hangul +BAA9Korean hangul +BAABKorean hangul +BAACKorean hangul +BAB0Korean hangul +BAB8Korean hangul +BAB9Korean hangul +BABBKorean hangul +BABDKorean hangul +BAC3Korean hangul +BAFCKorean hangul +BB0FKorean hangul +BB18Korean hangul +BB34Korean hangul +BB35Korean hangul +BB36Korean hangul +BB38Korean hangul +BB3BKorean hangul +BB3CKorean hangul +BB3DKorean hangul +BB44Korean hangul +BB47Korean hangul +BB49Korean hangul +BB4DKorean hangul +BB4FKorean hangul +BB50Korean hangul +BB54Korean hangul +BB58Korean hangul +BB61Korean hangul +BB63Korean hangul +BB88Korean hangul +BB8CKorean hangul +BBA4Korean hangul +BBC0Korean hangul +BBC4Korean hangul +BBC8Korean hangul +BBD0Korean hangul +BBF8Korean hangul +BBF9Korean hangul +BBFCKorean hangul +BBFFKorean hangul +BC00Korean hangul +BC08Korean hangul +BC09Korean hangul +BC0BKorean hangul +BC0DKorean hangul +BC0FKorean hangul +BC11Korean hangul +BBB4Korean hangul +BC14Korean hangul +BC15Korean hangul +BC16Korean hangul +BC18Korean hangul +BC1BKorean hangul +BC1CKorean hangul +BC1DKorean hangul +BC1FKorean hangul +BC24Korean hangul +BC25Korean hangul +BC27Korean hangul +BC29Korean hangul +BC2DKorean hangul +BC30Korean hangul +BC31Korean hangul +BC34Korean hangul +BC37Korean hangul +BC38Korean hangul +BC40Korean hangul +BC41Korean hangul +BC43Korean hangul +BC44Korean hangul +BC45Korean hangul +BC84Korean hangul +BC85Korean hangul +BC88Korean hangul +BC8BKorean hangul +BC8CKorean hangul +BC94Korean hangul +BC95Korean hangul +BC97Korean hangul +BC98Korean hangul +BC99Korean hangul +BC9AKorean hangul +BCA0Korean hangul +BCA1Korean hangul +BCA4Korean hangul +BCA7Korean hangul +BCA8Korean hangul +BCB0Korean hangul +BCB1Korean hangul +BCB3Korean hangul +BCB5Korean hangul +BCBCKorean hangul +BCBDKorean hangul +BCC0Korean hangul +BCC4Korean hangul +BCCCKorean hangul +BCCDKorean hangul +BCCFKorean hangul +BCD0Korean hangul +BCD1Korean hangul +BCD2Korean hangul +BCD5Korean hangul +BCF4Korean hangul +BCF5Korean hangul +BCF6Korean hangul +BCF8Korean hangul +BCFCKorean hangul +BD04Korean hangul +BD05Korean hangul +BD07Korean hangul +BD09Korean hangul +BD10Korean hangul +BD14Korean hangul +BD24Korean hangul +BD48Korean hangul +BD49Korean hangul +BD4CKorean hangul +BD50Korean hangul +BD58Korean hangul +BD59Korean hangul +BD64Korean hangul +BD80Korean hangul +BD81Korean hangul +BD84Korean hangul +BD87Korean hangul +BD88Korean hangul +BD89Korean hangul +BD90Korean hangul +BD91Korean hangul +BD93Korean hangul +BD95Korean hangul +BD99Korean hangul +BD9CKorean hangul +BDD4Korean hangul +BDF0Korean hangul +BE0CKorean hangul +BE0DKorean hangul +BE10Korean hangul +BE14Korean hangul +BE1CKorean hangul +BE1DKorean hangul +BE1FKorean hangul +BE44Korean hangul +BE45Korean hangul +BE48Korean hangul +BE4BKorean hangul +BE4CKorean hangul +BE4EKorean hangul +BE54Korean hangul +BE55Korean hangul +BE57Korean hangul +BE59Korean hangul +BE5AKorean hangul +BE5BKorean hangul +BE60Korean hangul +BE61Korean hangul +BE64Korean hangul +BE68Korean hangul +BE70Korean hangul +BE71Korean hangul +BE73Korean hangul +BE74Korean hangul +BE75Korean hangul +BE7BKorean hangul +BE7CKorean hangul +BE7DKorean hangul +BE80Korean hangul +BE84Korean hangul +BE8CKorean hangul +BE8FKorean hangul +BE90Korean hangul +BE91Korean hangul +BE98Korean hangul +BEA8Korean hangul +BED0Korean hangul +BED1Korean hangul +BED4Korean hangul +BED7Korean hangul +BED8Korean hangul +BEE0Korean hangul +BEE3Korean hangul +BEE4Korean hangul +BEE5Korean hangul +BEECKorean hangul +BF08Korean hangul +BF09Korean hangul +BF18Korean hangul +BF1DKorean hangul +BF40Korean hangul +BF41Korean hangul +BF44Korean hangul +BF48Korean hangul +BF50Korean hangul +BF51Korean hangul +BF55Korean hangul +BFB0Korean hangul +BFC0Korean hangul +BFC5Korean hangul +BFCCKorean hangul +BFCDKorean hangul +BFD0Korean hangul +BFD4Korean hangul +BFDCKorean hangul +BFDDKorean hangul +BFE1Korean hangul +C058Korean hangul +C059Korean hangul +C05CKorean hangul +C060Korean hangul +C068Korean hangul +C069Korean hangul +C090Korean hangul +C091Korean hangul +C094Korean hangul +C098Korean hangul +C0A0Korean hangul +C0A3Korean hangul +C0A5Korean hangul +C0ACKorean hangul +C0ADKorean hangul +C0AEKorean hangul +C0AFKorean hangul +C0B0Korean hangul +C0B3Korean hangul +C0B4Korean hangul +C0B5Korean hangul +C0B6Korean hangul +C0BCKorean hangul +C0BDKorean hangul +C0BFKorean hangul +C0C0Korean hangul +C0C1Korean hangul +C0C5Korean hangul +C0C8Korean hangul +C0C9Korean hangul +C0CCKorean hangul +C0CFKorean hangul +C0D0Korean hangul +C0D8Korean hangul +C0D9Korean hangul +C0DBKorean hangul +C0DCKorean hangul +C0DDKorean hangul +C0E4Korean hangul +C0E5Korean hangul +C0E8Korean hangul +C0ECKorean hangul +C0F4Korean hangul +C0F7Korean hangul +C0F9Korean hangul +C11CKorean hangul +C11DKorean hangul +C11EKorean hangul +C120Korean hangul +C123Korean hangul +C124Korean hangul +C125Korean hangul +C126Korean hangul +C127Korean hangul +C12AKorean hangul +C12CKorean hangul +C12DKorean hangul +C12FKorean hangul +C130Korean hangul +C131Korean hangul +C136Korean hangul +C138Korean hangul +C139Korean hangul +C13CKorean hangul +C140Korean hangul +C148Korean hangul +C149Korean hangul +C14BKorean hangul +C14DKorean hangul +C151Korean hangul +C154Korean hangul +C158Korean hangul +C167Korean hangul +C168Korean hangul +C170Korean hangul +C18CKorean hangul +C18DKorean hangul +C18EKorean hangul +C190Korean hangul +C194Korean hangul +C19CKorean hangul +C19DKorean hangul +C19FKorean hangul +C1A1Korean hangul +C1A5Korean hangul +C1A8Korean hangul +C1A9Korean hangul +C1B0Korean hangul +C1C4Korean hangul +C1C8Korean hangul +C1D7Korean hangul +C1E0Korean hangul +C1E4Korean hangul +C1E8Korean hangul +C1F0Korean hangul +C1F1Korean hangul +C1F3Korean hangul +C1FCKorean hangul +C1FDKorean hangul +C200Korean hangul +C204Korean hangul +C20DKorean hangul +C218Korean hangul +C219Korean hangul +C21CKorean hangul +C21FKorean hangul +C220Korean hangul +C228Korean hangul +C229Korean hangul +C22BKorean hangul +C22DKorean hangul +C22FKorean hangul +C231Korean hangul +C232Korean hangul +C234Korean hangul +C250Korean hangul +C258Korean hangul +C26CKorean hangul +C270Korean hangul +C274Korean hangul +C27CKorean hangul +C27DKorean hangul +C27FKorean hangul +C281Korean hangul +C288Korean hangul +C289Korean hangul +C290Korean hangul +C298Korean hangul +C29BKorean hangul +C29DKorean hangul +C2A4Korean hangul +C2A5Korean hangul +C2A8Korean hangul +C2ACKorean hangul +C2ADKorean hangul +C2B4Korean hangul +C2B5Korean hangul +C2B7Korean hangul +C2B9Korean hangul +C2DCKorean hangul +C2DDKorean hangul +C2E0Korean hangul +C2E3Korean hangul +C2E4Korean hangul +C2EBKorean hangul +C2ECKorean hangul +C2EDKorean hangul +C2EFKorean hangul +C2F1Korean hangul +C2F6Korean hangul +C2F8Korean hangul +C2F9Korean hangul +C2FCKorean hangul +C300Korean hangul +C308Korean hangul +C309Korean hangul +C30BKorean hangul +C30CKorean hangul +C30DKorean hangul +C313Korean hangul +C314Korean hangul +C315Korean hangul +C318Korean hangul +C31CKorean hangul +C324Korean hangul +C327Korean hangul +C328Korean hangul +C329Korean hangul +C330Korean hangul +C343Korean hangul +C345Korean hangul +C368Korean hangul +C369Korean hangul +C36CKorean hangul +C370Korean hangul +C372Korean hangul +C378Korean hangul +C379Korean hangul +C37CKorean hangul +C37DKorean hangul +C384Korean hangul +C388Korean hangul +C399Korean hangul +C3D8Korean hangul +C3D9Korean hangul +C3DCKorean hangul +C3DFKorean hangul +C3E0Korean hangul +C3E8Korean hangul +C3EDKorean hangul +C3F4Korean hangul +C3F5Korean hangul +C410Korean hangul +C42CKorean hangul +C430Korean hangul +C434Korean hangul +C43CKorean hangul +C43FKorean hangul +C464Korean hangul +C465Korean hangul +C468Korean hangul +C46CKorean hangul +C474Korean hangul +C479Korean hangul +C480Korean hangul +C494Korean hangul +C4D4Korean hangul +C4D5Korean hangul +C4F0Korean hangul +C4F1Korean hangul +C4F4Korean hangul +C4F8Korean hangul +C500Korean hangul +C501Korean hangul +C50CKorean hangul +C510Korean hangul +C528Korean hangul +C529Korean hangul +C52CKorean hangul +C530Korean hangul +C538Korean hangul +C539Korean hangul +C53BKorean hangul +C53DKorean hangul +C544Korean hangul +C545Korean hangul +C548Korean hangul +C549Korean hangul +C54AKorean hangul +C54CKorean hangul +C54EKorean hangul +C553Korean hangul +C554Korean hangul +C555Korean hangul +C557Korean hangul +C558Korean hangul +C559Korean hangul +C55EKorean hangul +C55FKorean hangul +C560Korean hangul +C561Korean hangul +C564Korean hangul +C568Korean hangul +C570Korean hangul +C571Korean hangul +C573Korean hangul +C574Korean hangul +C575Korean hangul +C57CKorean hangul +C57DKorean hangul +C580Korean hangul +C584Korean hangul +C587Korean hangul +C58CKorean hangul +C58DKorean hangul +C58FKorean hangul +C590Korean hangul +C591Korean hangul +C595Korean hangul +C597Korean hangul +C598Korean hangul +C59CKorean hangul +C5B4Korean hangul +C5B5Korean hangul +C5B6Korean hangul +C5B8Korean hangul +C5B9Korean hangul +C5BAKorean hangul +C5BBKorean hangul +C5BCKorean hangul +C5BDKorean hangul +C5C4Korean hangul +C5C5Korean hangul +C5C6Korean hangul +C5C7Korean hangul +C5C8Korean hangul +C5C9Korean hangul +C5CAKorean hangul +C5CCKorean hangul +C5CEKorean hangul +C5D0Korean hangul +C5D1Korean hangul +C5D4Korean hangul +C5D8Korean hangul +C5E0Korean hangul +C5E1Korean hangul +C5E3Korean hangul +C5E5Korean hangul +C5ECKorean hangul +C5EDKorean hangul +C5EEKorean hangul +C5F0Korean hangul +C5F4Korean hangul +C5F6Korean hangul +C5F7Korean hangul +C5FCKorean hangul +C5FDKorean hangul +C5FEKorean hangul +C5FFKorean hangul +C600Korean hangul +C601Korean hangul +C606Korean hangul +C607Korean hangul +C608Korean hangul +C60CKorean hangul +C610Korean hangul +C61BKorean hangul +C624Korean hangul +C625Korean hangul +C628Korean hangul +C62CKorean hangul +C62DKorean hangul +C62EKorean hangul +C633Korean hangul +C634Korean hangul +C635Korean hangul +C637Korean hangul +C639Korean hangul +C63AKorean hangul +C63BKorean hangul +C640Korean hangul +C641Korean hangul +C644Korean hangul +C648Korean hangul +C650Korean hangul +C651Korean hangul +C653Korean hangul +C654Korean hangul +C65CKorean hangul +C65DKorean hangul +C660Korean hangul +C671Korean hangul +C678Korean hangul +C679Korean hangul +C67CKorean hangul +C680Korean hangul +C688Korean hangul +C68BKorean hangul +C68DKorean hangul +C694Korean hangul +C695Korean hangul +C698Korean hangul +C6A5Korean hangul +C6A7Korean hangul +C6A9Korean hangul +C6B0Korean hangul +C6B1Korean hangul +C6B4Korean hangul +C6B7Korean hangul +C6B8Korean hangul +C6B9Korean hangul +C6BAKorean hangul +C6C0Korean hangul +C6C1Korean hangul +C6C3Korean hangul +C6C5Korean hangul +C6CCKorean hangul +C6CDKorean hangul +C6D0Korean hangul +C6D4Korean hangul +C6DCKorean hangul +C6DDKorean hangul +C6DFKorean hangul +C6E0Korean hangul +C6E1Korean hangul +C6E8Korean hangul +C6E9Korean hangul +C6ECKorean hangul +C6F0Korean hangul +C6F8Korean hangul +C704Korean hangul +C705Korean hangul +C708Korean hangul +C70CKorean hangul +C714Korean hangul +C717Korean hangul +C719Korean hangul +C720Korean hangul +C721Korean hangul +C724Korean hangul +C728Korean hangul +C730Korean hangul +C735Korean hangul +C737Korean hangul +C73CKorean hangul +C73DKorean hangul +C740Korean hangul +C744Korean hangul +C74AKorean hangul +C74CKorean hangul +C74DKorean hangul +C751Korean hangul +C758Korean hangul +C774Korean hangul +C775Korean hangul +C778Korean hangul +C77CKorean hangul +C77DKorean hangul +C783Korean hangul +C784Korean hangul +C785Korean hangul +C787Korean hangul +C788Korean hangul +C789Korean hangul +C78AKorean hangul +C78EKorean hangul +C655Korean hangul +C790Korean hangul +C791Korean hangul +C794Korean hangul +C796Korean hangul +C798Korean hangul +C7A0Korean hangul +C7A1Korean hangul +C7A3Korean hangul +C7A4Korean hangul +C7A5Korean hangul +C7A6Korean hangul +C7A7Korean hangul +C7ACKorean hangul +C7ADKorean hangul +C7B0Korean hangul +C7B4Korean hangul +C7BCKorean hangul +C7BDKorean hangul +C7BFKorean hangul +C7C0Korean hangul +C7C1Korean hangul +C7C8Korean hangul +C7C9Korean hangul +C7CCKorean hangul +C7D8Korean hangul +C800Korean hangul +C801Korean hangul +C804Korean hangul +C808Korean hangul +C80AKorean hangul +C810Korean hangul +C811Korean hangul +C813Korean hangul +C814Korean hangul +C815Korean hangul +C816Korean hangul +C81CKorean hangul +C81DKorean hangul +C820Korean hangul +C824Korean hangul +C82CKorean hangul +C82DKorean hangul +C82FKorean hangul +C838Korean hangul +C83CKorean hangul +C84CKorean hangul +C870Korean hangul +C871Korean hangul +C874Korean hangul +C878Korean hangul +C87AKorean hangul +C880Korean hangul +C881Korean hangul +C885Korean hangul +C886Korean hangul +C887Korean hangul +C88BKorean hangul +C88CKorean hangul +C88DKorean hangul +C890Korean hangul +C894Korean hangul +C89CKorean hangul +C89DKorean hangul +C89FKorean hangul +C8A0Korean hangul +C8A8Korean hangul +C8ACKorean hangul +C8B0Korean hangul +C8B8Korean hangul +C8C4Korean hangul +C8C8Korean hangul +C8CCKorean hangul +C8D4Korean hangul +C8D5Korean hangul +C8D7Korean hangul +C8E0Korean hangul +C8E4Korean hangul +C8F0Korean hangul +C8F1Korean hangul +C8F5Korean hangul +C8FCKorean hangul +C8FDKorean hangul +C900Korean hangul +C904Korean hangul +C906Korean hangul +C90CKorean hangul +C90DKorean hangul +C90FKorean hangul +C911Korean hangul +C918Korean hangul +C92CKorean hangul +C950Korean hangul +C954Korean hangul +C958Korean hangul +C960Korean hangul +C961Korean hangul +C96CKorean hangul +C970Korean hangul +C974Korean hangul +C988Korean hangul +C989Korean hangul +C98CKorean hangul +C990Korean hangul +C998Korean hangul +C999Korean hangul +C99DKorean hangul +C9C0Korean hangul +C9C1Korean hangul +C9C4Korean hangul +C9C7Korean hangul +C9C8Korean hangul +C9CAKorean hangul +C9D0Korean hangul +C9D1Korean hangul +C9D3Korean hangul +C9D5Korean hangul +C9D6Korean hangul +C9D9Korean hangul +C9DAKorean hangul +C9DCKorean hangul +C9DDKorean hangul +C9E0Korean hangul +C9E2Korean hangul +C9E4Korean hangul +C9E7Korean hangul +C9ECKorean hangul +C9EDKorean hangul +C9EFKorean hangul +C9F0Korean hangul +C9F1Korean hangul +C9F8Korean hangul +C9F9Korean hangul +C9FCKorean hangul +CA00Korean hangul +CA08Korean hangul +CA09Korean hangul +CA0BKorean hangul +CA0CKorean hangul +CA0DKorean hangul +CA18Korean hangul +CA4CKorean hangul +CA4DKorean hangul +CA50Korean hangul +CA54Korean hangul +CA5CKorean hangul +CA5DKorean hangul +CA61Korean hangul +CA84Korean hangul +CA98Korean hangul +CABCKorean hangul +CABDKorean hangul +CAC0Korean hangul +CAC4Korean hangul +CACCKorean hangul +CACDKorean hangul +CAD1Korean hangul +CAD2Korean hangul +CAD3Korean hangul +CAD8Korean hangul +CAD9Korean hangul +CB10Korean hangul +CB14Korean hangul +CB18Korean hangul +CB20Korean hangul +CB21Korean hangul +CB41Korean hangul +CB48Korean hangul +CB49Korean hangul +CB50Korean hangul +CB58Korean hangul +CB59Korean hangul +CB5DKorean hangul +CB64Korean hangul +CBB8Korean hangul +CBD4Korean hangul +CBE4Korean hangul +CBE7Korean hangul +CC0CKorean hangul +CC0DKorean hangul +CC10Korean hangul +CC14Korean hangul +CC1CKorean hangul +CC1DKorean hangul +CC21Korean hangul +CC22Korean hangul +CC27Korean hangul +CC28Korean hangul +CC29Korean hangul +CC2CKorean hangul +CC2EKorean hangul +CC2FKorean hangul +CC30Korean hangul +CC38Korean hangul +CC39Korean hangul +CC3BKorean hangul +CC3CKorean hangul +CC3DKorean hangul +CC3EKorean hangul +CC3FKorean hangul +CC44Korean hangul +CC45Korean hangul +CC48Korean hangul +CC4CKorean hangul +CC54Korean hangul +CC55Korean hangul +CC58Korean hangul +CC59Korean hangul +CC60Korean hangul +CC64Korean hangul +CC70Korean hangul +CC71Korean hangul +CC98Korean hangul +CC99Korean hangul +CC9CKorean hangul +CCA0Korean hangul +CCA8Korean hangul +CCA9Korean hangul +CCABKorean hangul +CCADKorean hangul +CCB4Korean hangul +CCB5Korean hangul +CCB8Korean hangul +CCBCKorean hangul +CCC7Korean hangul +CCD0Korean hangul +CCE4Korean hangul +CD08Korean hangul +CD09Korean hangul +CD0CKorean hangul +CD10Korean hangul +CD18Korean hangul +CD19Korean hangul +CD1BKorean hangul +CD1DKorean hangul +CD2CKorean hangul +CD5CKorean hangul +CD78Korean hangul +CD94Korean hangul +CD95Korean hangul +CD98Korean hangul +CD9CKorean hangul +CDA4Korean hangul +CDA5Korean hangul +CDA7Korean hangul +CDA9Korean hangul +CDB0Korean hangul +CDC4Korean hangul +CDCCKorean hangul +CDE8Korean hangul +CE04Korean hangul +CE20Korean hangul +CE21Korean hangul +CE30Korean hangul +CE35Korean hangul +CE58Korean hangul +CE59Korean hangul +CE5CKorean hangul +CE60Korean hangul +CE61Korean hangul +CE68Korean hangul +CE69Korean hangul +CE6BKorean hangul +CE6DKorean hangul +CE74Korean hangul +CE75Korean hangul +CE78Korean hangul +CE7CKorean hangul +CE84Korean hangul +CE85Korean hangul +CE87Korean hangul +CE89Korean hangul +CE90Korean hangul +CE91Korean hangul +CE94Korean hangul +CE98Korean hangul +CEA0Korean hangul +CEA1Korean hangul +CEA3Korean hangul +CEA5Korean hangul +CEACKorean hangul +CEADKorean hangul +CEE4Korean hangul +CEE8Korean hangul +CEECKorean hangul +CEF4Korean hangul +CEF5Korean hangul +CEF7Korean hangul +CEF9Korean hangul +CF00Korean hangul +CF01Korean hangul +CF04Korean hangul +CF08Korean hangul +CF10Korean hangul +CF11Korean hangul +CF13Korean hangul +CF15Korean hangul +CF1CKorean hangul +CF20Korean hangul +CF24Korean hangul +CF2CKorean hangul +CF2DKorean hangul +CF2FKorean hangul +CF30Korean hangul +CF54Korean hangul +CF55Korean hangul +CF58Korean hangul +CF5CKorean hangul +CF64Korean hangul +CF65Korean hangul +CF67Korean hangul +CF69Korean hangul +CF70Korean hangul +CF71Korean hangul +CF74Korean hangul +CF78Korean hangul +CF80Korean hangul +CF85Korean hangul +CF8CKorean hangul +CF8DKorean hangul +CFA1Korean hangul +CFB0Korean hangul +CFC4Korean hangul +CFE0Korean hangul +CFE1Korean hangul +CFE4Korean hangul +CFE8Korean hangul +CFF0Korean hangul +CFF3Korean hangul +CFF5Korean hangul +CFFCKorean hangul +D018Korean hangul +D02DKorean hangul +D034Korean hangul +D035Korean hangul +D038Korean hangul +D050Korean hangul +D06CKorean hangul +D070Korean hangul +D074Korean hangul +D07CKorean hangul +D07DKorean hangul +D081Korean hangul +D0A4Korean hangul +D0A5Korean hangul +D0A8Korean hangul +D0ACKorean hangul +D0B4Korean hangul +D0B5Korean hangul +D0B7Korean hangul +D0B9Korean hangul +D0C0Korean hangul +D0C1Korean hangul +D0C4Korean hangul +D0C8Korean hangul +D0C9Korean hangul +D0D0Korean hangul +D0D1Korean hangul +D0D3Korean hangul +D0D4Korean hangul +D0D5Korean hangul +D0DCKorean hangul +D0DDKorean hangul +D0E0Korean hangul +D0E4Korean hangul +D0ECKorean hangul +D0EDKorean hangul +D0EFKorean hangul +D0F0Korean hangul +D0F1Korean hangul +D130Korean hangul +D131Korean hangul +D134Korean hangul +D138Korean hangul +D140Korean hangul +D141Korean hangul +D143Korean hangul +D144Korean hangul +D145Korean hangul +D14CKorean hangul +D14DKorean hangul +D150Korean hangul +D154Korean hangul +D15CKorean hangul +D15DKorean hangul +D15FKorean hangul +D160Korean hangul +D161Korean hangul +D168Korean hangul +D1A0Korean hangul +D1A1Korean hangul +D1A4Korean hangul +D1A8Korean hangul +D1B0Korean hangul +D1B1Korean hangul +D1B3Korean hangul +D1B5Korean hangul +D1D8Korean hangul +D1F4Korean hangul +D22CKorean hangul +D22DKorean hangul +D230Korean hangul +D234Korean hangul +D23CKorean hangul +D23DKorean hangul +D23FKorean hangul +D241Korean hangul +D264Korean hangul +D277Korean hangul +D280Korean hangul +D284Korean hangul +D288Korean hangul +D290Korean hangul +D291Korean hangul +D293Korean hangul +D295Korean hangul +D29CKorean hangul +D2ACKorean hangul +D2B8Korean hangul +D2B9Korean hangul +D2BCKorean hangul +D2BFKorean hangul +D2C0Korean hangul +D2C8Korean hangul +D2C9Korean hangul +D2CBKorean hangul +D2D4Korean hangul +D1F8Korean hangul +D2F0Korean hangul +D2F1Korean hangul +D2F4Korean hangul +D2F8Korean hangul +D300Korean hangul +D301Korean hangul +D305Korean hangul +D30CKorean hangul +D30DKorean hangul +D30EKorean hangul +D310Korean hangul +D314Korean hangul +D31CKorean hangul +D31DKorean hangul +D31FKorean hangul +D320Korean hangul +D321Korean hangul +D325Korean hangul +D328Korean hangul +D329Korean hangul +D32CKorean hangul +D330Korean hangul +D338Korean hangul +D339Korean hangul +D33BKorean hangul +D33CKorean hangul +D33DKorean hangul +D37CKorean hangul +D37DKorean hangul +D380Korean hangul +D384Korean hangul +D38CKorean hangul +D38DKorean hangul +D38FKorean hangul +D390Korean hangul +D391Korean hangul +D398Korean hangul +D399Korean hangul +D39CKorean hangul +D3A0Korean hangul +D3A8Korean hangul +D3A9Korean hangul +D3ABKorean hangul +D3ADKorean hangul +D3B4Korean hangul +D3B5Korean hangul +D3B8Korean hangul +D3BCKorean hangul +D3C4Korean hangul +D3C5Korean hangul +D3C8Korean hangul +D3C9Korean hangul +D3D0Korean hangul +D3ECKorean hangul +D3EDKorean hangul +D3F0Korean hangul +D3F4Korean hangul +D3FCKorean hangul +D3FDKorean hangul +D3FFKorean hangul +D401Korean hangul +D440Korean hangul +D444Korean hangul +D45CKorean hangul +D46FKorean hangul +D478Korean hangul +D479Korean hangul +D47CKorean hangul +D480Korean hangul +D488Korean hangul +D489Korean hangul +D48BKorean hangul +D48DKorean hangul +D4CCKorean hangul +D4E8Korean hangul +D504Korean hangul +D508Korean hangul +D50CKorean hangul +D514Korean hangul +D515Korean hangul +D53CKorean hangul +D53DKorean hangul +D540Korean hangul +D544Korean hangul +D54CKorean hangul +D54DKorean hangul +D54FKorean hangul +D551Korean hangul +D558Korean hangul +D559Korean hangul +D55CKorean hangul +D560Korean hangul +D565Korean hangul +D568Korean hangul +D569Korean hangul +D56BKorean hangul +D56CKorean hangul +D56DKorean hangul +D571Korean hangul +D574Korean hangul +D575Korean hangul +D578Korean hangul +D57CKorean hangul +D584Korean hangul +D585Korean hangul +D587Korean hangul +D588Korean hangul +D589Korean hangul +D590Korean hangul +D5A5Korean hangul +D5C8Korean hangul +D5C9Korean hangul +D5CCKorean hangul +D5D0Korean hangul +D5D2Korean hangul +D5D8Korean hangul +D5D9Korean hangul +D5DBKorean hangul +D5DDKorean hangul +D5E4Korean hangul +D5E5Korean hangul +D5E8Korean hangul +D5ECKorean hangul +D5F4Korean hangul +D5F5Korean hangul +D5F7Korean hangul +D5F9Korean hangul +D600Korean hangul +D601Korean hangul +D604Korean hangul +D608Korean hangul +D610Korean hangul +D611Korean hangul +D613Korean hangul +D614Korean hangul +D615Korean hangul +D61CKorean hangul +D638Korean hangul +D639Korean hangul +D63CKorean hangul +D640Korean hangul +D648Korean hangul +D649Korean hangul +D64BKorean hangul +D64DKorean hangul +D654Korean hangul +D655Korean hangul +D658Korean hangul +D65CKorean hangul +D667Korean hangul +D669Korean hangul +D670Korean hangul +D671Korean hangul +D683Korean hangul +D68CKorean hangul +D68DKorean hangul +D69FKorean hangul +D6A1Korean hangul +D6A8Korean hangul +D6C4Korean hangul +D6C5Korean hangul +D6C8Korean hangul +D6CCKorean hangul +D6D1Korean hangul +D6D4Korean hangul +D6D7Korean hangul +D6E0Korean hangul +D6E4Korean hangul +D6E8Korean hangul +D6F0Korean hangul +D6FCKorean hangul +D700Korean hangul +D711Korean hangul +D718Korean hangul +D719Korean hangul +D71CKorean hangul +D720Korean hangul +D728Korean hangul +D729Korean hangul +D72DKorean hangul +D734Korean hangul +D73CKorean hangul +D744Korean hangul +D749Korean hangul +D750Korean hangul +D751Korean hangul +D754Korean hangul +D757Korean hangul +D758Korean hangul +D759Korean hangul +D760Korean hangul +D761Korean hangul +D763Korean hangul +D765Korean hangul +D769Korean hangul +D76CKorean hangul +D770Korean hangul +D774Korean hangul +D788Korean hangul +D789Korean hangul +D78CKorean hangul +D790Korean hangul +D798Korean hangul +D799Korean hangul +D79BKorean hangul +D79DKorean hangul +3181Korean hangul +3186Korean hangul +317FKorean hangul +E8B0Korean hangul +E8B1Korean hangul +E8B2Korean hangul +E8B3Korean hangul +E8B4Korean hangul +E8B5Korean hangul +E8B6Korean hangul +E8B7Korean hangul +E8B8Korean hangul +E8B9Korean hangul +E8BAKorean hangul +E8BBKorean hangul +E8BCKorean hangul +E8BDKorean hangul +E8BEKorean hangul +E8BFKorean hangul +E8C0Korean hangul +E8C1Korean hangul +E8C2Korean hangul +E8C3Korean hangul +E8C4Korean hangul +E8C5Korean hangul +E8C6Korean hangul +E8C7Korean hangul +E8C8Korean hangul +E8C9Korean hangul +AD35Korean hangul +AD7BKorean hangul +E8CAKorean hangul +AD89Korean hangul +AD9DKorean hangul +ADB9Korean hangul +ADD5Korean hangul +AE07Korean hangul +AE0EKorean hangul +AE0FKorean hangul +AE11Korean hangul +AE14Korean hangul +AE5FKorean hangul +AEEDKorean hangul +AF09Korean hangul +AF50Korean hangul +AFBFKorean hangul +B060Korean hangul +B9C4Korean hangul +C54DKorean hangul +C54FKorean hangul +C552Korean hangul +C5ABKorean hangul +C5B1Korean hangul +C61CKorean hangul +C61DKorean hangul +C6FDKorean hangul +E8CBKorean hangul +C733Korean hangul +CB4CKorean hangul +915EEast Asian ideograph +4EEBEast Asian ideograph +57B4East Asian ideograph +82CAEast Asian ideograph +82C4East Asian ideograph +841CEast Asian ideograph +8488East Asian ideograph +7519East Asian ideograph +5416East Asian ideograph +549DEast Asian ideograph +54D0East Asian ideograph +54B4East Asian ideograph +54A3East Asian ideograph +54DAEast Asian ideograph +55B9East Asian ideograph +55EAEast Asian ideograph +55F5East Asian ideograph +5623East Asian ideograph +562DEast Asian ideograph +567BEast Asian ideograph +5C9CEast Asian ideograph +7339East Asian ideograph +9987East Asian ideograph +9995East Asian ideograph +61B7East Asian ideograph +80ECEast Asian ideograph +80BCEast Asian ideograph +80BDEast Asian ideograph +80E9East Asian ideograph +810EEast Asian ideograph +8112East Asian ideograph +8159East Asian ideograph +70BBEast Asian ideograph +70C0East Asian ideograph +7818East Asian ideograph +781CEast Asian ideograph +783CEast Asian ideograph +87A8East Asian ideograph +7B7BEast Asian ideograph +7BA2East Asian ideograph +823EEast Asian ideograph +9170East Asian ideograph +8E3AEast Asian ideograph +9B0FEast Asian ideograph + \ No newline at end of file diff --git a/src/charneg-3.asn b/src/charneg-3.asn new file mode 100644 index 0000000..d178e3a --- /dev/null +++ b/src/charneg-3.asn @@ -0,0 +1,212 @@ +NegotiationRecordDefinition-charSetandLanguageNegotiation-3 +{Z39-50-negotiationRecordDefinition CharSetandLanguageNegotiation-3 (3)} +DEFINITIONS ::= BEGIN +IMPORTS LanguageCode FROM RecordSyntax-explain; + +CharSetandLanguageNegotiation ::= CHOICE{ + proposal [1] IMPLICIT OriginProposal, + response [2] IMPLICIT TargetResponse} +-- +-- For character sets: +-- Origin proposes one, two, or all three of the following, in order of +-- preference: +-- (a) 2022 character sets. +-- (b) 10646 character set. +-- (c) Private character set. +-- +-- The target responds with one of (a), (b), or (c), indicating the +-- character set(s) to be supported for all name and message strings. +-- +-- If the origin includes (a), +-- the origin proposes: +-- (1) A proposed environment: 7-bit, 8-bit, or no-preference. +-- (2) A set of iso 2022 registration numbers. +-- (3) One or more proposed initial sets of registration numbers, +-- for c0, c1, g0, g1, g2 and g3. These must come from (2). +-- (4) The proposed encoding level. +-- And if the target selects (a), it responds with: +-- (1) A selected environment: 7-bit or 8-bit. +-- (2) A subset of the set of iso 2022 registration numbers proposed +-- by the origin. +-- (3) The initial set of registrations, which must come from (2) +-- but need not be from the set of initial registrations proposed +-- by the origin. +-- (4) The encoding level; less than or equal to that proposed. +-- +-- If the origin includes (b), +-- The origin proposes: +-- (1) (optionally) A list of collections (i.e. subsets of characters from the +-- complete 10646 definition). +-- (2) An implementation level. +-- (3) Syntax/form: e.g. ucs-2, ucs-4, utf-8, utf-16. +-- And if the target selects (b), it responds by choosing a subset of the +-- collections proposed by the origin in (1) and an implementation level less +-- than or equal to that proposed by the origin in (2). +-- +-- If the origin includes (c), the origin proposes one of the following: +-- (1) A list of private character sets, by one or more object +-- identifiers. +-- (2) A list of private character sets, by an EXTERNAL. +-- (3) An indication to use a private, previously agreed upon +-- character set. +-- And if the target selects (c): +-- - If the origin proposed (1), the target should respond with (1), and +-- the list of object identifiers should be a subset of the list that +-- the origin included. +-- - If the origin proposed (2), the target should respond with (2), using +-- the same EXTERNAL definition (but not necessarily the same content) +-- used by the origin. +-- - If the origin proposed (3), the target should respond with (3). +-- +-- For Languages: +-- The origin optionally proposes one or more language codes. The target +-- response may include a single language code, which indicates the +-- language to be used for all message strings. The target may include or +-- omit this, whether or not the origin included a proposed set, and the +-- language code indicated need not be from among those proposed. +-- +-- + +OriginProposal ::= SEQUENCE { + proposedCharSets [1] IMPLICIT SEQUENCE OF CHOICE{ + -- Each should occur at most once, and in order of preference + -- (the "order of preference" is the reason why this is + -- "SEQUENCE OF CHOICE" rather than just "SEQUENCE") + iso2022 [1] Iso2022, + iso10646 [2] IMPLICIT Iso10646, + private [3] PrivateCharacterSet} OPTIONAL, + -- proposedCharSets must be omitted + -- if origin proposes version 2 + proposedlanguages [2] IMPLICIT SEQUENCE OF LanguageCode OPTIONAL, + recordsInSelectedCharSets [3] IMPLICIT BOOLEAN OPTIONAL + -- default 'false'. See rule 6 above. + } + +TargetResponse ::= SEQUENCE{ + selectedCharSets [1] CHOICE{ + iso2022 [1] Iso2022, + iso10646 [2] IMPLICIT Iso10646, + private [3] PrivateCharacterSet, + none [4] IMPLICIT NULL + -- If selected, no negotiation + -- is assumed to be in force + -- for character sets. + } OPTIONAL, + -- Omitted if and only if proposedCharSets + -- was Omitted in the request. + selectedLanguage [2] IMPLICIT LanguageCode OPTIONAL, + recordsInSelectedCharSets [3] IMPLICIT BOOLEAN OPTIONAL + -- Omitted if and only if 'recordsInSelectedCharSets' was omitted + -- in the request. See rule 6 above. + } + + +PrivateCharacterSet ::= CHOICE{ + viaOid [1] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, + externallySpecified [2] IMPLICIT EXTERNAL, + previouslyAgreedUpon [3] IMPLICIT NULL} + +-- IMPORTED +-- LanguageCode ::= GeneralString -- from ANSI Z39.53-1994 + +-- Definition of ISO2022 +-- For ISO 2022, the following is negotiated: +-- 1) The environment: 7-bit or 8-bit; +-- 2) a set of registration numbers (from the ISO Register of coded +-- character sets) for graphical and control character sets; +-- 3) g0, g1, g2, g3, c0, c1, the registration numbers of the graphical and +-- control character sets that are initially designated to g0, g1, etc. +-- The origin submits one or more sequences of values for +-- g0, g1, g2, g3, c0, c1 (for each sequence: at least one of +-- g0 and g1 must be included; g2 and g3 are optional and +-- may be included only if g1 is included; +-- c0 should be included; and c1 is optional); the target +-- selects one of the proposed sequences. +-- 4) gleft: which of g0, g1, g2 or g3, initially has GL shift status in +-- an 8-bit environment or has shift status in a 7-bit environment; and +-- 5) gright: which of g1, g2 or g3 initially has GR shift status in an +-- 8-bit environment. + +Iso2022 ::= CHOICE{ + originProposal [1] IMPLICIT SEQUENCE{ + proposedEnvironment [0] Environment OPTIONAL, + -- omitted means no preference + proposedSets [1] IMPLICIT SEQUENCE OF INTEGER, + proposedInitialSets [2] IMPLICIT SEQUENCE OF + InitialSet, + proposedLeftAndRight [3] IMPLICIT LeftAndRight}, + targetResponse [2] IMPLICIT SEQUENCE{ + selectedEnvironment [0] Environment, + selectedSets [1] IMPLICIT SEQUENCE OF INTEGER, + selectedinitialSet [2] IMPLICIT InitialSet, + selectedLeftAndRight [3] IMPLICIT LeftAndRight}} + +Environment ::= CHOICE{ + sevenBit [1] IMPLICIT NULL, + eightBit [2] IMPLICIT NULL} + +InitialSet::= SEQUENCE{ + g0 [0] IMPLICIT INTEGER OPTIONAL, + g1 [1] IMPLICIT INTEGER OPTIONAL, + -- one of g0 and g1 must be included + g2 [2] IMPLICIT INTEGER OPTIONAL, + g3 [3] IMPLICIT INTEGER OPTIONAL, + --g2 and/or g3 may be included + -- only if g1 was included + c0 [4] IMPLICIT INTEGER, + c1 [5] IMPLICIT INTEGER OPTIONAL} + +LeftAndRight ::= SEQUENCE{ + gLeft [3] IMPLICIT INTEGER{ + g0 (0), + g1 (1), + g2 (2), + g3 (3)}, + gRight [4] IMPLICIT INTEGER{ + g1 (1), + g2 (2), + g3 (3)} OPTIONAL} + +-- Definition of Iso10646 +-- +-- The 10646 object identifier looks like: +-- 1.0.10646.1.implementationLevel.repertoireSubset.arc1.arc2. .... +-- +-- (The second '1' is for "part 1" of 10646.) +-- +-- ImplementationLevel is 1-3 +-- +-- repertoireSubset is 0 or 1, for 'all' or 'collections'. +-- The arcs are present only if repertoireSubset is 'collections', +-- in which case arc1, arc2, etc., are the +-- identifiers of collections of character repertoires. +-- +-- There is a second 10646 oid, for specifying syntax/form: +-- 1.0.10646.1.0.form +-- +-- (The second '0' represents "transfer syntax".) +-- +-- where values of form include: +-- 2: ucs-2 +-- 4: ucs-4 +-- 5: utf-16 +-- 8: utf-8 + +Iso10646 ::= SEQUENCE{ + collections [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL, + --oid of form 1.0.10646.1.implementationLevel + -- .repertoireSubset.arc1.arc2. .... + -- Target to choose a subset of the collections + -- proposed by the origin, and an implementation level + -- less than or equal to that proposed. + -- + -- when 'collections' is omitted, + -- 'implementationLevel' defaults to 3. + -- + encodingLevel [2] IMPLICIT OBJECT IDENTIFIER + -- oid of form 1.0.10646.1.0.form + -- where value of 'form' is 2, 4, 5, or 8 + -- for ucs-2, ucs-4, utf-16, utf-8 + } +END + diff --git a/src/charneg.c b/src/charneg.c new file mode 100644 index 0000000..ebd10fc --- /dev/null +++ b/src/charneg.c @@ -0,0 +1,376 @@ +/* + $ $Id: charneg.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + * Helper functions for Character Set and Language Negotiation - 3 + */ + +#include +#include +#include +#include +#include + +static Z_External* z_ext_record2(ODR o, int oid_class, int oid_value, + const char *buf) +{ + Z_External *p; + oident oid; + int len = strlen(buf); + + if (!(p = (Z_External *)odr_malloc(o, sizeof(*p)))) return 0; + + p->descriptor = 0; + p->indirect_reference = 0; + + oid.proto = PROTO_Z3950; + oid.oclass = (enum oid_class) oid_class; + oid.value = (enum oid_value) oid_value; + p->direct_reference = odr_oiddup(o, oid_getoidbyent(&oid)); + + p->which = Z_External_octet; + if (!(p->u.octet_aligned = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct)))) { + return 0; + } + if (!(p->u.octet_aligned->buf = (unsigned char *)odr_malloc(o, len))) { + return 0; + } + p->u.octet_aligned->len = p->u.octet_aligned->size = len; + memcpy(p->u.octet_aligned->buf, buf, len); + + return p; +} + +static int get_form(const char *charset) +{ + int form = -1; + + + if (!yaz_matchstr(charset, "UCS-2")) + form = 2; + if (!yaz_matchstr(charset, "UCS-4")) + form = 4; + if (!yaz_matchstr(charset, "UTF-16")) + form = 5; + if (!yaz_matchstr(charset, "UTF-8")) + form = 8; + + return form; +} + +static char *set_form (Odr_oid *encoding) +{ + static char *charset = 0; + if ( oid_oidlen(encoding) != 6) + return 0; + if (encoding[5] == 2) + charset = "UCS-2"; + if (encoding[5] == 4) + charset = "UCS-4"; + if (encoding[5] == 5) + charset = "UTF-16"; + if (encoding[5] == 8) + charset = "UTF-8"; + return charset; +} + +static Z_OriginProposal_0 *z_get_OriginProposal_0(ODR o, const char *charset) +{ + int form = get_form (charset); + Z_OriginProposal_0 *p0 = + (Z_OriginProposal_0*)odr_malloc(o, sizeof(*p0)); + + memset(p0, 0, sizeof(*p0)); + + if (form > 0) + { /* ISO 10646 (UNICODE) */ + char oidname[20]; + + Z_Iso10646 *is = (Z_Iso10646 *) odr_malloc (o, sizeof(*is)); + p0->which = Z_OriginProposal_0_iso10646; + p0->u.iso10646 = is; + is->collections = 0; + sprintf (oidname, "1.0.10646.1.0.%d", form); + is->encodingLevel = odr_getoidbystr (o, oidname); + } + else + { /* private ones */ + Z_PrivateCharacterSet *pc = + (Z_PrivateCharacterSet *)odr_malloc(o, sizeof(*pc)); + + memset(pc, 0, sizeof(*pc)); + + p0->which = Z_OriginProposal_0_private; + p0->u.zprivate = pc; + + pc->which = Z_PrivateCharacterSet_externallySpecified; + pc->u.externallySpecified = + z_ext_record2(o, CLASS_NEGOT, VAL_ID_CHARSET, charset); + } + return p0; +} + +static Z_OriginProposal *z_get_OriginProposal( + ODR o, const char **charsets, int num_charsets, + const char **langs, int num_langs, int selected) +{ + int i; + Z_OriginProposal *p = (Z_OriginProposal *) odr_malloc(o, sizeof(*p)); + + memset(p, 0, sizeof(*p)); + + p->recordsInSelectedCharSets = (bool_t *)odr_malloc(o, sizeof(bool_t)); + *p->recordsInSelectedCharSets = (selected) ? 1:0; + + if (charsets && num_charsets) { + + p->num_proposedCharSets = num_charsets; + p->proposedCharSets = + (Z_OriginProposal_0**) + odr_malloc(o, num_charsets*sizeof(Z_OriginProposal_0*)); + + for (i = 0; iproposedCharSets[i] = + z_get_OriginProposal_0(o, charsets[i]); + } + if (langs && num_langs) { + + p->num_proposedlanguages = num_langs; + + p->proposedlanguages = + (char **) odr_malloc(o, num_langs*sizeof(char *)); + + for (i = 0; iproposedlanguages[i] = (char *)langs[i]; + + } + } + return p; +} + +static Z_CharSetandLanguageNegotiation *z_get_CharSetandLanguageNegotiation( + ODR o) +{ + Z_CharSetandLanguageNegotiation *p = + (Z_CharSetandLanguageNegotiation *) odr_malloc(o, sizeof(*p)); + + memset(p, 0, sizeof(*p)); + + return p; +} + +/* Create EXTERNAL for negotation proposal. Client side */ +Z_External *yaz_set_proposal_charneg(ODR o, + const char **charsets, int num_charsets, + const char **langs, int num_langs, + int selected) +{ + Z_External *p = (Z_External *)odr_malloc(o, sizeof(*p)); + oident oid; + + p->descriptor = 0; + p->indirect_reference = 0; + + oid.proto = PROTO_Z3950; + oid.oclass = CLASS_NEGOT; + oid.value = VAL_CHARNEG3; + p->direct_reference = odr_oiddup(o, oid_getoidbyent(&oid)); + + p->which = Z_External_charSetandLanguageNegotiation; + p->u.charNeg3 = z_get_CharSetandLanguageNegotiation(o); + p->u.charNeg3->which = Z_CharSetandLanguageNegotiation_proposal; + p->u.charNeg3->u.proposal = + z_get_OriginProposal(o, charsets, num_charsets, + langs, num_langs, selected); + + return p; +} + +/* used by yaz_set_response_charneg */ +static Z_TargetResponse *z_get_TargetResponse(ODR o, const char *charset, + const char *lang, int selected) +{ + Z_TargetResponse *p = (Z_TargetResponse *) odr_malloc(o, sizeof(*p)); + int form = get_form(charset); + + memset(p, 0, sizeof(*p)); + + if (form > 0) + { + char oidname[20]; + + Z_Iso10646 *is = (Z_Iso10646 *) odr_malloc (o, sizeof(*is)); + p->which = Z_TargetResponse_iso10646; + p->u.iso10646 = is; + is->collections = 0; + sprintf (oidname, "1.0.10646.1.0.%d", form); + is->encodingLevel = odr_getoidbystr (o, oidname); + } + else + { + Z_PrivateCharacterSet *pc = + (Z_PrivateCharacterSet *)odr_malloc(o, sizeof(*pc)); + + memset(pc, 0, sizeof(*pc)); + + p->which = Z_TargetResponse_private; + p->u.zprivate = pc; + + pc->which = Z_PrivateCharacterSet_externallySpecified; + pc->u.externallySpecified = + z_ext_record2(o, CLASS_NEGOT, VAL_ID_CHARSET, charset); + } + p->recordsInSelectedCharSets = (bool_t *)odr_malloc(o, sizeof(bool_t)); + *p->recordsInSelectedCharSets = (selected) ? 1:0; + + p->selectedLanguage = lang ? (char *)odr_strdup(o, lang) : 0; + return p; +} + +/* Create charset response. Server side */ +Z_External *yaz_set_response_charneg(ODR o, const char *charset, + const char *lang, int selected) +{ + Z_External *p = (Z_External *)odr_malloc(o, sizeof(*p)); + oident oid; + + p->descriptor = 0; + p->indirect_reference = 0; + + oid.proto = PROTO_Z3950; + oid.oclass = CLASS_NEGOT; + oid.value = VAL_CHARNEG3; + p->direct_reference = odr_oiddup(o, oid_getoidbyent(&oid)); + + p->which = Z_External_charSetandLanguageNegotiation; + p->u.charNeg3 = z_get_CharSetandLanguageNegotiation(o); + p->u.charNeg3->which = Z_CharSetandLanguageNegotiation_response; + p->u.charNeg3->u.response = z_get_TargetResponse(o, charset, lang, selected); + + return p; +} + +/* Get negotiation from OtherInformation. Client&Server side */ +Z_CharSetandLanguageNegotiation *yaz_get_charneg_record(Z_OtherInformation *p) +{ + Z_External *pext; + int i; + + if(!p) + return 0; + + for (i=0; inum_elements; i++) { + + if ((p->list[i]->which == Z_OtherInfo_externallyDefinedInfo) && + (pext = p->list[i]->information.externallyDefinedInfo)) { + + oident *ent = oid_getentbyoid(pext->direct_reference); + + if (ent && ent->value == VAL_CHARNEG3 && ent->oclass == CLASS_NEGOT && + pext->which == Z_External_charSetandLanguageNegotiation) { + + return pext->u.charNeg3; + } + } + } + return 0; +} + +/* Get charsets, langs, selected from negotiation.. Server side */ +void yaz_get_proposal_charneg(NMEM mem, Z_CharSetandLanguageNegotiation *p, + char ***charsets, int *num_charsets, + char ***langs, int *num_langs, int *selected) +{ + int i; + Z_OriginProposal *pro = p->u.proposal; + + if (num_charsets && charsets) + { + if (pro->num_proposedCharSets) + { + *num_charsets = pro->num_proposedCharSets; + + (*charsets) = (char **) + nmem_malloc(mem, pro->num_proposedCharSets * sizeof(char *)); + + for (i=0; inum_proposedCharSets; i++) + { + (*charsets)[i] = 0; + + if (pro->proposedCharSets[i]->which == + Z_OriginProposal_0_private && + pro->proposedCharSets[i]->u.zprivate->which == + Z_PrivateCharacterSet_externallySpecified) { + + Z_External *pext = + pro->proposedCharSets[i]->u.zprivate->u.externallySpecified; + + if (pext->which == Z_External_octet) { + + (*charsets)[i] = (char *) + nmem_malloc(mem, (1+pext->u.octet_aligned->len) * + sizeof(char)); + + memcpy ((*charsets)[i], pext->u.octet_aligned->buf, + pext->u.octet_aligned->len); + (*charsets)[i][pext->u.octet_aligned->len] = 0; + + } + } + else if (pro->proposedCharSets[i]->which == + Z_OriginProposal_0_iso10646) + (*charsets)[i] = set_form ( + pro->proposedCharSets[i]->u.iso10646->encodingLevel); + } + } + else + *num_charsets = 0; + } + + if (langs && num_langs) + { + if (pro->num_proposedlanguages) + { + *num_langs = pro->num_proposedlanguages; + + (*langs) = (char **) + nmem_malloc(mem, pro->num_proposedlanguages * sizeof(char *)); + + for (i=0; inum_proposedlanguages; i++) + (*langs)[i] = nmem_strdup(mem, pro->proposedlanguages[i]); + } + else + *num_langs = 0; + } + + if(pro->recordsInSelectedCharSets && selected) + *selected = *pro->recordsInSelectedCharSets; +} + +/* Return charset, lang, selected from negotiation.. Client side */ +void yaz_get_response_charneg(NMEM mem, Z_CharSetandLanguageNegotiation *p, + char **charset, char **lang, int *selected) +{ + Z_TargetResponse *res = p->u.response; + + if (charset && res->which == Z_TargetResponse_private && + res->u.zprivate->which == Z_PrivateCharacterSet_externallySpecified) { + + Z_External *pext = res->u.zprivate->u.externallySpecified; + + if (pext->which == Z_External_octet) { + + *charset = (char *) + nmem_malloc(mem, (1+pext->u.octet_aligned->len)*sizeof(char)); + memcpy (*charset, pext->u.octet_aligned->buf, + pext->u.octet_aligned->len); + (*charset)[pext->u.octet_aligned->len] = 0; + } + } + if (charset && res->which == Z_TargetResponse_iso10646) + *charset = set_form (res->u.iso10646->encodingLevel); + if (lang && res->selectedLanguage) + *lang = nmem_strdup (mem, res->selectedLanguage); + + if(selected && res->recordsInSelectedCharSets) + *selected = *res->recordsInSelectedCharSets; +} diff --git a/src/comstack.c b/src/comstack.c new file mode 100644 index 0000000..4d842f7 --- /dev/null +++ b/src/comstack.c @@ -0,0 +1,247 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * + * $Id: comstack.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ + +#include +#include + +#include +#include +#include +#include + +static const char *cs_errlist[] = +{ + "No error or unspecified error", + "System (lower-layer) error", + "Operation out of state", + "No data (operation would block)", + "New data while half of old buffer is on the line (flow control)", + "Permission denied", + "SSL error" +}; + +const char *cs_errmsg(int n) +{ + if (n < 0 || n > 6) + n = 0; + return cs_errlist[n]; +} + +const char *cs_strerror(COMSTACK h) +{ + return cs_errmsg(h->cerrno); +} + +void cs_get_host_args(const char *type_and_host, const char **args) +{ + + *args = ""; + if (*type_and_host && strncmp(type_and_host, "unix:", 5)) + { + const char *cp; + cp = strstr(type_and_host, "://"); + if (cp) + cp = cp+3; + else + cp = type_and_host; + cp = strchr(cp, '/'); + if (cp) + *args = cp+1; + } +} + +COMSTACK cs_create_host(const char *type_and_host, int blocking, void **vp) +{ + enum oid_proto proto = PROTO_Z3950; + const char *host = 0; + COMSTACK cs; + CS_TYPE t; + + if (strncmp (type_and_host, "tcp:", 4) == 0) + { + t = tcpip_type; + host = type_and_host + 4; + } + else if (strncmp (type_and_host, "ssl:", 4) == 0) + { +#if HAVE_OPENSSL_SSL_H + t = ssl_type; + host = type_and_host + 4; +#else + return 0; +#endif + } + else if (strncmp (type_and_host, "unix:", 5) == 0) + { +#ifndef WIN32 + t = unix_type; + host = type_and_host + 5; +#else + return 0; +#endif + } + else if (strncmp(type_and_host, "http:", 5) == 0) + { + t = tcpip_type; + host = type_and_host + 5; + if (host[0] == '/' && host[1] == '/') + host = host + 2; + proto = PROTO_HTTP; + } + else if (strncmp(type_and_host, "https:", 6) == 0) + { +#if HAVE_OPENSSL_SSL_H + t = ssl_type; + host = type_and_host + 6; + if (host[0] == '/' && host[1] == '/') + host = host + 2; + proto = PROTO_HTTP; +#else + return 0; +#endif + } + else + { + t = tcpip_type; + host = type_and_host; + + } + cs = cs_create (t, blocking, proto); + if (!cs) + return 0; + + if (!(*vp = cs_straddr(cs, host))) + { + cs_close (cs); + return 0; + } + return cs; +} + +int cs_look (COMSTACK cs) +{ + return cs->event; +} + +int cs_complete_auto(const unsigned char *buf, int len) +{ + if (len > 5 && buf[0] >= 0x20 && buf[0] < 0x7f + && buf[1] >= 0x20 && buf[1] < 0x7f + && buf[2] >= 0x20 && buf[2] < 0x7f) + { + /* deal with HTTP request/response */ + int i = 2, content_len = 0, chunked = 0; + + while (i <= len-4) + { + if (i > 8192) + return i; /* do not allow more than 8K HTTP header */ + if (buf[i] == '\r' && buf[i+1] == '\n') + { + i += 2; + if (buf[i] == '\r' && buf[i+1] == '\n') + { + if (chunked) + { + while(1) + { + int chunk_len = 0; + i += 2; +#if 0 +/* debugging */ + if (i >>"); + for (j = i; j <= i+4; j++) + printf ("%c", buf[j]); + printf ("<<<\n"); + } +#endif + while (1) + if (i >= len-2) { +#if 0 +/* debugging */ + printf ("XXXXXXXX not there yet 1\n"); + printf ("i=%d len=%d\n", i, len); +#endif + return 0; + } else if (isdigit(buf[i])) + chunk_len = chunk_len * 16 + + (buf[i++] - '0'); + else if (isupper(buf[i])) + chunk_len = chunk_len * 16 + + (buf[i++] - ('A'-10)); + else if (islower(buf[i])) + chunk_len = chunk_len * 16 + + (buf[i++] - ('a'-10)); + else + break; + if (buf[i] != '\r' || buf[i+1] != '\n' || + chunk_len < 0) + return i+2; /* bad. stop now */ + if (chunk_len == 0) + { + /* consider trailing headers .. */ + while(i <= len-4) + { + if (buf[i] == '\r' && buf[i+1] == '\n' && + buf[i+2] == '\r' && buf[i+3] == '\n') + if (len >= i+4) + return i+4; + i++; + } +#if 0 +/* debugging */ + printf ("XXXXXXXXX not there yet 2\n"); + printf ("i=%d len=%d\n", i, len); +#endif + return 0; + } + i += chunk_len+2; + } + } + else + { /* not chunked ; inside body */ + /* i += 2 seems not to work with GCC -O2 .. + so i+2 is used instead .. */ + if (len >= (i+2)+ content_len) + return (i+2)+ content_len; + } + break; + } + else if (i < len - 21 && + !memcmp(buf+i, "Transfer-Encoding: ", 18)) + { + i+=18; + if (buf[i] == ' ') + i++; + if (i < len - 8) + if (!memcmp(buf+i, "chunked", 7)) + chunked = 1; + } + else if (i < len - 18 && + !memcmp(buf+i, "Content-Length: ", 15)) + { + i+= 15; + if (buf[i] == ' ') + i++; + content_len = 0; + while (i <= len-4 && isdigit(buf[i])) + content_len = content_len*10 + (buf[i++] - '0'); + if (content_len < 0) /* prevent negative offsets */ + content_len = 0; + } + else + i++; + } + else + i++; + } + return 0; + } + return completeBER(buf, len); +} diff --git a/src/cql.y b/src/cql.y new file mode 100644 index 0000000..c98696d --- /dev/null +++ b/src/cql.y @@ -0,0 +1,275 @@ +/* $Id: cql.y,v 1.1 2003-10-27 12:21:30 adam Exp $ + Copyright (C) 2002-2003 + Index Data Aps + +This file is part of the YAZ toolkit. + +See the file LICENSE. + + bison parser for CQL grammar. +*/ +%{ +#include +#include +#include +#include +#include +#include + + typedef struct { + struct cql_node *rel; + struct cql_node *cql; + char *buf; + size_t len; + size_t size; + } token; + + struct cql_parser { + int (*getbyte)(void *client_data); + void (*ungetbyte)(int b, void *client_data); + void *client_data; + int last_error; + int last_pos; + struct cql_node *top; + NMEM nmem; + }; + +#define YYSTYPE token + +#define YYPARSE_PARAM parm +#define YYLEX_PARAM parm + + int yylex(YYSTYPE *lval, void *vp); + int yyerror(char *s); +%} + +%pure_parser +%token TERM AND OR NOT PROX GE LE NE +%expect 8 + +%% + +top: { + $$.rel = cql_node_mk_sc("srw.serverChoice", "scr", 0); + ((CQL_parser) parm)->top = 0; +} cqlQuery1 { + cql_node_destroy($$.rel); + ((CQL_parser) parm)->top = $2.cql; +} +; + +cqlQuery1: cqlQuery +| cqlQuery error { + cql_node_destroy($1.cql); + $$.cql = 0; +} +; + +cqlQuery: + searchClause +| + cqlQuery boolean { + $$.rel = $0.rel; + } searchClause { + struct cql_node *cn = cql_node_mk_boolean($2.buf); + + cn->u.boolean.modifiers = $2.rel; + cn->u.boolean.left = $1.cql; + cn->u.boolean.right = $4.cql; + + $$.cql = cn; + } +; + +searchClause: + '(' { + $$.rel = $0.rel; + + } cqlQuery ')' { + $$.cql = $3.cql; + } +| + searchTerm { + struct cql_node *st = cql_node_dup ($0.rel); + st->u.st.term = strdup($1.buf); + $$.cql = st; + } +| + index relation { + $$.rel = $2.rel; + $$.rel->u.st.index = strdup($1.buf); + } searchClause { + $$.cql = $4.cql; + cql_node_destroy($2.rel); + } +| '>' searchTerm '=' searchTerm { + $$.rel = $0.rel; + } cqlQuery { + $$.cql = cql_node_prefix($6.cql, $2.buf, $4.buf); + } +| '>' searchTerm { + $$.rel = $0.rel; + } cqlQuery { + $$.cql = cql_node_prefix($4.cql, 0, $2.buf); + } +; + +/* unary NOT search TERM here .. */ + +boolean: + AND | OR | NOT | PROX proxqualifiers { + $$ = $1; + $$.rel = $2.rel; + } + ; + +proxqualifiers: + Prelation { + $$.rel = cql_node_mk_proxargs ($1.buf, 0, 0, 0); + } +| + PrelationO Pdistance { + $$.rel = cql_node_mk_proxargs ($1.buf, $2.buf, 0, 0); + } +| + PrelationO PdistanceO Punit { + $$.rel = cql_node_mk_proxargs ($1.buf, $2.buf, $3.buf, 0); + } +| + PrelationO PdistanceO PunitO Pordering { + $$.rel = cql_node_mk_proxargs ($1.buf, $2.buf, $3.buf, $4.buf); + } +| +{ $$.rel = 0; } +; + +Punit: '/' searchTerm { + $$ = $2; + } +; + +PunitO: '/' searchTerm { + $$ = $2; + } +| +'/' { $$.buf[0] = 0; } +; +Prelation: '/' baseRelation { + $$ = $2; +} +; +PrelationO: '/' baseRelation { + $$ = $2; +} +| '/' { $$.buf[0] = 0; } +; +Pdistance: '/' searchTerm { + $$ = $2; +} +; + +PdistanceO: '/' searchTerm { + $$ = $2; +} +| '/' { $$.buf[0] = 0; } +; +Pordering: '/' searchTerm { + $$ = $2; +} +; + +relation: baseRelation modifiers { + struct cql_node *st = cql_node_mk_sc(/* index */ 0, + /* relation */ $1.buf, + /* term */ 0); + + st->u.st.modifiers = $2.cql; + $$.rel = st; +} +; + +modifiers: '/' searchTerm modifiers +{ + struct cql_node *mod = cql_node_mk_mod(0, $2.buf); + + mod->u.mod.next = $3.cql; + $$.cql = mod; +} +| +{ + $$.cql = 0; +} +; + +baseRelation: + '=' +| '>' +| '<' +| GE +| LE +| NE +| TERM +; + +index: + searchTerm; + +searchTerm: + TERM +| AND +| OR +| NOT +| PROX +; + +%% + +int yyerror(char *s) +{ + return 0; +} + +#include "lexer.h" + + +int cql_parser_stream(CQL_parser cp, + int (*getbyte)(void *client_data), + void (*ungetbyte)(int b, void *client_data), + void *client_data) +{ + cp->getbyte = getbyte; + cp->ungetbyte = ungetbyte; + cp->client_data = client_data; + if (cp->top) + cql_node_destroy(cp->top); + cql_parse(cp); + if (cp->top) + return 0; + return -1; +} + +CQL_parser cql_parser_create(void) +{ + CQL_parser cp = (CQL_parser) malloc (sizeof(*cp)); + + cp->top = 0; + cp->getbyte = 0; + cp->ungetbyte = 0; + cp->client_data = 0; + cp->last_error = 0; + cp->last_pos = 0; + cp->nmem = nmem_create(); + return cp; +} + +void cql_parser_destroy(CQL_parser cp) +{ + cql_node_destroy(cp->top); + nmem_destroy(cp->nmem); + free (cp); +} + +struct cql_node *cql_parser_result(CQL_parser cp) +{ + return cp->top; +} diff --git a/src/cqlstdio.c b/src/cqlstdio.c new file mode 100644 index 0000000..c9d50ff --- /dev/null +++ b/src/cqlstdio.c @@ -0,0 +1,36 @@ +/* $Id: cqlstdio.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + Copyright (C) 2002-2003 + Index Data Aps + +This file is part of the YAZ toolkit. + +See the file LICENSE. +*/ + +#include + +int getbyte_stream(void *client_data) +{ + FILE *f = (FILE*) client_data; + + int c = fgetc(f); + if (c == EOF) + return 0; + return c; +} + +void ungetbyte_stream (int c, void *client_data) +{ + FILE *f = (FILE*) client_data; + + if (c == 0) + c = EOF; + ungetc(c, f); +} + +int cql_parser_stdio(CQL_parser cp, FILE *f) +{ + return cql_parser_stream(cp, getbyte_stream, ungetbyte_stream, f); +} + + diff --git a/src/cqlstrer.c b/src/cqlstrer.c new file mode 100644 index 0000000..f8b29ce --- /dev/null +++ b/src/cqlstrer.c @@ -0,0 +1,61 @@ +/* $Id: cqlstrer.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + Copyright (C) 2002-2003 + Index Data Aps + +This file is part of the YAZ toolkit. + +See the file LICENSE. +*/ + +#include + +/* + * The error-messages associated with these codes are taken from + * the SRW diagnostic specifications at + * http://www.loc.gov/srw/diagnostic-list.html + */ +const char *cql_strerror(int code) { + static char buf[80]; + switch (code) { + case 10: return "Illegal query"; + case 11: return "Unsupported query type (XCQL vs CQL)"; + case 12: return "Too many characters in query"; + case 13: return "Unbalanced or illegal use of parentheses"; + case 14: return "Unbalanced or illegal use of quotes"; + case 15: return "Illegal or unsupported index set"; + case 16: return "Illegal or unsupported index"; + case 17: return "Illegal or unsupported combination of index and index set"; + case 18: return "Illegal or unsupported combination of indexes"; + case 19: return "Illegal or unsupported relation"; + case 20: return "Illegal or unsupported relation modifier"; + case 21: return "Illegal or unsupported combination of relation modifers"; + case 22: return "Illegal or unsupported combination of relation and index"; + case 23: return "Too many characters in term"; + case 24: return "Illegal combination of relation and term"; + case 25: return "Special characters not quoted in term"; + case 26: return "Non special character escaped in term"; + case 27: return "Empty term unsupported"; + case 28: return "Masking character not supported"; + case 29: return "Masked words too short"; + case 30: return "Too many masking characters in term"; + case 31: return "Anchoring character not supported"; + case 32: return "Anchoring character in illegal or unsupported position"; + case 33: return "Combination of proximity/adjacency and masking characters not supported"; + case 34: return "Combination of proximity/adjacency and anchoring characters not supported"; + case 35: return "Terms only exclusion (stop) words"; + case 36: return "Term in invalid format for index or relation"; + case 37: return "Illegal or unsupported boolean operator"; + case 38: return "Too many boolean operators in query"; + case 39: return "Proximity not supported"; + case 40: return "Illegal or unsupported proximity relation"; + case 41: return "Illegal or unsupported proximity distance"; + case 42: return "Illegal or unsupported proximity unit"; + case 43: return "Illegal or unsupported proximity ordering"; + case 44: return "Illegal or unsupported combination of proximity modifiers"; + case 45: return "Index set name (prefix) assigned to multiple identifiers"; + default: break; + } + + sprintf(buf, "Unknown CQL error #%d", code); + return buf; +} diff --git a/src/cqlstring.c b/src/cqlstring.c new file mode 100644 index 0000000..bf18b07 --- /dev/null +++ b/src/cqlstring.c @@ -0,0 +1,40 @@ +/* $Id: cqlstring.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + Copyright (C) 2002-2003 + Index Data Aps + +This file is part of the YAZ toolkit. + +See the file LICENSE for details. +*/ +#include + +struct cql_buf_info { + const char *str; + int off; +}; + +int getbuf(void *vp) +{ + struct cql_buf_info *bi = (struct cql_buf_info *) vp; + if (bi->str[bi->off] == 0) + return 0; + return bi->str[bi->off++]; +} + +void ungetbuf(int b, void *vp) +{ + struct cql_buf_info *bi = (struct cql_buf_info *) vp; + if (b) + (bi->off--); +} + +int cql_parser_string(CQL_parser cp, const char *str) +{ + struct cql_buf_info b; + + b.str = str; + b.off = 0; + + return cql_parser_stream(cp, getbuf, ungetbuf, &b); +} + diff --git a/src/cqltransform.c b/src/cqltransform.c new file mode 100644 index 0000000..3f6586a --- /dev/null +++ b/src/cqltransform.c @@ -0,0 +1,469 @@ +/* $Id: cqltransform.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + Copyright (C) 2002-2003 + Index Data Aps + +This file is part of the YAZ toolkit. + +See the file LICENSE. +*/ + +#include +#include +#include + +struct cql_prop_entry { + char *pattern; + char *value; + struct cql_prop_entry *next; +}; + +struct cql_transform_t_ { + struct cql_prop_entry *entry; + int error; + char *addinfo; +}; + +cql_transform_t cql_transform_open_FILE(FILE *f) +{ + char line[1024]; + cql_transform_t ct = (cql_transform_t) malloc (sizeof(*ct)); + struct cql_prop_entry **pp = &ct->entry; + + ct->error = 0; + ct->addinfo = 0; + while (fgets(line, sizeof(line)-1, f)) + { + const char *cp_value_start; + const char *cp_value_end; + const char *cp_pattern_end; + const char *cp = line; + while (*cp && !strchr(" \t=\r\n#", *cp)) + cp++; + cp_pattern_end = cp; + if (cp == line) + continue; + while (*cp && strchr(" \t\r\n", *cp)) + cp++; + if (*cp != '=') + continue; + cp++; + while (*cp && strchr(" \t\r\n", *cp)) + cp++; + cp_value_start = cp; + if (!(cp_value_end = strchr(cp, '#'))) + cp_value_end = strlen(line) + line; + + if (cp_value_end != cp_value_start && + strchr(" \t\r\n", cp_value_end[-1])) + cp_value_end--; + *pp = (struct cql_prop_entry *) malloc (sizeof(**pp)); + (*pp)->pattern = (char *) malloc (cp_pattern_end - line + 1); + memcpy ((*pp)->pattern, line, cp_pattern_end - line); + (*pp)->pattern[cp_pattern_end-line] = 0; + + (*pp)->value = (char *) malloc (cp_value_end - cp_value_start + 1); + if (cp_value_start != cp_value_end) + memcpy ((*pp)->value, cp_value_start, cp_value_end-cp_value_start); + (*pp)->value[cp_value_end - cp_value_start] = 0; + pp = &(*pp)->next; + } + *pp = 0; + return ct; +} + +void cql_transform_close(cql_transform_t ct) +{ + struct cql_prop_entry *pe; + if (!ct) + return; + pe = ct->entry; + while (pe) + { + struct cql_prop_entry *pe_next = pe->next; + free (pe->pattern); + free (pe->value); + free (pe); + pe = pe_next; + } + if (ct->addinfo) + free (ct->addinfo); + free (ct); +} + +cql_transform_t cql_transform_open_fname(const char *fname) +{ + cql_transform_t ct; + FILE *f = fopen(fname, "r"); + if (!f) + return 0; + ct = cql_transform_open_FILE(f); + fclose(f); + return ct; +} + +static const char *cql_lookup_property(cql_transform_t ct, + const char *pat1, const char *pat2) +{ + char pattern[80]; + struct cql_prop_entry *e; + + if (pat2) + sprintf (pattern, "%.39s%.39s", pat1, pat2); + else + sprintf (pattern, "%.39s", pat1); + for (e = ct->entry; e; e = e->next) + { + if (!strcmp(e->pattern, pattern)) + return e->value; + } + return 0; +} + +static const char *cql_lookup_value(cql_transform_t ct, + const char *prefix, + const char *value) +{ + struct cql_prop_entry *e; + int len = strlen(prefix); + + for (e = ct->entry; e; e = e->next) + { + if (!memcmp(e->pattern, prefix, len) && !strcmp(e->value, value)) + return e->pattern + len; + } + return 0; +} + + +int cql_pr_attr(cql_transform_t ct, const char *category, + const char *val, + const char *default_val, + void (*pr)(const char *buf, void *client_data), + void *client_data, + int errcode) +{ + const char *res; + res = cql_lookup_property(ct, category, val ? val : default_val); + if (!res) + res = cql_lookup_property(ct, category, "*"); + if (res) + { + char buf[64]; + + const char *cp0 = res, *cp1; + while ((cp1 = strchr(cp0, '='))) + { + while (*cp1 && *cp1 != ' ') + cp1++; + if (cp1 - cp0 >= sizeof(buf)) + break; + memcpy (buf, cp0, cp1 - cp0); + buf[cp1-cp0] = 0; + (*pr)("@attr ", client_data); + (*pr)(buf, client_data); + (*pr)(" ", client_data); + cp0 = cp1; + while (*cp0 == ' ') + cp0++; + } + return 1; + } + /* error ... */ + if (errcode && !ct->error) + { + ct->error = errcode; + ct->addinfo = strdup(val); + } + return 0; +} + +void emit_term(cql_transform_t ct, + const char *term, int length, + void (*pr)(const char *buf, void *client_data), + void *client_data) +{ + int i; + if (length > 0) + { + if (length > 1 && term[0] == '^' && term[length-1] == '^') + { + cql_pr_attr(ct, "position.", "firstAndLast", 0, + pr, client_data, 32); + term++; + length -= 2; + } + else if (term[0] == '^') + { + cql_pr_attr(ct, "position.", "first", 0, + pr, client_data, 32); + term++; + } + else if (term[length-1] == '^') + { + cql_pr_attr(ct, "position.", "last", 0, + pr, client_data, 32); + length--; + } + else + { + cql_pr_attr(ct, "position.", "any", 0, + pr, client_data, 32); + } + } + (*pr)("\"", client_data); + for (i = 0; iu.st.term; + const char *cp1; + const char *last_term = 0; + int last_length = 0; + while(cp0) + { + while (*cp0 == ' ') + cp0++; + cp1 = strchr(cp0, ' '); + if (last_term) + { + (*pr)("@", client_data); + (*pr)(op, client_data); + (*pr)(" ", client_data); + emit_term(ct, last_term, last_length, pr, client_data); + } + last_term = cp0; + if (cp1) + last_length = cp1 - cp0; + else + last_length = strlen(cp0); + cp0 = cp1; + } + if (last_term) + emit_term(ct, last_term, last_length, pr, client_data); +} + + +static const char *cql_get_ns(cql_transform_t ct, + struct cql_node *cn, + struct cql_node **prefix_ar, int prefix_level, + const char **n_prefix, + const char **n_suffix) +{ + int i; + const char *ns = 0; + char prefix[32]; + const char *cp = cn->u.st.index; + const char *cp_dot = strchr(cp, '.'); + + /* strz current prefix (empty if not given) */ + if (cp_dot && cp_dot-cp < sizeof(prefix)) + { + memcpy (prefix, cp, cp_dot - cp); + prefix[cp_dot - cp] = 0; + } + else + *prefix = 0; + + /* 2. lookup in prefix_ar. and return NS */ + for (i = prefix_level; !ns && --i >= 0; ) + { + struct cql_node *cn_prefix = prefix_ar[i]; + for (; cn_prefix; cn_prefix = cn_prefix->u.mod.next) + { + if (*prefix && cn_prefix->u.mod.name && + !strcmp(prefix, cn_prefix->u.mod.name)) + { + ns = cn_prefix->u.mod.value; + break; + } + else if (!*prefix && !cn_prefix->u.mod.name) + { + ns = cn_prefix->u.mod.value; + break; + } + } + } + if (!ns) + { + if (!ct->error) + { + ct->error = 15; + ct->addinfo = strdup(prefix); + } + return 0; + } + /* 3. lookup in set.NS for new prefix */ + *n_prefix = cql_lookup_value(ct, "set.", ns); + if (!*n_prefix) + { + if (!ct->error) + { + ct->error = 15; + ct->addinfo = strdup(ns); + } + return 0; + } + /* 4. lookup qualifier.prefix. */ + + cp = cn->u.st.index; + cp_dot = strchr(cp, '.'); + + *n_suffix = cp_dot ? cp_dot+1 : cp; + return ns; +} + +void cql_transform_r(cql_transform_t ct, + struct cql_node *cn, + void (*pr)(const char *buf, void *client_data), + void *client_data, + struct cql_node **prefix_ar, int prefix_level) +{ + const char *ns, *n_prefix, *n_suffix; + + if (!cn) + return; + switch (cn->which) + { + case CQL_NODE_ST: + if (cn->u.st.prefixes && prefix_level < 20) + prefix_ar[prefix_level++] = cn->u.st.prefixes; + ns = cql_get_ns(ct, cn, prefix_ar, prefix_level, &n_prefix, &n_suffix); + if (ns) + { + char n_full[64]; + sprintf (n_full, "%.20s.%.40s", n_prefix, n_suffix); + + if (!strcmp(ns, "http://www.loc.gov/zing/cql/srw-indexes/v1.0/") + && !strcmp(n_suffix, "resultSet")) + { + (*pr)("@set \"", client_data); + (*pr)(cn->u.st.term, client_data); + (*pr)("\" ", client_data); + return ; + } + cql_pr_attr(ct, "qualifier.", n_full, "srw.serverChoice", + pr, client_data, 16); + } + + if (cn->u.st.relation && !strcmp(cn->u.st.relation, "=")) + cql_pr_attr(ct, "relation.", "eq", "scr", + pr, client_data, 19); + else if (cn->u.st.relation && !strcmp(cn->u.st.relation, "<=")) + cql_pr_attr(ct, "relation.", "le", "scr", + pr, client_data, 19); + else if (cn->u.st.relation && !strcmp(cn->u.st.relation, ">=")) + cql_pr_attr(ct, "relation.", "ge", "scr", + pr, client_data, 19); + else + cql_pr_attr(ct, "relation.", cn->u.st.relation, "eq", + pr, client_data, 19); + if (cn->u.st.modifiers) + { + struct cql_node *mod = cn->u.st.modifiers; + for (; mod; mod = mod->u.mod.next) + { + cql_pr_attr(ct, "relationModifier.", mod->u.mod.value, 0, + pr, client_data, 20); + } + } + cql_pr_attr(ct, "structure.", cn->u.st.relation, 0, + pr, client_data, 24); + if (cn->u.st.relation && !strcmp(cn->u.st.relation, "all")) + { + emit_wordlist(ct, cn, pr, client_data, "and"); + } + else if (cn->u.st.relation && !strcmp(cn->u.st.relation, "any")) + { + emit_wordlist(ct, cn, pr, client_data, "or"); + } + else + { + emit_term(ct, cn->u.st.term, strlen(cn->u.st.term), + pr, client_data); + } + break; + case CQL_NODE_BOOL: + if (cn->u.boolean.prefixes && prefix_level < 20) + prefix_ar[prefix_level++] = cn->u.boolean.prefixes; + (*pr)("@", client_data); + (*pr)(cn->u.boolean.value, client_data); + (*pr)(" ", client_data); + + cql_transform_r(ct, cn->u.boolean.left, pr, client_data, + prefix_ar, prefix_level); + cql_transform_r(ct, cn->u.boolean.right, pr, client_data, + prefix_ar, prefix_level); + } +} + +int cql_transform(cql_transform_t ct, + struct cql_node *cn, + void (*pr)(const char *buf, void *client_data), + void *client_data) +{ + struct cql_node *prefix_ar[20], **pp; + struct cql_prop_entry *e; + + ct->error = 0; + if (ct->addinfo) + free (ct->addinfo); + ct->addinfo = 0; + + prefix_ar[0] = 0; + pp = &prefix_ar[0]; + for (e = ct->entry; e ; e = e->next) + { + if (!memcmp(e->pattern, "set.", 4)) + { + *pp = cql_node_mk_mod(e->pattern+4, e->value); + pp = &(*pp)->u.mod.next; + } + else if (!strcmp(e->pattern, "set")) + { + *pp = cql_node_mk_mod(0, e->value); + pp = &(*pp)->u.mod.next; + } + } + cql_transform_r (ct, cn, pr, client_data, prefix_ar, 1); + cql_node_destroy(prefix_ar[0]); + return ct->error; +} + + +int cql_transform_FILE(cql_transform_t ct, struct cql_node *cn, FILE *f) +{ + return cql_transform(ct, cn, cql_fputs, f); +} + +int cql_transform_buf(cql_transform_t ct, struct cql_node *cn, + char *out, int max) +{ + struct cql_buf_write_info info; + int r; + + info.off = 0; + info.max = max; + info.buf = out; + r = cql_transform(ct, cn, cql_buf_write_handler, &info); + if (info.off >= 0) + info.buf[info.off] = '\0'; + return r; +} + +int cql_transform_error(cql_transform_t ct, const char **addinfo) +{ + *addinfo = ct->addinfo; + return ct->error; +} diff --git a/src/cqlutil.c b/src/cqlutil.c new file mode 100644 index 0000000..baa54ad --- /dev/null +++ b/src/cqlutil.c @@ -0,0 +1,177 @@ +/* $Id: cqlutil.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + Copyright (C) 2002-2003 + Index Data Aps + +This file is part of the YAZ toolkit. + +See the file LICENSE. +*/ + +#include +#include + +#include + +void cql_fputs(const char *buf, void *client_data) +{ + FILE *f = (FILE *) client_data; + fputs(buf, f); +} + +struct cql_node *cql_node_dup (struct cql_node *cp) +{ + struct cql_node *cn = 0; + + if (!cp) + return 0; + switch (cp->which) + { + case CQL_NODE_ST: + cn = cql_node_mk_sc(cp->u.st.index, + cp->u.st.relation, + cp->u.st.term); + cn->u.st.modifiers = cql_node_dup(cp->u.st.modifiers); + cn->u.st.prefixes = cql_node_dup(cp->u.st.prefixes); + break; + case CQL_NODE_MOD: + cn = cql_node_mk_mod(cp->u.mod.name, + cp->u.mod.value); + cn->u.mod.next = cql_node_dup(cp->u.mod.next); + break; + case CQL_NODE_BOOL: + cn = cql_node_mk_boolean(cp->u.boolean.value); + cn->u.boolean.left = cql_node_dup(cp->u.boolean.left); + cn->u.boolean.right = cql_node_dup(cp->u.boolean.right); + cn->u.boolean.prefixes = cql_node_dup(cp->u.boolean.prefixes); + } + return cn; +} + +struct cql_node *cql_node_mk_sc(const char *index, + const char *relation, + const char *term) +{ + struct cql_node *p = (struct cql_node *) malloc(sizeof(*p)); + p->which = CQL_NODE_ST; + p->u.st.index = 0; + if (index) + p->u.st.index = strdup(index); + p->u.st.term = 0; + if (term) + p->u.st.term = strdup(term); + p->u.st.relation = 0; + if (relation) + p->u.st.relation = strdup(relation); + p->u.st.modifiers = 0; + p->u.st.prefixes = 0; + return p; +} + +struct cql_node *cql_node_mk_mod(const char *name, + const char *value) +{ + struct cql_node *p = (struct cql_node *) malloc(sizeof(*p)); + p->which = CQL_NODE_MOD; + + p->u.mod.name = 0; + if (name) + p->u.mod.name = strdup(name); + p->u.mod.value = 0; + if (value) + p->u.mod.value = strdup(value); + p->u.mod.next = 0; + return p; +} + +struct cql_node *cql_node_mk_boolean(const char *op) +{ + struct cql_node *p = (struct cql_node *) malloc(sizeof(*p)); + p->which = CQL_NODE_BOOL; + p->u.boolean.value = 0; + if (op) + p->u.boolean.value = strdup(op); + p->u.boolean.left = 0; + p->u.boolean.right = 0; + p->u.boolean.modifiers = 0; + p->u.boolean.prefixes = 0; + return p; +} + +struct cql_node *cql_node_prefix(struct cql_node *n, const char *prefix, + const char *uri) +{ + struct cql_node **cpp = 0; + if (n->which == CQL_NODE_ST) + { + cpp = &n->u.st.prefixes; + } + else if (n->which == CQL_NODE_BOOL) + { + cpp = &n->u.boolean.prefixes; + } + if (cpp) + { + struct cql_node *cp = cql_node_mk_mod(prefix, uri); + cp->u.mod.next = *cpp; + *cpp = cp; + } + return n; +} + +struct cql_node *cql_node_mk_proxargs(const char *relation, + const char *distance, + const char *unit, + const char *ordering) +{ + struct cql_node *m = 0, *m1; + + if (ordering && *ordering) + m = cql_node_mk_mod("ordering", ordering); + if (unit && *unit) + { + m1 = cql_node_mk_mod("unit", unit); + m1->u.mod.next = m; + m = m1; + } + if (distance && *distance) + { + m1 = cql_node_mk_mod("distance", distance); + m1->u.mod.next = m; + m = m1; + } + if (relation && *relation) + { + m1 = cql_node_mk_mod("relation", relation); + m1->u.mod.next = m; + m = m1; + } + return m; +} + +void cql_node_destroy(struct cql_node *cn) +{ + if (!cn) + return; + switch (cn->which) + { + case CQL_NODE_ST: + free (cn->u.st.index); + free (cn->u.st.relation); + free (cn->u.st.term); + cql_node_destroy(cn->u.st.modifiers); + cql_node_destroy(cn->u.st.prefixes); + break; + case CQL_NODE_MOD: + free (cn->u.mod.name); + free (cn->u.mod.value); + cql_node_destroy(cn->u.mod.next); + break; + case CQL_NODE_BOOL: + free (cn->u.boolean.value); + cql_node_destroy(cn->u.boolean.left); + cql_node_destroy(cn->u.boolean.right); + cql_node_destroy(cn->u.boolean.prefixes); + } + free (cn); +} + diff --git a/src/datetime.asn b/src/datetime.asn new file mode 100644 index 0000000..cab9eb0 --- /dev/null +++ b/src/datetime.asn @@ -0,0 +1,81 @@ +UserInfoFormat-dateTime +{Z39-50-userInfoFormat dateTime (6)} DEFINITIONS ::= +BEGIN +IMPORTS IntUnit FROM Z39-50-APDU-1995; + +DateTime ::= SEQUENCE{ + date [1] Z3950Date OPTIONAL, + time [2] Z3950Time OPTIONAL + -- one or the other, or both + } + +Z3950Date ::= SEQUENCE{ + year [1] IMPLICIT INTEGER, + -- For "positive" years, i.e. 1 AD or later, supply + -- the absolute year, e.g. If the year is 1995, supply + -- the integer 1995; the value 95 would indicate the + -- year 0095. + -- For "negative" years, e.g. 1 BC or earlier, -1 + -- represents 1 BC, -2 represents 2 BC, etc. Zero is + -- invalid, because there was no year zero. + partOfYear [2] CHOICE{ -- may be omitted if only year is significant + monthAndDay [1] IMPLICIT SEQUENCE{ + month [2] IMPLICIT INTEGER, + -- value 1-12 + day [3] IMPLICIT INTEGER OPTIONAL + -- may be omitted if only year and month + -- are significant. Value 1-31. + }, + julianDay [2] IMPLICIT INTEGER, -- Value 1 - 366. + weekNumber [3] IMPLICIT INTEGER, -- Value 1 - 53. + quarter [4] CHOICE{ + first [1] IMPLICIT NULL, + second [2] IMPLICIT NULL, + third [3] IMPLICIT NULL, + fourth [4] IMPLICIT NULL}, + season [5] CHOICE{ + winter [1] IMPLICIT NULL, + spring [2] IMPLICIT NULL, + summer [3] IMPLICIT NULL, + autumn [4] IMPLICIT NULL} + } OPTIONAL, + flags [3] IMPLICIT SEQUENCE{ + circa [1] IMPLICIT NULL OPTIONAL, + -- if this flag is set then the date is "approximate". + era [2] CHOICE{ + -- If era occurs, partOfYear should not occur. + decade [1] IMPLICIT NULL, + -- year must be multiple of 10. + -- For example, 1900 refers to + -- the decade covering the years + -- 1900 through 1909. + century [2] IMPLICIT NULL, + -- year must be multiple of 100. + millennium [3] IMPLICIT NULL + -- year must be multiple of 1000. + } OPTIONAL + } OPTIONAL + } + + +Z3950Time ::= SEQUENCE{ + hour [1] IMPLICIT INTEGER, + -- Value 0-23. + minute [2] IMPLICIT INTEGER OPTIONAL, + -- value 0-59. May be omitted when hour only is + -- significant (in which case second and + -- partOfSecond must also be omitted). + second [3] IMPLICIT INTEGER OPTIONAL, + -- value 0-59. May be omitted when only hour, or + -- hour and minute, is significant (in which case + -- partOfSecond must also be omitted). + partOfSecond [4] IMPLICIT IntUnit OPTIONAL, + -- Use Unit System = 'si', Unit type = 'time'; + -- Unit = 'second', with appropriate value and + -- scale factor. + zone [5] CHOICE{ + local [1] IMPLICIT NULL, + utc [2] IMPLICIT NULL, + utcOffset [3] IMPLICIT INTEGER -- in minutes + }} +END diff --git a/src/diagbib1.c b/src/diagbib1.c new file mode 100644 index 0000000..0842c41 --- /dev/null +++ b/src/diagbib1.c @@ -0,0 +1,233 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: diagbib1.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ + +#include + +#include + +static struct { + int code; + char *msg; +} msg_tab[] = { +{ 1, "Permanent system error" }, +{ 2, "Temporary system error" }, +{ 3, "Unsupported search" }, +{ 4, "Terms only exclusion (stop) words" }, +{ 5, "Too many argument words" }, +{ 6, "Too many boolean operators" }, +{ 7, "Too many truncated words" }, +{ 8, "Too many incomplete subfields" }, +{ 9, "Truncated words too short" }, +{ 10, "Invalid format for record number (search term)" }, +{ 11, "Too many characters in search statement" }, +{ 12, "Too many records retrieved" }, +{ 13, "Present request out of range" }, +{ 14, "System error in presenting records" }, +{ 15, "Record no authorized to be sent intersystem" }, +{ 16, "Record exceeds Preferred-message-size" }, +{ 17, "Record exceeds Maximum-record-size" }, +{ 18, "Result set not supported as a search term" }, +{ 19, "Only single result set as search term supported" }, +{ 20, "Only ANDing of a single result set as search term supported" }, +{ 21, "Result set exists and replace indicator off" }, +{ 22, "Result set naming not supported" }, +{ 23, "Combination of specified databases not supported" }, +{ 24, "Element set names not supported" }, +{ 25, "Specified element set name not valid for specified database" }, +{ 26, "Only a single element set name supported" }, +{ 27, "Result set no longer exists - unilaterally deleted by target" }, +{ 28, "Result set is in use" }, +{ 29, "One of the specified databases is locked" }, +{ 30, "Specified result set does not exist" }, +{ 31, "Resources exhausted - no results available" }, +{ 32, "Resources exhausted - unpredictable partial results available" }, +{ 33, "Resources exhausted - valid subset of results available" }, +{ 100, "Unspecified error" }, +{ 101, "Access-control failure" }, +{ 102, "Security challenge required but could not be issued -" +" request terminated" }, +{ 103, "Security challenge required but could not be issued -" +" record not included" }, +{ 104, "Security challenge failed - record not included" }, +{ 105, "Terminated by negative continue response" }, +{ 106, "No abstract syntaxes agreed to for this record" }, +{ 107, "Query type not supported" }, +{ 108, "Malformed query" }, +{ 109, "Database unavailable" }, +{ 110, "Operator unsupported" }, +{ 111, "Too many databases specified" }, +{ 112, "Too many result sets created" }, +{ 113, "Unsupported attribute type" }, +{ 114, "Unsupported Use attribute" }, +{ 115, "Unsupported value for Use attribute" }, +{ 116, "Use attribute required but not supplied" }, +{ 117, "Unsupported Relation attribute" }, +{ 118, "Unsupported Structure attribute" }, +{ 119, "Unsupported Position attribute" }, +{ 120, "Unsupported Truncation attribute" }, +{ 121, "Unsupported Attribute Set" }, +{ 122, "Unsupported Completeness attribute" }, +{ 123, "Unsupported attribute combination" }, +{ 124, "Unsupported coded value for term" }, +{ 125, "Malformed search term" }, +{ 126, "Illegal term value for attribute" }, +{ 127, "Unparsable format for un-normalized value" }, +{ 128, "Illegal result set name" }, +{ 129, "Proximity search of sets not supported" }, +{ 130, "Illegal result set in proximity search" }, +{ 131, "Unsupported proximity relation" }, +{ 132, "Unsupported proximity unit code" }, +{ 201, "Proximity not supported with this attribute combination" }, +{ 202, "Unsupported distance for proximity" }, +{ 203, "Ordered flag not supported for proximity" }, +{ 205, "Only zero step size supported for Scan" }, +{ 206, "Specified step size not supported for Scan" }, +{ 207, "Cannot sort according to sequence" }, +{ 208, "No result set name supplied on Sort" }, +{ 209, "Generic sort not supported (database-specific sort only supported)" }, +{ 210, "Database specific sort not supported" }, +{ 211, "Too many sort keys" }, +{ 212, "Duplicate sort keys" }, +{ 213, "Unsupported missing data action" }, +{ 214, "Illegal sort relation" }, +{ 215, "Illegal case value" }, +{ 216, "Illegal missing data action" }, +{ 217, "Segmentation: Cannot guarantee records will fit in specified segments" +}, +{ 218, "ES: Package name already in use" }, +{ 219, "ES: no such package, on modify/delete" }, +{ 220, "ES: quota exceeded" }, +{ 221, "ES: extended service type not supported" }, +{ 222, "ES: permission denied on ES - id not authorized" }, +{ 223, "ES: permission denied on ES - cannot modify or delete" }, +{ 224, "ES: immediate execution failed" }, +{ 225, "ES: immediate execution not supported for this service" }, +{ 226, "ES: immediate execution not supported for these parameters" }, +{ 227, "No data available in requested record syntax" }, +{ 228, "Scan: malformed scan" }, +{ 229, "Term type not supported" }, +{ 230, "Sort: too many input results" }, +{ 231, "Sort: incompatible record formats" }, +{ 232, "Scan: term list not supported" }, +{ 233, "Scan: unsupported value of position-in-response" }, +{ 234, "Too many index terms processed" }, +{ 235, "Database does not exist" }, +{ 236, "Access to specified database denied" }, +{ 237, "Sort: illegal sort" }, +{ 238, "Record not available in requested syntax" }, +{ 239, "Record syntax not supported" }, +{ 240, "Scan: Resources exhausted looking for satisfying terms" }, +{ 241, "Scan: Beginning or end of term list" }, +{ 242, "Segmentation: max-segment-size too small to segment record" }, +{ 243, "Present: additional-ranges parameter not supported" }, +{ 244, "Present: comp-spec parameter not supported" }, +{ 245, "Type-1 query: restriction ('resultAttr') operand not supported" }, +{ 246, "Type-1 query: 'complex' attributeValue not supported" }, +{ 247, "Type-1 query: 'attributeSet' as part of AttributeElement not supported" }, +{ 1001, "Malformed APDU"}, +{ 1002, "ES: EXTERNAL form of Item Order request not supported" }, +{ 1003, "ES: Result set item form of Item Order request not supported" }, +{ 1004, "ES: Extended services not supported unless access control is in effect" }, +{ 1005, "Response records in Search response not supported" }, +{ 1006, "Response records in Search response not possible for specified database (or database combination)" }, +{ 1007, "No Explain server. Addinfo: pointers to servers that have a surrogate Explain database for this server" }, +{ 1008, "ES: missing mandatory parameter for specified function. Addinfo: parameter" }, +{ 1009, "ES: Item Order, unsupported OID in itemRequest. Addinfo: OID" }, +{ 1010, "Init/AC: Bad Userid" }, +{ 1011, "Init/AC: Bad Userid and/or Password" }, +{ 1012, "Init/AC: No searches remaining (pre-purchased searches exhausted)" }, +{ 1013, "Init/AC: Incorrect interface type (specified id valid only when used with a particular access method or client)" }, +{ 1014, "Init/AC: Authentication System error" }, +{ 1015, "Init/AC: Maximum number of simultaneous sessions for Userid" }, +{ 1016, "Init/AC: Blocked network address"}, +{ 1017, "Init/AC: No databases available for specified userId"}, +{ 1018, "Init/AC: System temporarily out of resources"}, +{ 1019, "Init/AC: System not available due to maintenance" }, +{ 1020, "Init/AC: System temporarily unavailable (Addinfo: when it's expected back up)"}, +{ 1021, "Init/AC: Account has expired"}, +{ 1022, "Init/AC: Password has expired so a new one must be supplied"}, +{ 1023, "Init/AC: Password has been changed by an administrator so a new one must be supplied"}, +{ 1024, "Unsupported Attribute" }, +{ 1025, "Service not supported for this database" }, +{ 1026, "Record cannot be opened because it is locked"}, +{ 1027, "SQL error" }, +{ 1028, "Record deleted" }, +{ 1029, "Scan: too many terms requested. Addinfo: max terms supported" }, +/* 1030 - 1039 /currently unnassigned */ + +/* The following, 1040 - 1047, were approved at the June 1998 ZIG meeting. + These were originally proposed for addition to the Extended Services + diagnostic set. */ +{ 1040, "ES: Invalid function" }, +{ 1041, "ES: Error in retention time" }, +{ 1042, "ES: Permissions data not understood" }, +{ 1043, "ES: Invalid OID for task specific parameters" }, +{ 1044, "ES: Invalid action" }, +{ 1045, "ES: Unknown schema" }, +{ 1046, "ES: Too many records in package" }, +{ 1047, "ES: Invalid wait action" }, +/* The following, 1048 - 1053, were approved at the October 1998 ZIG + meeting. */ +{ 1048, "ES: Cannot create task package -- exceeds maximum permissable size"}, +{ 1049, "ES: Cannot return task package -- exceeds maximum permissable size"}, +{ 1050, "ES: Extended services request too large"}, +{ 1051, "Scan: Attribute set id required -- not supplied"}, +{ 1052, "ES: Cannot process task package record -- exceeds maximum " + "permissible record size for ES" }, +{ 1053, "ES: Cannot return task package record -- exceeds maximum " + "permissible record size for ES response" }, +/* The following, 1054 - 1057, were approved at the March 1999 ZIG + meeting. 1054 and 1055 are added for support of the Model for Z39.50 + Negotiation During Initialization + . 1056 was added in + conjunction with the clarification Single-PDU, Multi-database Searching + -- Status */ +{ 1054, "Init: Required negotiation record not included"}, +{ 1055, "Init: negotiation option required"}, +{ 1056, "Attribute not supported for database" }, +{ 1057, "ES: Unsupported value of task package parameter"}, +/* The following, 1058 - 1066, were approved at the August 1999 ZIG + meeting. 1058 through 1065 are added for support of the Z39.50 Duplicate + Detection Service . */ +{ 1058, "Duplicate Detection: Cannot dedup on requested record portion" }, +{ 1059, "Duplicate Detection: Requested detection criterion not supported" }, +{ 1060, "Duplicate Detection: Requested level of match not supported" }, +{ 1061, "Duplicate Detection: Requested regular expression not supported" }, +{ 1062, "Duplicate Detection: Cannot do clustering" }, +{ 1063, "Duplicate Detection: Retention criterion not supported"}, +{ 1064, "Duplicate Detection: Requested number (or percentage) of entries " + "for retention too large" }, +{ 1065, "Duplicate Detection: Requested sort criterion not supported" }, +{ 1066, "CompSpec: Unknown schema, or schema not supported."}, +/* The following, 1067 - 1069, were approved at the January 2000 ZIG + meeting. 1067 and 1068 are added for support of encapsulation + . */ +{ 1067, "Encapsulation: Encapsulated sequence of PDUs not supported" }, +{ 1068, "Encapsulation: Base operation (and encapsulated PDUs) not executed " + "based on pre-screening analysis" }, +{ 1069, "No syntaxes available for this request" }, +/* The following, 1070-1071, were approved at the July 2000 ZIG meeting. + These are defined in conjunction with the clarification Server Selected + Record Syntax */ +{ 1070, "user not authorized to receive record(s) in requested syntax" }, +{ 1071, "preferredRecordSyntax not supplied" }, +/* The following diagnostic was approved at the October 2001 ZIG meeting. + See http://lists.w3.org/Archives/Public/www-zig/2001Jun/0006.html */ +{ 1072, "Query term includes characters that do not translate into the " + "target character set"}, +{ 0, NULL} +}; + +const char *diagbib1_str (int code) +{ + int i; + for (i=0; msg_tab[i].msg; i++) + if (msg_tab[i].code == code) + return msg_tab[i].msg; + return "Unknown error"; +} diff --git a/src/dumpber.c b/src/dumpber.c new file mode 100644 index 0000000..86c66e8 --- /dev/null +++ b/src/dumpber.c @@ -0,0 +1,124 @@ +/* + * Copyright (c) 1995-2003, Index Data. + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: dumpber.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include "odr-priv.h" + +static int do_dumpBER(FILE *f, const char *buf, int len, int level, int offset) +{ + int res, ll, zclass, tag, cons, lenlen, taglen; + const char *b = buf, *bp = buf; + + if (!len) + return 0; + if (!buf[0] && !buf[1]) + return 0; + if ((res = ber_dectag((unsigned char*)b, &zclass, &tag, &cons, len)) <= 0) + return 0; + if (res > len) + { + fprintf(stderr, "Unexpected end of buffer\n"); + return 0; + } + fprintf(f, "%5d: %*s", offset, level * 4, ""); + if (zclass == ODR_UNIVERSAL) + { + static char *nl[] = + { + "[Univ 0]", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING", + "NULL", "OID", "OBJECT DESCIPTOR", "EXTERNAL", "REAL", + "ENUM", "[UNIV 11]", "[UNIV 12]", "[UNIV 13]", "[UNIV 14]", + "[UNIV 15]", "SEQUENCE", "SET", "NUMERICSTRING", "PRINTABLESTRING", + "[UNIV 20]", "[UNIV 21]", "[UNIV 22]", "[UNIV 23]", "[UNIV 24]", + "GRAPHICSTRING", "VISIBLESTRING", "GENERALSTRING", "[UNIV 28]" + }; + + if (tag >= 0 && tag < 28) + fprintf(f, "%s", nl[tag]); + else + fprintf(f, "[UNIV %d]", tag); + } + else if (zclass == ODR_CONTEXT) + fprintf(f, "[%d]", tag); + else + fprintf(f, "[%d:%d]", zclass, tag); + b += res; + taglen = res; + len -= res; + bp = b; + if ((res = ber_declen((unsigned char*)b, &ll, len)) <= 0) + { + fprintf(f, "\n%*sBad length\n", level*4+5, ""); + return 0; + } + lenlen = res; + b += res; + len -= res; + if (ll >= 0) + fprintf(f, " len=%d", ll); + else + fprintf(f, " len=?"); + fprintf(f, " tl=%d, ll=%d cons=%d\n", taglen, lenlen, cons); + if (!cons) + { + if (ll < 0 || ll > len) + { + fprintf(f, "%*sBad length on primitive type. ll=%d len=%d\n", + level*4+5, "", ll, len); + return 0; + } + return ll + (b - buf); + } + if (ll >= 0) + { + if (ll > len) + { + fprintf(f, "%*sBad length of constructed type ll=%d len=%d.\n", + level*4+5, "", ll, len); + return 0; + } + len = ll; + } + /* constructed - cycle through children */ + while ((ll == -1 && len >= 2) || (ll >= 0 && len)) + { + if (ll == -1 && *b == 0 && *(b + 1) == 0) + break; + if (!(res = do_dumpBER(f, b, len, level + 1, offset + (b - buf)))) + { + fprintf(f, "%*sDump of content element failed.\n", level*4+5, ""); + return 0; + } + b += res; + len -= res; + if (len < 0) + { + fprintf(f, "%*sBad length\n", level*4+5, ""); + return 0; + } + } + if (ll == -1) + { + if (len < 2) + { + fprintf(f, "%*sBuffer too short in indefinite length.\n", + level*4+5, ""); + return 0; + } + return (b - buf) + 2; + } + return b - buf; +} + +int odr_dumpBER(FILE *f, const char *buf, int len) +{ + return do_dumpBER(f, buf, len, 0, 0); +} diff --git a/src/esadmin.asn b/src/esadmin.asn new file mode 100644 index 0000000..9ec766b --- /dev/null +++ b/src/esadmin.asn @@ -0,0 +1,49 @@ +ESFormat-Admin +{Z39-50-extendedService Index-Data(81) AdminES (1)} DEFINITIONS ::= + -- oid is 1.2.840.10003.9.81.1 +BEGIN +IMPORTS DiagRec, InternationalString, Segment +FROM Z39-50-APDU-1995; +Admin ::= CHOICE{ + esRequest [1] IMPLICIT SEQUENCE{ + toKeep [1] OriginPartToKeep, + notToKeep [2] OriginPartNotToKeep}, + taskPackage [2] IMPLICIT SEQUENCE{ + originPart [1] + OriginPartToKeep, + targetPart [2] TargetPart}} + +OriginPartToKeep ::= SEQUENCE{ +action [1] CHOICE{ + reIndex [1] NULL, + truncate [2] NULL, + drop [3] NULL, + create [4] NULL, + import [5] ImportParameters, + refresh [6] NULL, -- Review internal representation of records against source files on disk to + -- see if they have been updated. + commit [7] NULL, + shutdown [8] NULL, + start [9] NULL}, +databaseName [2] IMPLICIT InternationalString OPTIONAL} + +OriginPartNotToKeep ::= CHOICE{ +records [1] Segment, +recordsWillFollow [0] NULL} + +TargetPart ::= SEQUENCE{ + updateStatus [1] IMPLICIT INTEGER{ + success (1), + partial (2), + failure (3)}, + globalDiagnostics [2] IMPLICIT SEQUENCE OF + DiagRec OPTIONAL + } + +-- Auxiliary definitions for Admin + +ImportParameters ::= SEQUENCE{ + recordType [1] IMPLICIT InternationalString +} + +END diff --git a/src/esupdate.asn b/src/esupdate.asn new file mode 100644 index 0000000..e6628a1 --- /dev/null +++ b/src/esupdate.asn @@ -0,0 +1,103 @@ +ESFormat-Update +{Z39-50-extendedService Update (5) revisions (1) revision-1 (1)} DEFINITIONS ::= + -- oid is 1.2.840.10003.9.5.1.1 +BEGIN +IMPORTS DiagRec, InternationalString +FROM Z39-50-APDU-1995; +Update ::= CHOICE{ + esRequest [1] IMPLICIT SEQUENCE{ + toKeep [1] OriginPartToKeep, + notToKeep [2] OriginPartNotToKeep}, + taskPackage [2] IMPLICIT SEQUENCE{ + originPart [1] + OriginPartToKeep, + targetPart [2] TargetPart}} + +OriginPartToKeep ::= SEQUENCE{ +action [1] IMPLICIT INTEGER{ + recordInsert (1), + recordReplace (2), + recordDelete (3), + elementUpdate (4), + specialUpdate (5)}, + databaseName [2] IMPLICIT InternationalString, + schema [3] IMPLICIT OBJECT IDENTIFIER OPTIONAL, + elementSetName [4] IMPLICIT InternationalString OPTIONAL, + actionQualifier [5] IMPLICIT EXTERNAL OPTIONAL} + +OriginPartNotToKeep ::= SuppliedRecords + +TargetPart ::= SEQUENCE{ + updateStatus [1] IMPLICIT INTEGER{ + success (1), + partial (2), + failure (3)}, + globalDiagnostics [2] IMPLICIT SEQUENCE OF + DiagRec OPTIONAL, + -- These are non-surrogate + -- diagnosticsrelating to the task, + -- not to individual records. + taskPackageRecords [3] IMPLICIT SEQUENCE OF +TaskPackageRecordStructure + -- There should be a + -- TaskPackageRecordStructure + -- for every record supplied. + -- The target should create + -- such a structure for every + -- record immediately upon + -- creating the task package + -- to include correlation + -- information and status. + -- The record itself would not + -- be included until processing + -- for that record is complete. + } + +-- Auxiliary definitions for Update +SuppliedRecords ::= SEQUENCE OF SEQUENCE{ + recordId [1] CHOICE{ + number [1] IMPLICIT INTEGER, + string [2] IMPLICIT InternationalString, + opaque [3] IMPLICIT OCTET STRING} OPTIONAL, + supplementalId [2] CHOICE{ + timeStamp [1] IMPLICIT GeneralizedTime, + versionNumber [2] IMPLICIT InternationalString, + previousVersion [3] IMPLICIT EXTERNAL} OPTIONAL, + correlationInfo [3] IMPLICIT CorrelationInfo OPTIONAL, + record [4] IMPLICIT EXTERNAL} + +CorrelationInfo ::= SEQUENCE{ + -- origin may supply one or both for any record: + note [1] IMPLICIT InternationalString OPTIONAL, + id [2] IMPLICIT INTEGER OPTIONAL} + +TaskPackageRecordStructure ::= SEQUENCE{ + recordOrSurDiag [1] CHOICE { + record [1] IMPLICIT EXTERNAL, + -- Choose 'record' if + -- recordStatus is 'success', and + -- elementSetName was supplied. + + surrogateDiagnostics [2] IMPLICIT + SEQUENCE OF DiagRec + -- Choose 'SurrogateDiagnostics', if + -- RecordStatus is failure. + } OPTIONAL, + -- The parameter recordOrSurDiag + -- will thus be omitted only if + -- 'elementSetName' was omitted and + -- recordStatus is 'success'; or + --if record status is 'queued' + -- or in 'process'. + correlationInfo [2] IMPLICIT + CorrelationInfo OPTIONAL, + -- This should be included + -- if it was supplied by the origin. + recordStatus [3] IMPLICIT INTEGER{ + success (1), + queued (2), + inProcess (3), + failure (4)}, + supplementalDiagnostics [4] IMPLICIT + SEQUENCE OF DiagRec OPTIONAL} +END diff --git a/src/eventl.c b/src/eventl.c new file mode 100644 index 0000000..ac56264 --- /dev/null +++ b/src/eventl.c @@ -0,0 +1,188 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: eventl.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ + +#include +#include +#ifdef WIN32 +#include +#else +#include +#endif +#include +#include +#include + +#include +#include +#include +#include +#include "eventl.h" +#include "session.h" +#include + +#if YAZ_GNU_THREADS +#include +#define YAZ_EV_SELECT pth_select +#endif + +#ifndef YAZ_EV_SELECT +#define YAZ_EV_SELECT select +#endif + +IOCHAN iochan_create(int fd, IOC_CALLBACK cb, int flags) +{ + IOCHAN new_iochan; + + if (!(new_iochan = (IOCHAN)xmalloc(sizeof(*new_iochan)))) + return 0; + new_iochan->destroyed = 0; + new_iochan->fd = fd; + new_iochan->flags = flags; + new_iochan->fun = cb; + new_iochan->force_event = 0; + new_iochan->last_event = new_iochan->max_idle = 0; + new_iochan->next = NULL; + return new_iochan; +} + +int event_loop(IOCHAN *iochans) +{ + do /* loop as long as there are active associations to process */ + { + IOCHAN p, nextp; + fd_set in, out, except; + int res, max; + static struct timeval to; + time_t now = time(0); + + if (statserv_must_terminate()) + { + for (p = *iochans; p; p = p->next) + p->force_event = EVENT_TIMEOUT; + } + FD_ZERO(&in); + FD_ZERO(&out); + FD_ZERO(&except); + to.tv_sec = 3600; + to.tv_usec = 0; + max = 0; + for (p = *iochans; p; p = p->next) + { + time_t w, ftime; + yaz_log(LOG_DEBUG, "fd=%d flags=%d force_event=%d", + p->fd, p->flags, p->force_event); + if (p->force_event) + to.tv_sec = 0; /* polling select */ + if (p->flags & EVENT_INPUT) + FD_SET(p->fd, &in); + if (p->flags & EVENT_OUTPUT) + FD_SET(p->fd, &out); + if (p->flags & EVENT_EXCEPT) + FD_SET(p->fd, &except); + if (p->fd > max) + max = p->fd; + if (p->max_idle && p->last_event) + { + ftime = p->last_event + p->max_idle; + if (ftime < now) + w = p->max_idle; + else + w = ftime - now; + if (w < to.tv_sec) + to.tv_sec = w; + } + } + yaz_log(LOG_DEBUG, "select start %ld", (long) to.tv_sec); + res = YAZ_EV_SELECT(max + 1, &in, &out, &except, &to); + yaz_log(LOG_DEBUG, "select end"); + if (res < 0) + { + if (yaz_errno() == EINTR) + { + if (statserv_must_terminate()) + { + for (p = *iochans; p; p = p->next) + p->force_event = EVENT_TIMEOUT; + } + continue; + } + else + { + /* Destroy the first member in the chain, and try again */ + association *assoc = (association *)iochan_getdata(*iochans); + COMSTACK conn = assoc->client_link; + + cs_close(conn); + destroy_association(assoc); + iochan_destroy(*iochans); + yaz_log(LOG_DEBUG, "error select, destroying iochan %p", + *iochans); + } + } + now = time(0); + for (p = *iochans; p; p = p->next) + { + int force_event = p->force_event; + + p->force_event = 0; + if (!p->destroyed && (FD_ISSET(p->fd, &in) || + force_event == EVENT_INPUT)) + { + p->last_event = now; + (*p->fun)(p, EVENT_INPUT); + } + if (!p->destroyed && (FD_ISSET(p->fd, &out) || + force_event == EVENT_OUTPUT)) + { + p->last_event = now; + (*p->fun)(p, EVENT_OUTPUT); + } + if (!p->destroyed && (FD_ISSET(p->fd, &except) || + force_event == EVENT_EXCEPT)) + { + p->last_event = now; + (*p->fun)(p, EVENT_EXCEPT); + } + if (!p->destroyed && ((p->max_idle && now - p->last_event >= + p->max_idle) || force_event == EVENT_TIMEOUT)) + { + p->last_event = now; + (*p->fun)(p, EVENT_TIMEOUT); + } + } + for (p = *iochans; p; p = nextp) + { + nextp = p->next; + + if (p->destroyed) + { + IOCHAN tmp = p, pr; + + /* We need to inform the threadlist that this channel has been destroyed */ + statserv_remove(p); + + /* Now reset the pointers */ + if (p == *iochans) + *iochans = p->next; + else + { + for (pr = *iochans; pr; pr = pr->next) + if (pr->next == p) + break; + assert(pr); /* grave error if it weren't there */ + pr->next = p->next; + } + if (nextp == p) + nextp = p->next; + xfree(tmp); + } + } + } + while (*iochans); + return 0; +} diff --git a/src/eventl.h b/src/eventl.h new file mode 100644 index 0000000..43df1bc --- /dev/null +++ b/src/eventl.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: eventl.h,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ + +#ifndef EVENTL_H +#define EVENTL_H + +#include + +struct iochan; + +typedef void (*IOC_CALLBACK)(struct iochan *i, int event); + +typedef struct iochan +{ + int fd; + int flags; +#define EVENT_INPUT 0x01 +#define EVENT_OUTPUT 0x02 +#define EVENT_EXCEPT 0x04 +#define EVENT_TIMEOUT 0x08 +#define EVENT_WORK 0x10 +int force_event; + IOC_CALLBACK fun; + void *data; + int destroyed; + time_t last_event; + time_t max_idle; + + struct iochan *next; +} *IOCHAN; + +#define iochan_destroy(i) (void)((i)->destroyed = 1) +#define iochan_getfd(i) ((i)->fd) +#define iochan_setfd(i, f) ((i)->fd = (f)) +#define iochan_getdata(i) ((i)->data) +#define iochan_setdata(i, d) ((i)->data = d) +#define iochan_getflags(i) ((i)->flags) +#define iochan_setflags(i, d) ((i)->flags = d) +#define iochan_setflag(i, d) ((i)->flags |= d) +#define iochan_clearflag(i, d) ((i)->flags &= ~(d)) +#define iochan_getflag(i, d) ((i)->flags & d ? 1 : 0) +#define iochan_getfun(i) ((i)->fun) +#define iochan_setfun(i, d) ((i)->fun = d) +#define iochan_setevent(i, e) ((i)->force_event = (e)) +#define iochan_getnext(i) ((i)->next) +#define iochan_settimeout(i, t) ((i)->max_idle = (t), (i)->last_event = time(0)) + +IOCHAN iochan_create(int fd, IOC_CALLBACK cb, int flags); +int event_loop(IOCHAN *iochans); +void statserv_remove (IOCHAN pIOChannel); +#endif diff --git a/src/grs1disp.c b/src/grs1disp.c new file mode 100644 index 0000000..bef6b3d --- /dev/null +++ b/src/grs1disp.c @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2002, Index Data. + * See the file LICENSE for details. + * + * $Id: grs1disp.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ + +#include +#include +#include +#include + +#include + +static void display_variant(WRBUF w, Z_Variant *v, int level) +{ + int i; + + for (i = 0; i < v->num_triples; i++) + { + printf("%*sclass=%d,type=%d", level * 4, "", *v->triples[i]->zclass, + *v->triples[i]->type); + if (v->triples[i]->which == Z_Triple_internationalString) + printf(",value=%s\n", v->triples[i]->value.internationalString); + else + printf("\n"); + } +} + +static void display_grs1(WRBUF w, Z_GenericRecord *r, int level) +{ + int i; + + if (!r) + { + return; + } + for (i = 0; i < r->num_elements; i++) + { + Z_TaggedElement *t; + + wrbuf_printf(w, "%*s", level * 4, ""); + t = r->elements[i]; + wrbuf_printf(w, "("); + if (t->tagType) + wrbuf_printf(w, "%d,", *t->tagType); + else + wrbuf_printf(w, "?,"); + if (t->tagValue->which == Z_StringOrNumeric_numeric) + wrbuf_printf(w, "%d) ", *t->tagValue->u.numeric); + else + wrbuf_printf(w, "%s) ", t->tagValue->u.string); + if (t->content->which == Z_ElementData_subtree) + { + if (!t->content->u.subtree) + printf (" (no subtree)\n"); + else + { + wrbuf_printf(w, "\n"); + display_grs1(w, t->content->u.subtree, level+1); + } + } + else if (t->content->which == Z_ElementData_string) + wrbuf_printf(w, "%s\n", t->content->u.string); + else if (t->content->which == Z_ElementData_numeric) + wrbuf_printf(w, "%d\n", *t->content->u.numeric); + else if (t->content->which == Z_ElementData_oid) + { + int *ip = t->content->u.oid; + oident *oent; + + if ((oent = oid_getentbyoid(t->content->u.oid))) + wrbuf_printf(w, "OID: %s\n", oent->desc); + else + { + wrbuf_printf(w, "{"); + while (ip && *ip >= 0) + wrbuf_printf(w, " %d", *(ip++)); + wrbuf_printf(w, " }\n"); + } + } + else if (t->content->which == Z_ElementData_noDataRequested) + wrbuf_printf(w, "[No data requested]\n"); + else if (t->content->which == Z_ElementData_elementEmpty) + wrbuf_printf(w, "[Element empty]\n"); + else if (t->content->which == Z_ElementData_elementNotThere) + wrbuf_printf(w, "[Element not there]\n"); + else if (t->content->which == Z_ElementData_date) + wrbuf_printf(w, "Date: %s\n", t->content->u.date); + else if (t->content->which == Z_ElementData_ext) + { + printf ("External\n"); + /* we cannot print externals here. Srry */ + } + else + wrbuf_printf(w, "? type = %d\n",t->content->which); + if (t->appliedVariant) + display_variant(w, t->appliedVariant, level+1); + if (t->metaData && t->metaData->supportedVariants) + { + int c; + + wrbuf_printf(w, "%*s---- variant list\n", (level+1)*4, ""); + for (c = 0; c < t->metaData->num_supportedVariants; c++) + { + wrbuf_printf(w, "%*svariant #%d\n", (level+1)*4, "", c); + display_variant(w, t->metaData->supportedVariants[c], level+2); + } + } + } +} + +void yaz_display_grs1(WRBUF wrbuf, Z_GenericRecord *r, int flags) +{ + display_grs1 (wrbuf, r, 0); +} + diff --git a/src/ill-get.c b/src/ill-get.c new file mode 100644 index 0000000..86ea32d --- /dev/null +++ b/src/ill-get.c @@ -0,0 +1,693 @@ +/* + * Copyright (c) 1999-2001, Index Data. + * See the file LICENSE for details. + * + * $Log: ill-get.c,v $ + * Revision 1.1 2003-10-27 12:21:30 adam + * Source restructure. yaz-marcdump part of installation + * + * Revision 1.9 2001/03/25 21:55:12 adam + * Added odr_intdup. Ztest server returns TaskPackage for ItemUpdate. + * + * Revision 1.8 2001/02/21 13:46:53 adam + * C++ fixes. + * + * Revision 1.7 2001/02/20 11:25:32 adam + * Added ill_get_APDU and ill_get_Cancel. + * + * Revision 1.6 2000/08/10 08:41:26 adam + * Fixes for ILL. + * + * Revision 1.5 2000/02/24 08:52:01 adam + * Bug fix. + * + * Revision 1.4 2000/02/04 11:01:15 adam + * Added more elements. + * + * Revision 1.3 2000/01/31 13:15:21 adam + * Removed uses of assert(3). Cleanup of ODR. CCL parser update so + * that some characters are not surrounded by spaces in resulting term. + * ILL-code updates. + * + * Revision 1.2 2000/01/15 09:38:51 adam + * Implemented ill_get_ILLRequest. Added some type mappings for ILL protocol. + * + * Revision 1.1 1999/12/16 23:36:19 adam + * Implemented ILL protocol. Minor updates ASN.1 compiler. + * + */ + +#include + +bool_t *ill_get_bool (struct ill_get_ctl *gc, const char *name, + const char *sub, int val) +{ + ODR o = gc->odr; + char element[128]; + const char *v; + bool_t *r = (bool_t *) odr_malloc (o, sizeof(*r)); + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + + v = (gc->f)(gc->clientData, element); + if (v) + val = atoi(v); + else if (val < 0) + return 0; + *r = val; + return r; +} + +int *ill_get_int (struct ill_get_ctl *gc, const char *name, + const char *sub, int val) +{ + ODR o = gc->odr; + char element[128]; + const char *v; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + v = (gc->f)(gc->clientData, element); + if (v) + val = atoi(v); + return odr_intdup(o, val); +} + +int *ill_get_enumerated (struct ill_get_ctl *gc, const char *name, + const char *sub, int val) +{ + return ill_get_int(gc, name, sub, val); +} + +ILL_String *ill_get_ILL_String_x (struct ill_get_ctl *gc, const char *name, + const char *sub, const char *vdefault) +{ + ILL_String *r = (ILL_String *) odr_malloc (gc->odr, sizeof(*r)); + char element[128]; + const char *v; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + v = (gc->f)(gc->clientData, element); + if (!v) + v = vdefault; + if (!v) + return 0; + r->which = ILL_String_GeneralString; + r->u.GeneralString = odr_strdup (gc->odr, v); + return r; +} + +ILL_String *ill_get_ILL_String(struct ill_get_ctl *gc, const char *name, + const char *sub) +{ + return ill_get_ILL_String_x (gc, name, sub, 0); +} + +ILL_ISO_Date *ill_get_ILL_ISO_Date (struct ill_get_ctl *gc, const char *name, + const char *sub, const char *val) +{ + char element[128]; + const char *v; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + v = (gc->f)(gc->clientData, element); + if (!v) + v = val; + if (!v) + return 0; + return odr_strdup (gc->odr, v); +} + +ILL_ISO_Time *ill_get_ILL_ISO_Time (struct ill_get_ctl *gc, const char *name, + const char *sub, const char *val) +{ + char element[128]; + const char *v; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + v = (gc->f)(gc->clientData, element); + if (!v) + v = val; + if (!v) + return 0; + return odr_strdup (gc->odr, v); +} + +ILL_Person_Or_Institution_Symbol *ill_get_Person_Or_Insitution_Symbol ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + char element[128]; + ODR o = gc->odr; + ILL_Person_Or_Institution_Symbol *p = + (ILL_Person_Or_Institution_Symbol *) odr_malloc (o, sizeof(*p)); + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + p->which = ILL_Person_Or_Institution_Symbol_person_symbol; + if ((p->u.person_symbol = ill_get_ILL_String (gc, element, "person"))) + return p; + + p->which = ILL_Person_Or_Institution_Symbol_institution_symbol; + if ((p->u.institution_symbol = + ill_get_ILL_String (gc, element, "institution"))) + return p; + return 0; +} + +static ILL_Name_Of_Person_Or_Institution *ill_get_Name_Of_Person_Or_Institution( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + char element[128]; + ODR o = gc->odr; + ILL_Name_Of_Person_Or_Institution *p = + (ILL_Name_Of_Person_Or_Institution *) odr_malloc (o, sizeof(*p)); + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + p->which = ILL_Name_Of_Person_Or_Institution_name_of_person; + if ((p->u.name_of_person = + ill_get_ILL_String (gc, element, "name-of-person"))) + return p; + + p->which = ILL_Name_Of_Person_Or_Institution_name_of_institution; + if ((p->u.name_of_institution = + ill_get_ILL_String (gc, element, "name-of-institution"))) + return p; + return 0; +} + +ILL_System_Id *ill_get_System_Id(struct ill_get_ctl *gc, + const char *name, const char *sub) +{ + ODR o = gc->odr; + char element[128]; + ILL_System_Id *p; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + p = (ILL_System_Id *) odr_malloc (o, sizeof(*p)); + p->person_or_institution_symbol = ill_get_Person_Or_Insitution_Symbol ( + gc, element, "person-or-institution-symbol"); + p->name_of_person_or_institution = ill_get_Name_Of_Person_Or_Institution ( + gc, element, "name-of-person-or-institution"); + return p; +} + +ILL_Transaction_Id *ill_get_Transaction_Id (struct ill_get_ctl *gc, + const char *name, const char *sub) +{ + ODR o = gc->odr; + ILL_Transaction_Id *r = (ILL_Transaction_Id *) odr_malloc (o, sizeof(*r)); + char element[128]; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + r->initial_requester_id = + ill_get_System_Id (gc, element, "initial-requester-id"); + r->transaction_group_qualifier = + ill_get_ILL_String_x (gc, element, "transaction-group-qualifier", ""); + r->transaction_qualifier = + ill_get_ILL_String_x (gc, element, "transaction-qualifier", ""); + r->sub_transaction_qualifier = + ill_get_ILL_String (gc, element, "sub-transaction-qualifier"); + return r; +} + + +ILL_Service_Date_this *ill_get_Service_Date_this ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + ODR o = gc->odr; + ILL_Service_Date_this *r = + (ILL_Service_Date_this *) odr_malloc (o, sizeof(*r)); + char element[128]; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + r->date = ill_get_ILL_ISO_Date (gc, element, "date", "20000101"); + r->time = ill_get_ILL_ISO_Time (gc, element, "time", 0); + return r; +} + +ILL_Service_Date_original *ill_get_Service_Date_original ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + ODR o = gc->odr; + ILL_Service_Date_original *r = + (ILL_Service_Date_original *) odr_malloc (o, sizeof(*r)); + char element[128]; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + r->date = ill_get_ILL_ISO_Date (gc, element, "date", 0); + r->time = ill_get_ILL_ISO_Time (gc, element, "time", 0); + if (!r->date && !r->time) + return 0; + return r; +} + +ILL_Service_Date_Time *ill_get_Service_Date_Time ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + ODR o = gc->odr; + ILL_Service_Date_Time *r = + (ILL_Service_Date_Time *) odr_malloc (o, sizeof(*r)); + char element[128]; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + r->date_time_of_this_service = ill_get_Service_Date_this ( + gc, element, "this"); + r->date_time_of_original_service = ill_get_Service_Date_original ( + gc, element, "original"); + return r; +} + +ILL_Requester_Optional_Messages_Type *ill_get_Requester_Optional_Messages_Type ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + ODR o = gc->odr; + ILL_Requester_Optional_Messages_Type *r = + (ILL_Requester_Optional_Messages_Type *) odr_malloc (o, sizeof(*r)); + char element[128]; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + r->can_send_RECEIVED = ill_get_bool (gc, element, "can-send-RECEIVED", 0); + r->can_send_RETURNED = ill_get_bool (gc, element, "can-send-RETURNED", 0); + r->requester_SHIPPED = + ill_get_enumerated (gc, element, "requester-SHIPPED", 1); + r->requester_CHECKED_IN = + ill_get_enumerated (gc, element, "requester-CHECKED-IN", 1); + return r; +} + +ILL_Item_Id *ill_get_Item_Id ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + ODR o = gc->odr; + ILL_Item_Id *r = (ILL_Item_Id *) odr_malloc (o, sizeof(*r)); + char element[128]; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + r->item_type = ill_get_enumerated (gc, element, "item-type", + ILL_Item_Id_monograph); + r->held_medium_type = 0; + r->call_number = ill_get_ILL_String(gc, element, "call-number"); + r->author = ill_get_ILL_String(gc, element, "author"); + r->title = ill_get_ILL_String(gc, element, "title"); + r->sub_title = ill_get_ILL_String(gc, element, "sub-title"); + r->sponsoring_body = ill_get_ILL_String(gc, element, "sponsoring-body"); + r->place_of_publication = + ill_get_ILL_String(gc, element, "place-of-publication"); + r->publisher = ill_get_ILL_String(gc, element, "publisher"); + r->series_title_number = + ill_get_ILL_String(gc, element, "series-title-number"); + r->volume_issue = ill_get_ILL_String(gc, element, "volume-issue"); + r->edition = ill_get_ILL_String(gc, element, "edition"); + r->publication_date = ill_get_ILL_String(gc, element, "publication-date"); + r->publication_date_of_component = + ill_get_ILL_String(gc, element, "publication-date-of-component"); + r->author_of_article = ill_get_ILL_String(gc, element, + "author-of-article"); + r->title_of_article = ill_get_ILL_String(gc, element, "title-of-article"); + r->pagination = ill_get_ILL_String(gc, element, "pagination"); + r->national_bibliography_no = 0; + r->iSBN = ill_get_ILL_String(gc, element, "ISBN"); + r->iSSN = ill_get_ILL_String(gc, element, "ISSN"); + r->system_no = 0; + r->additional_no_letters = + ill_get_ILL_String(gc, element, "additional-no-letters"); + r->verification_reference_source = + ill_get_ILL_String(gc, element, "verification-reference-source"); + return r; +} + + +ILL_Client_Id *ill_get_Client_Id ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + char element[128]; + ODR o = gc->odr; + ILL_Client_Id *r = (ILL_Client_Id *) odr_malloc(o, sizeof(*r)); + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + r->client_name = ill_get_ILL_String (gc, element, "client-name"); + r->client_status = ill_get_ILL_String (gc, element, "client-status"); + r->client_identifier = ill_get_ILL_String (gc, element, + "client-identifier"); + return r; +} + +ILL_Postal_Address *ill_get_Postal_Address ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + ODR o = gc->odr; + ILL_Postal_Address *r = + (ILL_Postal_Address *) odr_malloc(o, sizeof(*r)); + char element[128]; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + r->name_of_person_or_institution = + ill_get_Name_Of_Person_Or_Institution ( + gc, element, "name-of-person-or-institution"); + r->extended_postal_delivery_address = + ill_get_ILL_String ( + gc, element, "extended-postal-delivery-address"); + r->street_and_number = + ill_get_ILL_String (gc, element, "street-and-number"); + r->post_office_box = + ill_get_ILL_String (gc, element, "post-office-box"); + r->city = ill_get_ILL_String (gc, element, "city"); + r->region = ill_get_ILL_String (gc, element, "region"); + r->country = ill_get_ILL_String (gc, element, "country"); + r->postal_code = ill_get_ILL_String (gc, element, "postal-code"); + return r; +} + +ILL_System_Address *ill_get_System_Address ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + ODR o = gc->odr; + ILL_System_Address *r = + (ILL_System_Address *) odr_malloc(o, sizeof(*r)); + char element[128]; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + r->telecom_service_identifier = + ill_get_ILL_String (gc, element, "telecom-service-identifier"); + r->telecom_service_address = + ill_get_ILL_String (gc, element, "telecom-service-addreess"); + return r; +} + +ILL_Delivery_Address *ill_get_Delivery_Address ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + ODR o = gc->odr; + ILL_Delivery_Address *r = + (ILL_Delivery_Address *) odr_malloc(o, sizeof(*r)); + char element[128]; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + r->postal_address = + ill_get_Postal_Address (gc, element, "postal-address"); + r->electronic_address = + ill_get_System_Address (gc, element, "electronic-address"); + return r; +} + +ILL_Search_Type *ill_get_Search_Type ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + ODR o = gc->odr; + ILL_Search_Type *r = (ILL_Search_Type *) odr_malloc(o, sizeof(*r)); + char element[128]; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + r->level_of_service = ill_get_ILL_String (gc, element, "level-of-service"); + r->need_before_date = ill_get_ILL_ISO_Date (gc, element, + "need-before-date", 0); + r->expiry_date = ill_get_ILL_ISO_Date (gc, element, "expiry-date", 0); + r->expiry_flag = ill_get_enumerated (gc, element, "expiry-flag", 3); + + return r; +} + +ILL_Request *ill_get_ILLRequest ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + ODR o = gc->odr; + ILL_Request *r = (ILL_Request *) odr_malloc(o, sizeof(*r)); + char element[128]; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + r->protocol_version_num = + ill_get_enumerated (gc, element, "protocol-version-num", + ILL_Request_version_2); + + r->transaction_id = ill_get_Transaction_Id (gc, element, "transaction-id"); + r->service_date_time = + ill_get_Service_Date_Time (gc, element, "service-date-time"); + r->requester_id = ill_get_System_Id (gc, element, "requester-id"); + r->responder_id = ill_get_System_Id (gc, element, "responder-id"); + r->transaction_type = + ill_get_enumerated(gc, element, "transaction-type", 1); + + r->delivery_address = + ill_get_Delivery_Address (gc, element, "delivery-address"); + r->delivery_service = 0; /* TODO */ + /* ill_get_Delivery_Service (gc, element, "delivery-service"); */ + r->billing_address = + ill_get_Delivery_Address (gc, element, "billing-address"); + + r->num_iLL_service_type = 1; + r->iLL_service_type = (ILL_Service_Type **) + odr_malloc (o, sizeof(*r->iLL_service_type)); + *r->iLL_service_type = + ill_get_enumerated (gc, element, "ill-service-type", + ILL_Service_Type_copy_non_returnable); + + r->responder_specific_service = 0; + r->requester_optional_messages = + ill_get_Requester_Optional_Messages_Type ( + gc, element,"requester-optional-messages"); + r->search_type = ill_get_Search_Type(gc, element, "search-type"); + r->num_supply_medium_info_type = 0; + r->supply_medium_info_type = 0; + + r->place_on_hold = ill_get_enumerated ( + gc, element, "place-on-hold", + ILL_Place_On_Hold_Type_according_to_responder_policy); + r->client_id = ill_get_Client_Id (gc, element, "client-id"); + + r->item_id = ill_get_Item_Id (gc, element, "item-id"); + r->supplemental_item_description = 0; + r->cost_info_type = 0; + r->copyright_compliance = + ill_get_ILL_String(gc, element, "copyright-complicance"); + r->third_party_info_type = 0; + r->retry_flag = ill_get_bool (gc, element, "retry-flag", 0); + r->forward_flag = ill_get_bool (gc, element, "forward-flag", 0); + r->requester_note = ill_get_ILL_String(gc, element, "requester-note"); + r->forward_note = ill_get_ILL_String(gc, element, "forward-note"); + r->num_iLL_request_extensions = 0; + r->iLL_request_extensions = 0; + return r; +} + +ILL_ItemRequest *ill_get_ItemRequest ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + ODR o = gc->odr; + ILL_ItemRequest *r = (ILL_ItemRequest *)odr_malloc(o, sizeof(*r)); + char element[128]; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + r->protocol_version_num = + ill_get_enumerated (gc, element, "protocol-version-num", + ILL_Request_version_2); + + r->transaction_id = ill_get_Transaction_Id (gc, element, "transaction-id"); + r->service_date_time = + ill_get_Service_Date_Time (gc, element, "service-date-time"); + r->requester_id = ill_get_System_Id (gc, element, "requester-id"); + r->responder_id = ill_get_System_Id (gc, element, "responder-id"); + r->transaction_type = + ill_get_enumerated(gc, element, "transaction-type", 1); + + r->delivery_address = + ill_get_Delivery_Address (gc, element, "delivery-address"); + r->delivery_service = 0; /* TODO */ + /* ill_get_Delivery_Service (gc, element, "delivery-service"); */ + r->billing_address = + ill_get_Delivery_Address (gc, element, "billing-address"); + + r->num_iLL_service_type = 1; + r->iLL_service_type = (ILL_Service_Type **) + odr_malloc (o, sizeof(*r->iLL_service_type)); + *r->iLL_service_type = + ill_get_enumerated (gc, element, "ill-service-type", + ILL_Service_Type_copy_non_returnable); + + r->responder_specific_service = 0; + r->requester_optional_messages = + ill_get_Requester_Optional_Messages_Type ( + gc, element,"requester-optional-messages"); + r->search_type = ill_get_Search_Type(gc, element, "search-type"); + r->num_supply_medium_info_type = 0; + r->supply_medium_info_type = 0; + + r->place_on_hold = ill_get_enumerated ( + gc, element, "place-on-hold", + ILL_Place_On_Hold_Type_according_to_responder_policy); + r->client_id = ill_get_Client_Id (gc, element, "client-id"); + + r->item_id = ill_get_Item_Id (gc, element, "item-id"); + r->supplemental_item_description = 0; + r->cost_info_type = 0; + r->copyright_compliance = + ill_get_ILL_String(gc, element, "copyright-complicance"); + r->third_party_info_type = 0; + r->retry_flag = ill_get_bool (gc, element, "retry-flag", 0); + r->forward_flag = ill_get_bool (gc, element, "forward-flag", 0); + r->requester_note = ill_get_ILL_String(gc, element, "requester-note"); + r->forward_note = ill_get_ILL_String(gc, element, "forward-note"); + r->num_iLL_request_extensions = 0; + r->iLL_request_extensions = 0; + return r; +} + +ILL_Cancel *ill_get_Cancel ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + ODR o = gc->odr; + ILL_Cancel *r = (ILL_Cancel *)odr_malloc(o, sizeof(*r)); + char element[128]; + + strcpy(element, name); + if (sub) + { + strcat (element, ","); + strcat (element, sub); + } + r->protocol_version_num = + ill_get_enumerated (gc, element, "protocol-version-num", + ILL_Request_version_2); + + r->transaction_id = ill_get_Transaction_Id (gc, element, "transaction-id"); + r->service_date_time = + ill_get_Service_Date_Time (gc, element, "service-date-time"); + r->requester_id = ill_get_System_Id (gc, element, "requester-id"); + r->responder_id = ill_get_System_Id (gc, element, "responder-id"); + r->requester_note = ill_get_ILL_String(gc, element, "requester-note"); + + r->num_cancel_extensions = 0; + r->cancel_extensions = 0; + return r; +} + +ILL_APDU *ill_get_APDU ( + struct ill_get_ctl *gc, const char *name, const char *sub) +{ + ODR o = gc->odr; + ILL_APDU *r = (ILL_APDU *)odr_malloc(o, sizeof(*r)); + char element[128]; + const char *v; + + strcpy (element, name); + strcat (element, ",which"); + + v = (gc->f)(gc->clientData, element); + if (!v) + v = "request"; + if (!strcmp (v, "request")) + { + r->which = ILL_APDU_ILL_Request; + r->u.illRequest = ill_get_ILLRequest(gc, name, sub); + } + else if (!strcmp (v, "cancel")) + { + r->which = ILL_APDU_Cancel; + r->u.Cancel = ill_get_Cancel(gc, name, sub); + } + else + return 0; + return r; +} diff --git a/src/ill.tcl b/src/ill.tcl new file mode 100644 index 0000000..f311497 --- /dev/null +++ b/src/ill.tcl @@ -0,0 +1,63 @@ +# Config File for ILL +# $Id: ill.tcl,v 1.1 2003-10-27 12:21:30 adam Exp $ +# ---------------------------------------------------------- +# Prefix Specifications +# +# 1: C function prefix +# 2: C type prefix +# 3: C preprocessor prefix + +# Default prefix +set default-prefix {ill_ ILL_ ILL_} + +# ---------------------------------------------------------- +set m ISO-10161-ILL-1 + +# Filename +set filename($m) ill-core + +# Header initialization code +set init($m,h) " +" + +# Header body code +set body($m,h) " +#ifdef __cplusplus +extern \"C\" \{ +#endif + +#ifdef __cplusplus +\} +#endif +" + +# C body code +set body($m,c) " +" + +# Some mappings - that map ill_ILL_ to ill_ +set map($m,ILL-APDU) APDU +set map($m,ILL-Request) Request +set map($m,ILL-Answer) Answer +set map($m,ILL-String) String +set map($m,ILL-APDU-Type) APDU_Type +set map($m,ILL-Service-Type) Service_Type +set map($m,Service_Date_Time_0) Service_Date_this +set map($m,Service_Date_Time_1) Service_Date_original +set map($m,Overdue_0) Overdue_ExtensionS +set membermap($m,APDU,ILL-Request) {APDU_ILL_Request illRequest} +set membermap($m,APDU,ILL-Answer) {APDU_ILL_Answer illAnswer} + +# ---------------------------------------------------------- +set m Z39.50-extendedService-ItemOrder-ItemRequest-1 +# Filename +set filename($m) item-req + +# Mappings of a few basic types +proc asnBasicPrintableString {} { + return {odr_visiblestring char} +} + +proc asnBasicANY {} { + return {odr_any Odr_any} +} diff --git a/src/ill9702.asn b/src/ill9702.asn new file mode 100644 index 0000000..e947489 --- /dev/null +++ b/src/ill9702.asn @@ -0,0 +1,1165 @@ +-- use of parameters and types is to be consistent with their definitions in clause 3 + +ISO-10161-ILL-1 DEFINITIONS EXPLICIT TAGS ::= + +BEGIN +-- ISO-10161-ILL-1 refers to the ILL ISO standard 10161 version 1 +-- and version 2 as specified in ISO standard 10161 Amendment 1 + +ILL-APDU ::= CHOICE { + ILL-Request, + Forward-Notification, + Shipped, + ILL-Answer, + Conditional-Reply, + Cancel, + Cancel-Reply, + Received, + Recall, + Returned, + Checked-In, + Overdue, + Renew, + Renew-Answer, + Lost, + Damaged, + Message, + Status-Query, + Status-Or-Error-Report, + Expired + } + +-- The tagging scheme used in the APDU definitions is as follows: +-- each named type that is a component type of an APDU definition is assigned a different tag +-- that is unique within the set of APDU definitions. Where these component types themselves +-- have structure, the tagging within such type definitions has only local scope. + +ILL-Request ::= [APPLICATION 1] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + transaction-type [5] IMPLICIT Transaction-Type DEFAULT 1, + delivery-address [6] IMPLICIT Delivery-Address OPTIONAL, + delivery-service Delivery-Service OPTIONAL, + billing-address [8] IMPLICIT Delivery-Address OPTIONAL, + iLL-service-type [9] IMPLICIT SEQUENCE SIZE (1..5) OF + ILL-Service-Type, + -- this sequence is a list, in order of preference + responder-specific-service [10] EXTERNAL OPTIONAL, + -- use direct reference style + requester-optional-messages [11] IMPLICIT Requester-Optional-Messages-Type, + search-type [12] IMPLICIT Search-Type OPTIONAL, + supply-medium-info-type [13] IMPLICIT SEQUENCE SIZE (1..7) OF + Supply-Medium-Info-Type OPTIONAL, + -- this sequence is a list, in order of preference, + -- with a maximum number of 7 entries + place-on-hold [14] IMPLICIT Place-On-Hold-Type DEFAULT 3, + client-id [15] IMPLICIT Client-Id OPTIONAL, + item-id [16] IMPLICIT Item-Id, + supplemental-item-description [17] IMPLICIT Supplemental-Item-Description OPTIONAL, + cost-info-type [18] IMPLICIT Cost-Info-Type OPTIONAL, + copyright-compliance [19] ILL-String OPTIONAL, + third-party-info-type [20] IMPLICIT Third-Party-Info-Type OPTIONAL, + -- mandatory when initiating a FORWARD service or an + -- ILL-REQUEST service for a partitioned ILL sub- + -- transaction or when initiating an ILL-REQUEST service for + -- an ILL sub-transaction if the received ILL-REQUEST + -- included an "already-tried-list";optional otherwise + retry-flag [21] IMPLICIT BOOLEAN DEFAULT FALSE, + forward-flag [22] IMPLICIT BOOLEAN DEFAULT FALSE, + requester-note [46] ILL-String OPTIONAL, + forward-note [47] ILL-String OPTIONAL, + iLL-request-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Forward-Notification ::= [APPLICATION 2] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id, + -- mandatory in this APDU + responder-address [24] IMPLICIT System-Address OPTIONAL, + intermediary-id [25] IMPLICIT System-Id, + notification-note [48] ILL-String OPTIONAL, + forward-notification-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Shipped ::= [APPLICATION 3] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-address [24] IMPLICIT System-Address OPTIONAL, + intermediary-id [25] IMPLICIT System-Id OPTIONAL, + supplier-id [26] IMPLICIT System-Id OPTIONAL, + client-id [15] IMPLICIT Client-Id OPTIONAL, + transaction-type [5] IMPLICIT Transaction-Type DEFAULT 1, + supplemental-item-description [17] IMPLICIT Supplemental-Item-Description OPTIONAL, + shipped-service-type [27] IMPLICIT Shipped-Service-Type, + responder-optional-messages [28] IMPLICIT Responder-Optional-Messages-Type + OPTIONAL, + supply-details [29] IMPLICIT Supply-Details, + return-to-address [30] IMPLICIT Postal-Address OPTIONAL, + responder-note [46] ILL-String OPTIONAL, + shipped-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +ILL-Answer ::= [APPLICATION 4] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + transaction-results [31] IMPLICIT Transaction-Results, + results-explanation [32] CHOICE { + conditional-results [1] Conditional-Results, + -- chosen if transaction-results=CONDITIONAL + retry-results [2] Retry-Results, + -- chosen if transaction-results=RETRY + unfilled-results [3] Unfilled-Results, + --chosen if transaction-results=UNFILLED + locations-results [4] Locations-Results, + -- chosen if transaction-results=LOCATIONS-PROVIDED + will-supply-results [5] Will-Supply-Results, + -- chosen if transaction-results=WILL-SUPPLY + hold-placed-results [6] Hold-Placed-Results, + -- chosen if transaction-results=HOLD-PLACED + estimate-results [7] Estimate-Results + -- chosen if transaction-results=ESTIMATE + } OPTIONAL, + -- optional if transaction-results equals RETRY, UNFILLED, + -- WILL-SUPPLY or HOLD-PLACED; + -- required if transaction-results equals CONDITIONAL, + -- LOCATIONS-PROVIDED or ESTIMATE + responder-specific-results [33] EXTERNAL OPTIONAL, + -- this type is mandatory if results-explanation + -- chosen for any result + -- has the value "responder-specific". + supplemental-item-description [17] IMPLICIT Supplemental-Item-Description OPTIONAL, + send-to-list [23] IMPLICIT Send-To-List-Type OPTIONAL, + already-tried-list [34] IMPLICIT Already-Tried-List-Type OPTIONAL, + responder-optional-messages [28] IMPLICIT Responder-Optional-Messages-Type + OPTIONAL, + responder-note [46] ILL-String OPTIONAL, + ill-answer-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Conditional-Reply ::= [APPLICATION 5] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + answer [35] IMPLICIT BOOLEAN, + requester-note [46] ILL-String OPTIONAL, + conditional-reply-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Cancel ::= [APPLICATION 6] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + requester-note [46] ILL-String OPTIONAL, + cancel-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Cancel-Reply ::= [APPLICATION 7] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + answer [35] IMPLICIT BOOLEAN, + responder-note [46] ILL-String OPTIONAL, + cancel-reply-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Received ::= [APPLICATION 8] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + supplier-id [26] IMPLICIT System-Id OPTIONAL, + supplemental-item-description [17] IMPLICIT Supplemental-Item-Description OPTIONAL, + date-received [36] IMPLICIT ISO-Date, + shipped-service-type [27] IMPLICIT Shipped-Service-Type, + requester-note [46] ILL-String OPTIONAL, + received-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Recall ::= [APPLICATION 9] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-note [46] ILL-String OPTIONAL, + recall-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Returned ::= [APPLICATION 10] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + supplemental-item-description [17] IMPLICIT Supplemental-Item-Description OPTIONAL, + date-returned [37] IMPLICIT ISO-Date, + returned-via [38] Transportation-Mode OPTIONAL, + insured-for [39] IMPLICIT Amount OPTIONAL, + requester-note [46] ILL-String OPTIONAL, + returned-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Checked-In ::= [APPLICATION 11] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + date-checked-in [40] IMPLICIT ISO-Date, + responder-note [46] ILL-String OPTIONAL, + checked-in-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Overdue ::= [APPLICATION 12] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + date-due [41] IMPLICIT Date-Due, + responder-note [46] ILL-String OPTIONAL, + overdue-extensions [49] SEQUENCE OF Extension OPTIONAL + } + +Renew ::= [APPLICATION 13] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + desired-due-date [42] IMPLICIT ISO-Date OPTIONAL, + requester-note [46] ILL-String OPTIONAL, + renew-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Renew-Answer ::= [APPLICATION 14] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + answer [35] IMPLICIT BOOLEAN, + date-due [41] IMPLICIT Date-Due OPTIONAL, + responder-note [46] ILL-String OPTIONAL, + renew-answer-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Lost ::= [APPLICATION 15] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + note [46] ILL-String OPTIONAL, + lost-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Damaged ::= [APPLICATION 16] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + damaged-details [5] IMPLICIT Damaged-Details OPTIONAL, + -- this parameter may only be present in APDU's with a + -- protocol-version-num value of 2 or greater + note [46] ILL-String OPTIONAL, + damaged-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Message ::= [APPLICATION 17] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + note [46] ILL-String, + message-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Status-Query ::= [APPLICATION 18] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + note [46] ILL-String OPTIONAL, + status-query-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Status-Or-Error-Report ::= [APPLICATION 19] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + reason-no-report [43] IMPLICIT Reason-No-Report OPTIONAL, + -- mandatory if no report is present; + -- not present otherwise + status-report [44] IMPLICIT Status-Report OPTIONAL, + error-report [45] IMPLICIT Error-Report OPTIONAL, + note [46] ILL-String OPTIONAL, + status-or-error-report-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Expired ::= [APPLICATION 20] SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id, + service-date-time [2] IMPLICIT Service-Date-Time, + requester-id [3] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + responder-id [4] IMPLICIT System-Id OPTIONAL, + -- mandatory when using store-and-forward communications + -- optional when using connection-oriented communications + expired-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } + +Account-Number ::= ILL-String + +Already-Forwarded ::= SEQUENCE { + responder-id [0] IMPLICIT System-Id, + responder-address [1] IMPLICIT System-Address OPTIONAL + } + +Already-Tried-List-Type ::= SEQUENCE OF System-Id + +Amount ::= SEQUENCE { + currency-code [0] IMPLICIT PrintableString (SIZE (3)) OPTIONAL, + -- values defined in ISO 4217-1981 + monetary-value [1] IMPLICIT AmountString (SIZE (1..10)) + } + +AmountString ::= PrintableString (FROM ("1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"|"0"|" "|"."|",")) + +Client-Id ::= SEQUENCE { + client-name [0] ILL-String OPTIONAL, + client-status [1] ILL-String OPTIONAL, + client-identifier [2] ILL-String OPTIONAL + } + +Conditional-Results ::= SEQUENCE { + conditions [0] IMPLICIT ENUMERATED { + cost-exceeds-limit (13), + charges (14), + prepayment-required (15), + lacks-copyright-compliance (16), + library-use-only (22), + no-reproduction (23), + client-signature-required (24), + special-collections-supervision-required (25), + other (27), + responder-specific (28), + proposed-delivery-service (30) + }, + date-for-reply [1] IMPLICIT ISO-Date OPTIONAL, + locations [2] IMPLICIT SEQUENCE OF Location-Info OPTIONAL, + proposed-delivery-service Delivery-Service OPTIONAL + -- this parameter specifies a proposed delivery service the + -- acceptance of which is a condition of supply. It may be a + -- physical service or an electronic service. This parameter + -- may only be present in APDUs with a + -- protocol-version-num value of 2 or greater + } + +Cost-Info-Type ::= SEQUENCE { + account-number [0] Account-Number OPTIONAL, + maximum-cost [1] IMPLICIT Amount OPTIONAL, + reciprocal-agreement [2] IMPLICIT BOOLEAN DEFAULT FALSE, + will-pay-fee [3] IMPLICIT BOOLEAN DEFAULT FALSE, + payment-provided [4] IMPLICIT BOOLEAN DEFAULT FALSE + } + +Current-State ::= ENUMERATED { + nOT-SUPPLIED (1), + pENDING (2), + iN-PROCESS (3), + fORWARD (4), + cONDITIONAL (5), + cANCEL-PENDING (6), + cANCELLED (7), + sHIPPED (8), + rECEIVED (9), + rENEW-PENDING (10), + nOT-RECEIVED-OVERDUE (11), + rENEW-OVERDUE (12), + oVERDUE (13), + rETURNED (14), + cHECKED-IN (15), + rECALL (16), + lOST (17), + uNKNOWN (18) + } + +Damaged-Details ::= SEQUENCE { + document-type-id [0] IMPLICIT OBJECT IDENTIFIER OPTIONAL, + -- identifies an OSI document type registered in accordance + -- with ISO 9834-2, for use in an automated environment + damaged-portion CHOICE { + complete-document [1] IMPLICIT NULL, + specific-units [2] IMPLICIT SEQUENCE + OF INTEGER + -- the nature and extent of a "unit" is implicit in the + -- value of document-type-id if one is supplied + } + } + +Date-Due ::= SEQUENCE { + date-due-field [0] IMPLICIT ISO-Date, + renewable [1] IMPLICIT BOOLEAN DEFAULT TRUE + } + +Delivery-Address ::= SEQUENCE { + postal-address [0] IMPLICIT Postal-Address OPTIONAL, + electronic-address [1] IMPLICIT System-Address OPTIONAL + } + +Delivery-Service ::= CHOICE { + physical-delivery [7] Transportation-Mode, + electronic-delivery [50] IMPLICIT SEQUENCE OF Electronic-Delivery-Service + -- electronic-delivery may only be present in APDUs + -- with a protocol-version-num value of 2 or greater + } + +Electronic-Delivery-Service ::= SEQUENCE { + -- the first four parameters are intended to be used in an automated + -- environment + e-delivery-service [0] IMPLICIT SEQUENCE { + -- identifies the kind of electronic delivery service, e.g. + -- MOTIS IPM,FTAM, etc., using the assigned object + -- identifier for the standard e.g. {joint-iso-ccitt mhs-motis + -- ipms} + e-delivery-mode [0] IMPLICIT OBJECT IDENTIFIER, + e-delivery-parameters [1] ANY DEFINED BY e-delivery-mode + } OPTIONAL, + document-type [1] IMPLICIT SEQUENCE { + document-type-id [2] IMPLICIT OBJECT IDENTIFIER, + -- identifies an OSI document type registered in accordance + -- with ISO 9834-2 + document-type-parameters [3] ANY DEFINED BY document-type-id + -- any parameters relating to the registered document type + } OPTIONAL, + e-delivery-description [4] ILL-String OPTIONAL, + -- holds a human readable name or description of the + -- required electronic delivery service and document type; + -- this may also be used to identify an electronic delivery + -- service for which there is no object identifier. + -- This parameter may be present instead of, or in addition + -- to, the previous 4 parameters + e-delivery-details [5] CHOICE { + e-delivery-address [0] IMPLICIT System-Address, + e-delivery-id [1] IMPLICIT System-Id + }, + name-or-code [6] ILL-String OPTIONAL, + -- holds a human-readable identifier or correlation + -- information for the document as shipped, e.g. a directory + -- and/or file name or message-id + delivery-time [7] IMPLICIT ISO-Time OPTIONAL + -- holds the requester's preferred delivery time or + -- the responder's proposed or actual delivery time + } + +Error-Report ::= SEQUENCE { + correlation-information [0] ILL-String, + report-source [1] IMPLICIT Report-Source, + user-error-report [2] User-Error-Report OPTIONAL, + -- mandatory if report-source is "user"; not present otherwise + provider-error-report [3] Provider-Error-Report OPTIONAL + -- mandatory if report-source is "provider"; not + -- present otherwise + } + +Estimate-Results ::= SEQUENCE { + cost-estimate [0] ILL-String, + locations [1] IMPLICIT SEQUENCE OF Location-Info OPTIONAL + } + +Extension ::= SEQUENCE { + identifier [0] IMPLICIT INTEGER, + critical [1] IMPLICIT BOOLEAN DEFAULT FALSE, + item [2] ANY DEFINED BY identifier + } + +General-Problem ::= ENUMERATED { + unrecognized-APDU (1), + mistyped-APDU (2), + badly-structured-APDU (3), + protocol-version-not-supported (4), + other (5) + } + +History-Report ::= SEQUENCE { + date-requested [0] IMPLICIT ISO-Date OPTIONAL, + author [1] ILL-String OPTIONAL, + title [2] ILL-String OPTIONAL, + author-of-article [3] ILL-String OPTIONAL, + title-of-article [4] ILL-String OPTIONAL, + date-of-last-transition [5] IMPLICIT ISO-Date, + most-recent-service [6] IMPLICIT ENUMERATED { + iLL-REQUEST (1), + fORWARD (21), + fORWARD-NOTIFICATION (2), + sHIPPED (3), + iLL-ANSWER (4), + cONDITIONAL-REPLY (5), + cANCEL (6), + cANCEL-REPLY (7), + rECEIVED (8), + rECALL (9), + rETURNED (10), + cHECKED-IN (11), + rENEW-ANSWER (14), + lOST (15), + dAMAGED (16), + mESSAGE (17), + sTATUS-QUERY (18), + sTATUS-OR-ERROR-REPORT (19), + eXPIRED (20) + }, + date-of-most-recent-service [7] IMPLICIT ISO-Date, + initiator-of-most-recent-service [8] IMPLICIT System-Id, + shipped-service-type [9] IMPLICIT Shipped-Service-Type OPTIONAL, + -- If the information is available, i.e. if a SHIPPED or + -- RECEIVED APDU has been sent or received, then the + -- value in this parameter shall be supplied. + -- Value must contain the most current information, e.g. if a + -- requester has received a SHIPPED APDU and then + -- invokes a RECEIVED.request, then the value from the + -- RECEIVED.request is used + transaction-results [10] IMPLICIT Transaction-Results OPTIONAL, + -- If the information is available, i.e. if an ILL-ANWSER + -- APDU has been sent or received, then the value in this + -- parameter shall be supplied. + most-recent-service-note [11] ILL-String OPTIONAL + -- If the information is available, i.e. if a note has been + -- supplied in the most recent service primitive, then the + -- value in this parameter shall be supplied. + } + +Hold-Placed-Results ::= SEQUENCE { + estimated-date-available [0] IMPLICIT ISO-Date, + hold-placed-medium-type [1] IMPLICIT Medium-Type OPTIONAL, + locations [2] IMPLICIT SEQUENCE OF Location-Info OPTIONAL + } + +ILL-APDU-Type ::= ENUMERATED { + iLL-REQUEST (1), + fORWARD-NOTIFICATION (2), + sHIPPED (3), + iLL-ANSWER (4), + cONDITIONAL-REPLY (5), + cANCEL (6), + cANCEL-REPLY (7), + rECEIVED (8), + rECALL (9), + rETURNED (10), + cHECKED-IN (11), + oVERDUE (12), + rENEW (13), + rENEW-ANSWER (14), + lOST (15), + dAMAGED (16), + mESSAGE (17), + sTATUS-QUERY (18), + sTATUS-OR-ERROR-REPORT (19), + eXPIRED (20) + } + +ILL-Service-Type ::= ENUMERATED { + loan (1), + copy-non-returnable (2), + locations (3), + estimate (4), + responder-specific (5) + } + +ILL-String ::= CHOICE { + GeneralString, + -- may contain any ISO registered G (graphic) and C + -- (control) character set + EDIFACTString + } + -- may not include leading or trailing spaces + -- may not consist only of space (" ") or non-printing + -- characters + +Intermediary-Problem ::= ENUMERATED { + cannot-send-onward (1) + } + +ISO-Date ::= VisibleString + -- conforms to ISO 8601 + -- length = 8 + -- fixed + -- YYYYMMDD + +ISO-Time ::= VisibleString + -- conforms to ISO 8601 + -- length = 6, + -- fixed + -- HHMMSS + -- local time of person or institution invoking service + +Item-Id ::= SEQUENCE { + item-type [0] IMPLICIT ENUMERATED { + monograph (1), + serial (2), + other (3) + } OPTIONAL, + held-medium-type [1] IMPLICIT Medium-Type OPTIONAL, + call-number [2] ILL-String OPTIONAL, + author [3] ILL-String OPTIONAL, + title [4] ILL-String OPTIONAL, + sub-title [5] ILL-String OPTIONAL, + sponsoring-body [6] ILL-String OPTIONAL, + place-of-publication [7] ILL-String OPTIONAL, + publisher [8] ILL-String OPTIONAL, + series-title-number [9] ILL-String OPTIONAL, + volume-issue [10] ILL-String OPTIONAL, + edition [11] ILL-String OPTIONAL, + publication-date [12] ILL-String OPTIONAL, + publication-date-of-component [13] ILL-String OPTIONAL, + author-of-article [14] ILL-String OPTIONAL, + title-of-article [15] ILL-String OPTIONAL, + pagination [16] ILL-String OPTIONAL, + national-bibliography-no [17] EXTERNAL OPTIONAL, + iSBN [18] ILL-String (SIZE (10)) OPTIONAL, + -- must conform to ISO 2108-1978 + iSSN [19] ILL-String (SIZE (8)) OPTIONAL, + -- must conform to ISO 3297-1986 + system-no [20] EXTERNAL OPTIONAL, + additional-no-letters [21] ILL-String OPTIONAL, + verification-reference-source [22] ILL-String OPTIONAL + } + +Location-Info ::= SEQUENCE { + location-id [0] IMPLICIT System-Id, + location-address [1] IMPLICIT System-Address OPTIONAL, + location-note [2] ILL-String OPTIONAL + } + +Locations-Results ::= SEQUENCE { + reason-locs-provided [0] IMPLICIT Reason-Locs-Provided OPTIONAL, + locations [1] IMPLICIT SEQUENCE OF Location-Info + } + +Medium-Type ::= ENUMERATED { + printed (1), + microform (3), + film-or-video-recording (4), + audio-recording (5), + machine-readable (6), + other (7) + } + +Name-Of-Person-Or-Institution ::= CHOICE { + name-of-person [0] ILL-String, + name-of-institution [1] ILL-String + } + +Person-Or-Institution-Symbol ::= CHOICE { + person-symbol [0] ILL-String, + institution-symbol [1] ILL-String + } + +Place-On-Hold-Type ::= ENUMERATED { + yes (1), + no (2), + according-to-responder-policy (3) + } + +Postal-Address ::= SEQUENCE { + name-of-person-or-institution [0] Name-Of-Person-Or-Institution OPTIONAL, + extended-postal-delivery-address [1] ILL-String OPTIONAL, + street-and-number [2] ILL-String OPTIONAL, + post-office-box [3] ILL-String OPTIONAL, + city [4] ILL-String OPTIONAL, + region [5] ILL-String OPTIONAL, + country [6] ILL-String OPTIONAL, + postal-code [7] ILL-String OPTIONAL + } + +Provider-Error-Report ::= CHOICE { + general-problem [0] IMPLICIT General-Problem, + transaction-id-problem [1] IMPLICIT Transaction-Id-Problem, + state-transition-prohibited [2] IMPLICIT State-Transition-Prohibited + } + +Reason-Locs-Provided ::= ENUMERATED { + in-use-on-loan (1), + in-process (2), + lost (3), + non-circulating (4), + not-owned (5), + on-order (6), + volume-issue-not-yet-available (7), + at-bindery (8), + lacking (9), + not-on-shelf (10), + on-reserve (11), + poor-condition (12), + cost-exceeds-limit (13), + on-hold (19), + other (27), + responder-specific (28) + } + +Reason-No-Report ::= ENUMERATED { + temporary (1), + permanent (2) + } + +Reason-Unfilled ::= ENUMERATED { + in-use-on-loan (1), + in-process (2), + lost (3), + non-circulating (4), + not-owned (5), + on-order (6), + volume-issue-not-yet-available (7), + at-bindery (8), + lacking (9), + not-on-shelf (10), + on-reserve (11), + poor-condition (12), + cost-exceeds-limit (13), + charges (14), + prepayment-required (15), + lacks-copyright-compliance (16), + not-found-as-cited (17), + locations-not-found (18), + on-hold (19), + policy-problem (20), + mandatory-messaging-not-supported (21), + expiry-not-supported (22) , + requested-delivery-services-not-supported (23), + preferred-delivery-time-not-possible (24), + other (27), + responder-specific (28) + } + +Report-Source ::= ENUMERATED { + user (1), + provider (2) + } + +Requester-Optional-Messages-Type ::= SEQUENCE { + can-send-RECEIVED [0] IMPLICIT BOOLEAN, + can-send-RETURNED [1] IMPLICIT BOOLEAN, + requester-SHIPPED [2] IMPLICIT ENUMERATED { + requires (1), + desires (2), + neither (3) + }, + requester-CHECKED-IN [3] IMPLICIT ENUMERATED { + requires (1), + desires (2), + neither (3) + } + } + +Responder-Optional-Messages-Type ::= SEQUENCE { + can-send-SHIPPED [0] IMPLICIT BOOLEAN, + can-send-CHECKED-IN [1] IMPLICIT BOOLEAN, + responder-RECEIVED [2] IMPLICIT ENUMERATED { + requires (1), + desires (2), + neither (3) + }, + responder-RETURNED [3] IMPLICIT ENUMERATED { + requires (1), + desires (2), + neither (3) + } + } + +Retry-Results ::= SEQUENCE { + reason-not-available [0] IMPLICIT ENUMERATED { + in-use-on-loan (1), + in-process (2), + on-order (6), + volume-issue-not-yet-available (7), + at-bindery (8), + cost-exceeds-limit (13), + charges (14), + prepayment-required (15), + lacks-copyright-compliance (16), + not-found-as-cited (17), + on-hold (19), + other (27), + responder-specific (28) + } OPTIONAL, + retry-date [1] IMPLICIT ISO-Date OPTIONAL, + locations [2] IMPLICIT SEQUENCE OF Location-Info OPTIONAL + } + +Search-Type ::= SEQUENCE { + level-of-service [0] ILL-String (SIZE (1)) OPTIONAL, + need-before-date [1] IMPLICIT ISO-Date OPTIONAL, + expiry-flag [2] IMPLICIT ENUMERATED { + need-Before-Date (1), + other-Date (2), + no-Expiry (3) + } DEFAULT 3, + -- value of "need-Before-Date" indicates that + -- need-before-date also specifies transaction expiry + -- date + expiry-date [3] IMPLICIT ISO-Date OPTIONAL + -- alternative expiry date can be used only when expiry-flag + -- is set to "Other-Date" + } + +Security-Problem ::= ILL-String + +Send-To-List-Type ::= SEQUENCE OF SEQUENCE { + system-id [0] IMPLICIT System-Id, + account-number [1] Account-Number OPTIONAL, + system-address [2] IMPLICIT System-Address OPTIONAL + } + +Service-Date-Time ::= SEQUENCE { + date-time-of-this-service [0] IMPLICIT SEQUENCE { + date [0] IMPLICIT ISO-Date, + time [1] IMPLICIT ISO-Time OPTIONAL + -- mandatory for 2nd and subsequent services + -- invoked for a given + -- ILL-transaction on the same day + }, + date-time-of-original-service [1] IMPLICIT SEQUENCE { + date [0] IMPLICIT ISO-Date, + time [1] IMPLICIT ISO-Time OPTIONAL + } OPTIONAL + } + +Shipped-Service-Type ::= ILL-Service-Type (loan | copy-non-returnable) + -- subtype of ILL-Service-Type + +State-Transition-Prohibited ::= SEQUENCE { + aPDU-type [0] IMPLICIT ILL-APDU-Type, + current-state [1] IMPLICIT Current-State + } + +Status-Report ::= SEQUENCE { + user-status-report [0] IMPLICIT History-Report, + provider-status-report [1] IMPLICIT Current-State + } + +Supplemental-Item-Description ::= SEQUENCE OF EXTERNAL + -- the syntax of supplementary item description information is defined outside this standard + +Supply-Details ::= SEQUENCE { + date-shipped [0] IMPLICIT ISO-Date OPTIONAL, + date-due [1] IMPLICIT Date-Due OPTIONAL, + chargeable-units [2] IMPLICIT INTEGER (1..9999) OPTIONAL, + cost [3] IMPLICIT Amount OPTIONAL, + shipped-conditions [4] IMPLICIT ENUMERATED { + library-use-only (22), + no-reproduction (23), + client-signature-required (24), + special-collections-supervision-required (25), + other (27) + } OPTIONAL, + shipped-via CHOICE { + physical-delivery [5] Transportation-Mode, + electronic-delivery [50] IMPLICIT + Electronic-Delivery-Service + } OPTIONAL, + -- electronic-delivery may only be present in APDUs with a + -- protocol-version-num value of 2 or greater + insured-for [6] IMPLICIT Amount OPTIONAL, + return-insurance-require [7] IMPLICIT Amount OPTIONAL, + no-of-units-per-medium [8] IMPLICIT SEQUENCE OF Units-Per-Medium-Type + OPTIONAL + } + +Supply-Medium-Info-Type ::= SEQUENCE { + supply-medium-type [0] IMPLICIT Supply-Medium-Type, + medium-characteristics [1] ILL-String OPTIONAL + } + +Supply-Medium-Type ::= ENUMERATED { + printed (1), + photocopy (2), + microform (3), + film-or-video-recording (4), + audio-recording (5), + machine-readable (6), + other (7) + } + +System-Address ::= SEQUENCE { + telecom-service-identifier [0] ILL-String OPTIONAL, + telecom-service-address [1] ILL-String OPTIONAL + } + +System-Id ::= SEQUENCE { + --at least one of the following must be present + person-or-institution-symbol [0] Person-Or-Institution-Symbol OPTIONAL, + name-of-person-or-institution [1] Name-Of-Person-Or-Institution OPTIONAL + } + +Third-Party-Info-Type ::= SEQUENCE { + permission-to-forward [0] IMPLICIT BOOLEAN DEFAULT FALSE, + permission-to-chain [1] IMPLICIT BOOLEAN DEFAULT FALSE, + permission-to-partition [2] IMPLICIT BOOLEAN DEFAULT FALSE, + permission-to-change-send-to-list [3] IMPLICIT BOOLEAN DEFAULT FALSE, + initial-requester-address [4] IMPLICIT System-Address OPTIONAL, + -- mandatory when initiating a FORWARD service or an + -- ILL-REQUEST service for a partitioned ILL + -- sub-transaction; optional otherwise + preference [5] IMPLICIT ENUMERATED { + ordered (1), + unordered (2) + } DEFAULT 2, + send-to-list [6] IMPLICIT Send-To-List-Type OPTIONAL, + already-tried-list [7] IMPLICIT Already-Tried-List-Type OPTIONAL + -- mandatory when initiating a FORWARD service, or when + -- initiating an ILL-REQUEST service for an ILL + -- sub-transaction if the received ILL-REQUEST included an + -- "already-tried-list"; optional otherwise + } + +Transaction-Id ::= SEQUENCE { + initial-requester-id [0] IMPLICIT System-Id OPTIONAL, + -- mandatory for sub-transactions; not called + -- "requester-id" to distinguish id of initial-requester + --from id of requester of sub-transaction if there is one + transaction-group-qualifier [1] ILL-String, + transaction-qualifier [2] ILL-String, + sub-transaction-qualifier [3] ILL-String OPTIONAL + -- mandatory for sub-transactions + } + +Transaction-Id-Problem ::= ENUMERATED { + duplicate-transaction-id (1), + invalid-transaction-id (2), + unknown-transaction-id (3) + } + +Transaction-Results ::= ENUMERATED { + conditional (1), + retry (2), + unfilled (3), + locations-provided (4), + will-supply (5), + hold-placed (6), + estimate (7) + } + +Transaction-Type ::= ENUMERATED { + simple (1), + chained (2), + partitioned (3) + } + +Transportation-Mode ::= ILL-String + +Unable-To-Perform ::= ENUMERATED { + not-available (1), + resource-limitation (2), + other (3) + } + +Unfilled-Results ::= SEQUENCE { + reason-unfilled [0] IMPLICIT Reason-Unfilled, + locations [1] IMPLICIT SEQUENCE OF Location-Info OPTIONAL + } + +Units-Per-Medium-Type ::= SEQUENCE { + medium [0] Supply-Medium-Type, + no-of-units [1] INTEGER (1..9999) + } + +User-Error-Report ::= CHOICE { + already-forwarded [0] IMPLICIT Already-Forwarded, + intermediary-problem [1] IMPLICIT Intermediary-Problem, + security-problem [2] Security-Problem, + unable-to-perform [3] IMPLICIT Unable-To-Perform + } + + +Will-Supply-Results ::= SEQUENCE { + reason-will-supply [0] ENUMERATED { + in-use-on-loan (1), + in-process (2), + on-order (6), + at-bindery (8), + on-hold (19), + being-processed-for-supply (26), + other (27), + responder-specific (28), + electronic-delivery (30) + }, + supply-date [1] ISO-Date OPTIONAL, + return-to-address [2] Postal-Address OPTIONAL, + locations [3] IMPLICIT SEQUENCE OF Location-Info OPTIONAL, + electronic-delivery-service [4] Electronic-Delivery-Service OPTIONAL + -- if present, this must be one of the services proposed by + -- the requester + } + +EDIFACTString ::= VisibleString + (FROM ("A"|"B"|"C"|"D"|"E"|"F"|"G"|"H"| + "I"|"J"|"K"|"L"|"M"|"N"|"O"|"P"|"Q"|"R"|"S"|"T"|"U"| + "V"|"W"|"X"|"Y"|"Z"|"a"|"b"|"c"|"d"|"e"|"f"|"g"|"h"| + "i"|"j"|"k"|"l"|"m"|"n"|"o"|"p"|"q"|"r"|"s"|"t"|"u"| + "v"|"w"|"x"|"y"|"z"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"| + "9"|"0"|" "|"."|","|"-"|"("|")"|"/"|"="|"!"|"""|"%"|"&"| + "*"|";"|"<"|">"|"'"|"+"|":"|"?")) + +END + + diff --git a/src/item-req.asn b/src/item-req.asn new file mode 100644 index 0000000..612d509 --- /dev/null +++ b/src/item-req.asn @@ -0,0 +1,58 @@ +Z39.50-extendedService-ItemOrder-ItemRequest-1 DEFINITIONS ::= +BEGIN +IMPORTS + Transaction-Id, + Service-Date-Time, + System-Id, + Transaction-Type, + Delivery-Address, + ILL-Service-Type, + Requester-Optional-Messages-Type, + Search-Type, + Supply-Medium-Info-Type, + Place-On-Hold-Type, + Client-Id, + Item-Id, + Supplemental-Item-Description, + Cost-Info-Type, + ILL-String, + Third-Party-Info-Type, + Extension +FROM ISO-10161-ILL-1; + +ItemRequest ::=SEQUENCE { + protocol-version-num [0] IMPLICIT INTEGER { + version-1 (1), + version-2 (2) + }, + transaction-id [1] IMPLICIT Transaction-Id OPTIONAL, + service-date-time [2] IMPLICIT Service-Date-Time OPTIONAL, + requester-id [3] IMPLICIT System-Id OPTIONAL, + responder-id [4] IMPLICIT System-Id OPTIONAL, + transaction-type [5] IMPLICIT Transaction-Type DEFAULT 1, + delivery-address [6] IMPLICIT Delivery-Address OPTIONAL, + delivery-service Delivery-Service OPTIONAL, + billing-address [8] IMPLICIT Delivery-Address OPTIONAL, + iLL-service-type [9] IMPLICIT SEQUENCE SIZE (1..5) OF + ILL-Service-Type OPTIONAL, + responder-specific-service [10] EXTERNAL OPTIONAL, + -- use direct reference style + requester-optional-messages [11] IMPLICIT Requester-Optional-Messages-Type OPTIONAL, + search-type [12] IMPLICIT Search-Type OPTIONAL, + supply-medium-info-type [13] IMPLICIT SEQUENCE SIZE (1..7) OF + Supply-Medium-Info-Type OPTIONAL, + place-on-hold [14] IMPLICIT Place-On-Hold-Type DEFAULT 3, + client-id [15] IMPLICIT Client-Id OPTIONAL, + item-id [16] IMPLICIT Item-Id OPTIONAL, + supplemental-item-description [17] IMPLICIT Supplemental-Item-Description OPTIONAL, + cost-info-type [18] IMPLICIT Cost-Info-Type OPTIONAL, + copyright-compliance [19] ILL-String OPTIONAL, + third-party-info-type [20] IMPLICIT Third-Party-Info-Type OPTIONAL, + retry-flag [21] IMPLICIT BOOLEAN DEFAULT FALSE, + forward-flag [22] IMPLICIT BOOLEAN DEFAULT FALSE, + requester-note [46] ILL-String OPTIONAL, + forward-note [47] ILL-String OPTIONAL, + iLL-request-extensions [49] IMPLICIT SEQUENCE OF Extension OPTIONAL + } +END + diff --git a/src/lexer.h b/src/lexer.h new file mode 100644 index 0000000..6c8a3b4 --- /dev/null +++ b/src/lexer.h @@ -0,0 +1,113 @@ +/* $Id: lexer.h,v 1.1 2003-10-27 12:21:30 adam Exp $ + Copyright (C) 2002-2003 + Index Data Aps + +This file is part of the YAZ toolkit. + +See the file LICENSE. +*/ + +static void putb(YYSTYPE *lval, CQL_parser cp, int c) +{ + if (lval->len+1 >= lval->size) + { + char *nb = nmem_malloc(cp->nmem, (lval->size = lval->len * 2 + 20)); + memcpy (nb, lval->buf, lval->len); + lval->buf = nb; + } + if (c) + lval->buf[lval->len++] = c; + lval->buf[lval->len] = '\0'; +} + +/* + * bison lexer for CQL. + */ + +int yylex(YYSTYPE *lval, void *vp) +{ + CQL_parser cp = (CQL_parser) vp; + int c; + lval->cql = 0; + lval->rel = 0; + lval->len = 0; + lval->size = 10; + lval->buf = nmem_malloc(cp->nmem, lval->size); + lval->buf[0] = '\0'; + do + { + c = cp->getbyte(cp->client_data); + if (c == 0) + return 0; + if (c == '\n') + return 0; + } while (isspace(c)); + if (strchr("()=>') + { + c1 = cp->getbyte(cp->client_data); + if (c1 == '=') + { + putb(lval, cp, c1); + return GE; + } + else + cp->ungetbyte(c1, cp->client_data); + } + else if (c == '<') + { + c1 = cp->getbyte(cp->client_data); + if (c1 == '=') + { + putb(lval, cp, c1); + return LE; + } + else if (c1 == '>') + { + putb(lval, cp, c1); + return NE; + } + else + cp->ungetbyte(c1, cp->client_data); + } + return c; + } + if (c == '"') + { + while ((c = cp->getbyte(cp->client_data)) != EOF && c != '"') + { + if (c == '\\') + c = cp->getbyte(cp->client_data); + putb(lval, cp, c); + } + putb(lval, cp, 0); + } + else + { + putb(lval, cp, c); + while ((c = cp->getbyte(cp->client_data)) != 0 && + !strchr(" \n()=<>/", c)) + { + if (c == '\\') + c = cp->getbyte(cp->client_data); + putb(lval, cp, c); + } +#if YYDEBUG + printf ("got %s\n", lval->buf); +#endif + if (c != 0) + cp->ungetbyte(c, cp->client_data); + if (!strcmp(lval->buf, "and")) + return AND; + if (!strcmp(lval->buf, "or")) + return OR; + if (!strcmp(lval->buf, "not")) + return NOT; + if (!strncmp(lval->buf, "prox", 4)) + return PROX; + } + return TERM; +} diff --git a/src/log.c b/src/log.c new file mode 100644 index 0000000..6d629bf --- /dev/null +++ b/src/log.c @@ -0,0 +1,235 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * + * $Id: log.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ + +#if HAVE_CONFIG_H +#include +#endif + +#ifdef WIN32 +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define HAS_STRERROR 1 + +#if HAS_STRERROR + +#else +char *strerror(int n) +{ + extern char *sys_errlist[]; + return sys_errlist[n]; +} + +#endif + +static int l_level = LOG_DEFAULT_LEVEL; +static FILE *l_file = NULL; +static char l_prefix[512] = ""; +static char l_prefix2[512] = ""; +static char l_fname[512] = ""; + +static struct { + int mask; + char *name; +} mask_names[] = +{ + { LOG_FATAL, "fatal"}, + { LOG_DEBUG, "debug"}, + { LOG_WARN, "warn" }, + { LOG_LOG, "log" }, + { LOG_ERRNO, ""}, + { LOG_MALLOC, "malloc"}, + { LOG_APP, "app" }, + { LOG_NOTIME, "" }, + { LOG_APP2 , "app2" }, + { LOG_APP3 , "app3" }, + { LOG_ALL, "all" }, + { 0, "none" }, + { 0, NULL } +}; + +FILE *yaz_log_file(void) +{ + if (!l_file) + l_file = stderr; + return l_file; +} + +void yaz_log_init_file (const char *fname) +{ + if (fname) + { + strncpy(l_fname, fname, sizeof(l_fname)-1); + l_fname[sizeof(l_fname)-1] = '\0'; + } + else + l_fname[0] = '\0'; + yaz_log_reopen(); +} + +void yaz_log_reopen(void) +{ + FILE *new_file; + if (!l_file) + l_file = stderr; + + if (!*l_fname) + new_file=stderr; + else if (!(new_file = fopen(l_fname, "a"))) + return; + if (l_file != stderr) + { + fclose (l_file); + } + setvbuf(new_file, 0, _IONBF, 0); + l_file = new_file; +} + +void yaz_log_init_level (int level) +{ + l_level = level; +} + +void yaz_log_init_prefix (const char *prefix) +{ + if (prefix && *prefix) + sprintf(l_prefix, "%.511s ", prefix); + else + *l_prefix = 0; +} + +void yaz_log_init_prefix2 (const char *prefix) +{ + if (prefix && *prefix) + sprintf(l_prefix2, "%.511s ", prefix); + else + *l_prefix2 = 0; +} + +void yaz_log_init(int level, const char *prefix, const char *fname) +{ + yaz_log_init_level (level); + yaz_log_init_prefix (prefix); + if (fname && *fname) + yaz_log_init_file (fname); +} + +static void (*start_hook_func)(int, const char *, void *) = NULL; +static void *start_hook_info; +static void (*end_hook_func)(int, const char *, void *) = NULL; +static void *end_hook_info; + +void log_event_start (void (*func)(int, const char *, void *), void *info) +{ + start_hook_func = func; + start_hook_info = info; +} + +void log_event_end (void (*func)(int, const char *, void *), void *info) +{ + end_hook_func = func; + end_hook_info = info; +} + +void yaz_log(int level, const char *fmt, ...) +{ + va_list ap; + char buf[4096], flags[1024]; + int i; + time_t ti; + struct tm *tim; + char tbuf[50]=""; + int o_level = level; + + if (!(level & l_level)) + return; + if (!l_file) + l_file = stderr; + *flags = '\0'; + for (i = 0; level && mask_names[i].name; i++) + if (mask_names[i].mask & level) + { + if (*mask_names[i].name) + sprintf(flags + strlen(flags), "[%s]", mask_names[i].name); + level -= mask_names[i].mask; + } + va_start(ap, fmt); +#ifdef WIN32 + _vsnprintf(buf, sizeof(buf)-1, fmt, ap); +#else +/* !WIN32 */ +#if HAVE_VSNPRINTF + vsnprintf(buf, sizeof(buf), fmt, ap); +#else + vsprintf(buf, fmt, ap); +#endif +#endif +/* WIN32 */ + if (o_level & LOG_ERRNO) + { + strcat(buf, " ["); + yaz_strerror(buf+strlen(buf), 2048); + strcat(buf, "]"); + } + va_end (ap); + if (start_hook_func) + (*start_hook_func)(o_level, buf, start_hook_info); + ti = time(0); + tim = localtime(&ti); + if (l_level & LOG_NOTIME) + tbuf[0]='\0'; + else + strftime(tbuf, 50, "%H:%M:%S-%d/%m: ", tim); + fprintf(l_file, "%s%s%s %s%s\n", tbuf, l_prefix, flags, + l_prefix2, buf); + fflush(l_file); + if (end_hook_func) + (*end_hook_func)(o_level, buf, end_hook_info); +} + +int yaz_log_mask_str (const char *str) +{ + return yaz_log_mask_str_x (str, LOG_DEFAULT_LEVEL); +} + +int yaz_log_mask_str_x (const char *str, int level) +{ + const char *p; + int i; + + while (*str) + { + for (p = str; *p && *p != ','; p++) + ; + if (*str == '-' || isdigit(*str)) + level = atoi (str); + else + for (i = 0; mask_names[i].name; i++) + if (strlen (mask_names[i].name) == (size_t) (p-str) && + memcmp (mask_names[i].name, str, p-str) == 0) + { + if (mask_names[i].mask) + level |= mask_names[i].mask; + else + level = 0; + } + if (*p == ',') + p++; + str = p; + } + return level; +} diff --git a/src/logrpn.c b/src/logrpn.c new file mode 100644 index 0000000..b79b2e3 --- /dev/null +++ b/src/logrpn.c @@ -0,0 +1,368 @@ +/* + * Copyright (C) 1995-2003, Index Data + * All rights reserved. + * + * $Id: logrpn.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ +#include + +#include +#include + +static const char *relToStr(int v) +{ + const char *str = 0; + switch (v) + { + case 1: str = "Less than"; break; + case 2: str = "Less than or equal"; break; + case 3: str = "Equal"; break; + case 4: str = "Greater or equal"; break; + case 5: str = "Greater than"; break; + case 6: str = "Not equal"; break; + case 100: str = "Phonetic"; break; + case 101: str = "Stem"; break; + case 102: str = "Relevance"; break; + case 103: str = "AlwaysMatches"; break; + } + return str; +} +static void attrStr (int type, int value, enum oid_value ast, char *str) +{ + const char *rstr; + *str = '\0'; + switch (ast) + { + case VAL_BIB1: + case VAL_EXP1: + case VAL_GILS: + switch (type) + { + case 1: + sprintf (str, "use"); + break; + case 2: + rstr = relToStr(value); + if (rstr) + sprintf (str, "relation=%s", rstr); + else + sprintf (str, "relation=%d", value); + break; + case 3: + switch (value) + { + case 1: + sprintf (str, "position=First in field"); + break; + case 2: + sprintf (str, "position=First in any subfield"); + break; + case 3: + sprintf (str, "position=Any position in field"); + break; + default: + sprintf (str, "position"); + } + break; + case 4: + switch (value) + { + case 1: + sprintf (str, "structure=Phrase"); + break; + case 2: + sprintf (str, "structure=Word"); + break; + case 3: + sprintf (str, "structure=Key"); + break; + case 4: + sprintf (str, "structure=Year"); + break; + case 5: + sprintf (str, "structure=Date"); + break; + case 6: + sprintf (str, "structure=Word list"); + break; + case 100: + sprintf (str, "structure=Date (un)"); + break; + case 101: + sprintf (str, "structure=Name (norm)"); + break; + case 102: + sprintf (str, "structure=Name (un)"); + break; + case 103: + sprintf (str, "structure=Structure"); + break; + case 104: + sprintf (str, "structure=urx"); + break; + case 105: + sprintf (str, "structure=free-form-text"); + break; + case 106: + sprintf (str, "structure=document-text"); + break; + case 107: + sprintf (str, "structure=local-number"); + break; + case 108: + sprintf (str, "structure=string"); + break; + case 109: + sprintf (str, "structure=numeric string"); + break; + default: + sprintf (str, "structure"); + } + break; + case 5: + switch (value) + { + case 1: + sprintf (str, "truncation=Right"); + break; + case 2: + sprintf (str, "truncation=Left"); + break; + case 3: + sprintf (str, "truncation=Left&right"); + break; + case 100: + sprintf (str, "truncation=Do not truncate"); + break; + case 101: + sprintf (str, "truncation=Process #"); + break; + case 102: + sprintf (str, "truncation=re-1"); + break; + case 103: + sprintf (str, "truncation=re-2"); + break; + case 104: + sprintf (str, "truncation=CCL"); + break; + default: + sprintf (str, "truncation"); + } + break; + case 6: + switch (value) + { + case 1: + sprintf (str, "completeness=Incomplete subfield"); + break; + case 2: + sprintf (str, "completeness=Complete subfield"); + break; + case 3: + sprintf (str, "completeness=Complete field"); + break; + default: + sprintf (str, "completeness"); + } + break; + } + break; + default: + break; + } + if (*str) + sprintf (str + strlen(str), " (%d=%d)", type, value); + else + sprintf (str, "%d=%d", type, value); +} + +/* + * zlog_attributes: print attributes of term + */ +static void zlog_attributes (Z_AttributesPlusTerm *t, int level, + enum oid_value ast) +{ + int of, i; + char str[80]; + int num_attributes = t->attributes->num_attributes; + + for (of = 0; of < num_attributes; of++) + { + const char *attset_name = ""; + Z_AttributeElement *element; + element = t->attributes->attributes[of]; + if (element->attributeSet) + { + oident *attrset; + attrset = oid_getentbyoid (element->attributeSet); + attset_name = attrset->desc; + } + switch (element->which) + { + case Z_AttributeValue_numeric: + attrStr (*element->attributeType, + *element->value.numeric, ast, str); + yaz_log (LOG_LOG, "%*.0s%s %s", level, "", attset_name, str); + break; + case Z_AttributeValue_complex: + yaz_log (LOG_LOG, "%*.0s%s attributeType=%d complex", + level, "", attset_name, *element->attributeType); + for (i = 0; ivalue.complex->num_list; i++) + { + if (element->value.complex->list[i]->which == + Z_StringOrNumeric_string) + yaz_log (LOG_LOG, "%*.0s string: '%s'", level, "", + element->value.complex->list[i]->u.string); + else if (element->value.complex->list[i]->which == + Z_StringOrNumeric_numeric) + yaz_log (LOG_LOG, "%*.0s numeric: '%d'", level, "", + *element->value.complex->list[i]->u.numeric); + } + break; + default: + yaz_log (LOG_LOG, "%.*s%s attribute unknown", + level, "", attset_name); + } + } +} + +static void zlog_structure (Z_RPNStructure *zs, int level, enum oid_value ast) +{ + if (zs->which == Z_RPNStructure_complex) + { + Z_Operator *op = zs->u.complex->roperator; + const char *rstr = 0; + const char *unit = "private"; + switch (op->which) + { + case Z_Operator_and: + yaz_log (LOG_LOG, "%*.0s and", level, ""); + break; + case Z_Operator_or: + yaz_log (LOG_LOG, "%*.0s or", level, ""); + break; + case Z_Operator_and_not: + yaz_log (LOG_LOG, "%*.0s and-not", level, ""); + break; + case Z_Operator_prox: + if (op->u.prox->which == Z_ProximityOperator_known) + { + switch(*op->u.prox->u.known) + { + case Z_ProxUnit_character: unit = "character"; break; + case Z_ProxUnit_word: unit = "word"; break; + case Z_ProxUnit_sentence: unit = "sentence"; break; + case Z_ProxUnit_paragraph: unit = "paragraph"; break; + case Z_ProxUnit_section: unit = "section"; break; + case Z_ProxUnit_chapter: unit = "chapter"; break; + case Z_ProxUnit_document: unit = "document"; break; + case Z_ProxUnit_element: unit = "element"; break; + case Z_ProxUnit_subelement: unit = "subelement"; break; + case Z_ProxUnit_elementType: unit = "elementType"; break; + case Z_ProxUnit_byte: unit = "byte"; break; + default: unit = "unknown"; break; + } + } + rstr = relToStr(*op->u.prox->relationType); + yaz_log (LOG_LOG, "%*.0s prox excl=%s dist=%d order=%s " + "rel=%s unit=%s", + level, "", op->u.prox->exclusion ? + (*op->u.prox->exclusion ? "T" : "F") : "N", + *op->u.prox->distance, + *op->u.prox->ordered ? "T" : "F", + rstr ? rstr : "unknown", + unit); + break; + default: + yaz_log (LOG_LOG, "%*.0s unknown complex", level, ""); + return; + } + zlog_structure (zs->u.complex->s1, level+2, ast); + zlog_structure (zs->u.complex->s2, level+2, ast); + } + else if (zs->which == Z_RPNStructure_simple) + { + if (zs->u.simple->which == Z_Operand_APT) + { + Z_AttributesPlusTerm *zapt = zs->u.simple->u.attributesPlusTerm; + + switch (zapt->term->which) + { + case Z_Term_general: + yaz_log (LOG_LOG, "%*.0s term '%.*s' (general)", level, "", + zapt->term->u.general->len, + zapt->term->u.general->buf); + break; + case Z_Term_characterString: + yaz_log (LOG_LOG, "%*.0s term '%s' (string)", level, "", + zapt->term->u.characterString); + break; + case Z_Term_numeric: + yaz_log (LOG_LOG, "%*.0s term '%d' (numeric)", level, "", + *zapt->term->u.numeric); + break; + case Z_Term_null: + yaz_log (LOG_LOG, "%*.0s term (null)", level, ""); + break; + default: + yaz_log (LOG_LOG, "%*.0s term (not general)", level, ""); + } + zlog_attributes (zapt, level+2, ast); + } + else if (zs->u.simple->which == Z_Operand_resultSetId) + { + yaz_log (LOG_LOG, "%*.0s set '%s'", level, "", + zs->u.simple->u.resultSetId); + } + else + yaz_log (LOG_LOG, "%*.0s unknown simple structure", level, ""); + } + else + yaz_log (LOG_LOG, "%*.0s unknown structure", level, ""); +} + +void log_rpn_query (Z_RPNQuery *rpn) +{ + oident *attrset; + enum oid_value ast; + + attrset = oid_getentbyoid (rpn->attributeSetId); + if (attrset) + { + ast = attrset->value; + yaz_log (LOG_LOG, "RPN query. Type: %s", attrset->desc); + } + else + { + ast = VAL_NONE; + yaz_log (LOG_LOG, "RPN query. Unknown type"); + } + zlog_structure (rpn->RPNStructure, 0, ast); +} + +void log_scan_term (Z_AttributesPlusTerm *zapt, oid_value ast) +{ + int level = 0; + if (zapt->term->which == Z_Term_general) + { + yaz_log (LOG_LOG, "%*.0s term '%.*s' (general)", level, "", + zapt->term->u.general->len, zapt->term->u.general->buf); + } + else + yaz_log (LOG_LOG, "%*.0s term (not general)", level, ""); + zlog_attributes (zapt, level+2, ast); +} + +void yaz_log_zquery (Z_Query *q) +{ + switch (q->which) + { + case Z_Query_type_1: case Z_Query_type_101: + log_rpn_query (q->u.type_1); + break; + case Z_Query_type_104: + if (q->u.type_104->which == Z_External_CQL) + yaz_log (LOG_LOG, "CQL: %s", q->u.type_104->u.cql); + } +} diff --git a/src/marcdisp.c b/src/marcdisp.c new file mode 100644 index 0000000..f5d5553 --- /dev/null +++ b/src/marcdisp.c @@ -0,0 +1,467 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * + * $Id: marcdisp.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include + +struct yaz_marc_t_ { + WRBUF m_wr; + int xml; + int debug; +}; + +yaz_marc_t yaz_marc_create(void) +{ + yaz_marc_t mt = (yaz_marc_t) xmalloc(sizeof(*mt)); + mt->xml = YAZ_MARC_LINE; + mt->debug = 0; + mt->m_wr = wrbuf_alloc(); + return mt; +} + +void yaz_marc_destroy(yaz_marc_t mt) +{ + if (!mt) + return ; + wrbuf_free (mt->m_wr, 1); + xfree (mt); +} + +static void marc_cdata (yaz_marc_t mt, const char *buf, size_t len, WRBUF wr) +{ + size_t i; + for (i = 0; ixml) + { + switch (buf[i]) { + case '<': + wrbuf_puts(wr, "<"); + break; + case '>': + wrbuf_puts(wr, ">"); + break; + case '&': + wrbuf_puts(wr, "&"); + break; + case '"': + wrbuf_puts(wr, """); + break; + case '\'': + wrbuf_puts(wr, "'"); + break; + default: + wrbuf_putc(wr, buf[i]); + } + } + else + wrbuf_putc(wr, buf[i]); + } +} + +#if 0 +static void marc_cdata (yaz_marc_t mt, const char *buf, size_t len) +{ + if (!mt->cd) + marc_cdata2 (mt, buf, len); + else + { + char outbuf[12]; + size_t inbytesleft = len; + const char *inp = buf; + + while (inbytesleft) + { + size_t outbytesleft = sizeof(outbuf); + char *outp = outbuf; + size_t r = yaz_iconv (mt->cd, (char**) &inp, &inbytesleft, + &outp, &outbytesleft); + if (r == (size_t) (-1)) + { + int e = yaz_iconv_error(mt->cd); + if (e != YAZ_ICONV_E2BIG) + break; + } + marc_cdata2 (mt, outbuf, outp - outbuf); + } + } +} +#endif + +int yaz_marc_decode_wrbuf (yaz_marc_t mt, const char *buf, int bsize, WRBUF wr) +{ + int entry_p; + int record_length; + int indicator_length; + int identifier_length; + int base_address; + int length_data_entry; + int length_starting; + int length_implementation; + + wrbuf_rewind(wr); + + record_length = atoi_n (buf, 5); + if (record_length < 25) + { + if (mt->debug) + { + char str[40]; + + sprintf (str, "Record length %d - aborting\n", record_length); + wrbuf_puts (wr, str); + } + return -1; + } + /* ballout if bsize is known and record_length is than that */ + if (bsize != -1 && record_length > bsize) + return -1; + if (isdigit(buf[10])) + indicator_length = atoi_n (buf+10, 1); + else + indicator_length = 2; + if (isdigit(buf[11])) + identifier_length = atoi_n (buf+11, 1); + else + identifier_length = 2; + base_address = atoi_n (buf+12, 5); + + length_data_entry = atoi_n (buf+20, 1); + length_starting = atoi_n (buf+21, 1); + length_implementation = atoi_n (buf+22, 1); + + if (mt->xml) + { + char str[80]; + int i; + switch(mt->xml) + { + case YAZ_MARC_SIMPLEXML: + wrbuf_puts (wr, "\n"); + break; + case YAZ_MARC_OAIMARC: + wrbuf_puts( + wr, + "\n", + buf[5], buf[6], buf[7]); + wrbuf_puts (wr, str); + break; + case YAZ_MARC_MARCXML: + wrbuf_printf( + wr, + "\n" + " %.24s\n", buf); + break; + } + } + if (mt->debug) + { + char str[40]; + + if (mt->xml) + wrbuf_puts (wr, "\n"); + } + + for (entry_p = 24; buf[entry_p] != ISO2709_FS; ) + { + entry_p += 3+length_data_entry+length_starting; + if (entry_p >= record_length) + return -1; + } + base_address = entry_p+1; + for (entry_p = 24; buf[entry_p] != ISO2709_FS; ) + { + int data_length; + int data_offset; + int end_offset; + int i, j; + char tag[4]; + int identifier_flag = 1; + + memcpy (tag, buf+entry_p, 3); + entry_p += 3; + tag[3] = '\0'; + data_length = atoi_n (buf+entry_p, length_data_entry); + entry_p += length_data_entry; + data_offset = atoi_n (buf+entry_p, length_starting); + entry_p += length_starting; + i = data_offset + base_address; + end_offset = i+data_length-1; + + if (indicator_length < 4 && indicator_length > 0) + { + if (buf[i + indicator_length] != ISO2709_IDFS) + identifier_flag = 0; + } + else if (!memcmp (tag, "00", 2)) + identifier_flag = 0; + + switch(mt->xml) + { + case YAZ_MARC_LINE: + if (mt->debug) + wrbuf_puts (wr, "Tag: "); + wrbuf_puts (wr, tag); + wrbuf_puts (wr, " "); + break; + case YAZ_MARC_SIMPLEXML: + wrbuf_printf (wr, "xml) + { + case YAZ_MARC_LINE: + if (mt->debug) + wrbuf_puts (wr, " Ind: "); + wrbuf_putc (wr, buf[i]); + break; + case YAZ_MARC_SIMPLEXML: + wrbuf_printf (wr, " Indicator%d=\"%c\"", j+1, buf[i]); + break; + case YAZ_MARC_OAIMARC: + wrbuf_printf (wr, " i%d=\"%c\"", j+1, buf[i]); + break; + case YAZ_MARC_MARCXML: + wrbuf_printf (wr, " ind%d=\"%c\"", j+1, buf[i]); + } + } + } + if (mt->xml) + { + wrbuf_puts (wr, ">"); + if (identifier_flag) + wrbuf_puts (wr, "\n"); + } + else + { + if (mt->debug && !mt->xml) + wrbuf_puts (wr, " Fields: "); + } + if (identifier_flag) + { + while (buf[i] != ISO2709_RS && buf[i] != ISO2709_FS && i < end_offset) + { + int i0; + i++; + switch(mt->xml) + { + case YAZ_MARC_LINE: + wrbuf_puts (wr, " $"); + for (j = 1; j"); + break; + case YAZ_MARC_OAIMARC: + wrbuf_puts (wr, " "); + break; + case YAZ_MARC_MARCXML: + wrbuf_puts (wr, " "); + break; + } + i0 = i; + while (buf[i] != ISO2709_RS && buf[i] != ISO2709_IDFS && + buf[i] != ISO2709_FS && i < end_offset) + i++; + marc_cdata(mt, buf + i0, i - i0, wr); + + if (mt->xml) + wrbuf_puts (wr, "\n"); + } + } + else + { + int i0 = i; + while (buf[i] != ISO2709_RS && buf[i] != ISO2709_FS && i < end_offset) + i++; + marc_cdata(mt, buf + i0, i - i0, wr); + } + if (!mt->xml) + wrbuf_putc (wr, '\n'); + if (i < end_offset) + wrbuf_puts (wr, " \n"); + if (buf[i] != ISO2709_RS && buf[i] != ISO2709_FS) + wrbuf_puts (wr, " \n"); + switch(mt->xml) + { + case YAZ_MARC_SIMPLEXML: + wrbuf_puts (wr, "\n"); + break; + case YAZ_MARC_OAIMARC: + if (identifier_flag) + wrbuf_puts (wr, " \n"); + else + wrbuf_puts (wr, " \n"); + break; + case YAZ_MARC_MARCXML: + if (identifier_flag) + wrbuf_puts (wr, " \n"); + else + wrbuf_puts (wr, " \n"); + break; + } + } + switch (mt->xml) + { + case YAZ_MARC_LINE: + wrbuf_puts (wr, ""); + break; + case YAZ_MARC_SIMPLEXML: + wrbuf_puts (wr, "\n"); + break; + case YAZ_MARC_OAIMARC: + wrbuf_puts (wr, "\n"); + break; + case YAZ_MARC_MARCXML: + wrbuf_puts (wr, "\n"); + break; + } + return record_length; +} + +int yaz_marc_decode_buf (yaz_marc_t mt, const char *buf, int bsize, + char **result, int *rsize) +{ + int r = yaz_marc_decode_wrbuf(mt, buf, bsize, mt->m_wr); + if (r > 0) + { + if (result) + *result = wrbuf_buf(mt->m_wr); + if (rsize) + *rsize = wrbuf_len(mt->m_wr); + } + return r; +} + +void yaz_marc_xml(yaz_marc_t mt, int xmlmode) +{ + if (mt) + mt->xml = xmlmode; +} + +void yaz_marc_debug(yaz_marc_t mt, int level) +{ + if (mt) + mt->debug = level; +} + +/* depricated */ +int yaz_marc_decode(const char *buf, WRBUF wr, int debug, int bsize, int xml) +{ + yaz_marc_t mt = yaz_marc_create(); + int r; + + mt->debug = debug; + mt->xml = xml; + r = yaz_marc_decode_wrbuf(mt, buf, bsize, wr); + yaz_marc_destroy(mt); + return r; +} + +/* depricated */ +int marc_display_wrbuf (const char *buf, WRBUF wr, int debug, int bsize) +{ + return yaz_marc_decode(buf, wr, debug, bsize, 0); +} + +/* depricated */ +int marc_display_exl (const char *buf, FILE *outf, int debug, int bsize) +{ + yaz_marc_t mt = yaz_marc_create(); + int r; + + mt->debug = debug; + r = yaz_marc_decode_wrbuf (mt, buf, bsize, mt->m_wr); + if (!outf) + outf = stdout; + if (r > 0) + fwrite (wrbuf_buf(mt->m_wr), 1, wrbuf_len(mt->m_wr), outf); + yaz_marc_destroy(mt); + return r; +} + +/* depricated */ +int marc_display_ex (const char *buf, FILE *outf, int debug) +{ + return marc_display_exl (buf, outf, debug, -1); +} + +/* depricated */ +int marc_display (const char *buf, FILE *outf) +{ + return marc_display_ex (buf, outf, 0); +} + diff --git a/src/matchstr.c b/src/matchstr.c new file mode 100644 index 0000000..2ec92d8 --- /dev/null +++ b/src/matchstr.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 1995-2003, Index Data. + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: matchstr.c,v 1.1 2003-10-27 12:21:31 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +/* + * Match strings, independently of case and occurences of '-'. + * fairly inefficient - will be replaced with an indexing scheme for + * the various subsystems if we get a bottleneck here. + */ + +int yaz_matchstr(const char *s1, const char *s2) +{ + while (*s1 && *s2) + { + char c1 = *s1; + char c2 = *s2; + + if (c2 == '?') + return 0; + if (c1 == '-') + c1 = *++s1; + if (c2 == '-') + c2 = *++s2; + if (!c1 || !c2) + break; + if (c2 != '.') + { + if (isupper(c1)) + c1 = tolower(c1); + if (isupper(c2)) + c2 = tolower(c2); + if (c1 != c2) + break; + } + s1++; + s2++; + } + return *s1 || *s2; +} + +int yaz_strcmp_del(const char *a, const char *b, const char *b_del) +{ + while (*a && *b) + { + if (*a != *b) + return *a - *b; + a++; + b++; + } + if (b_del && strchr(b_del, *b)) + return *a; + return *a - *b; +} + +#ifdef __GNUC__ +#ifdef __CHECKER__ +void __assert_fail (const char *assertion, const char *file, + unsigned int line, const char *function) +{ + fprintf (stderr, "%s in file %s line %d func %s\n", + assertion, file, line, function); + abort (); +} +#endif +#endif diff --git a/src/mterm2.asn b/src/mterm2.asn new file mode 100644 index 0000000..eff29d7 --- /dev/null +++ b/src/mterm2.asn @@ -0,0 +1,10 @@ +UserInfoFormat-multipleSearchTerms-2 +{Z39-50-userInfoFormat MultipleSearchTerms-2 (5)} DEFINITIONS ::= +BEGIN +IMPORTS Term FROM Z39-50-APDU-1995; + +MultipleSearchTerms-2 ::= SEQUENCE OF SEQUENCE{ + term [1] IMPLICIT Term, + flag [2] IMPLICIT BOOLEAN OPTIONAL} + +END diff --git a/src/nmem.c b/src/nmem.c new file mode 100644 index 0000000..2526dbb --- /dev/null +++ b/src/nmem.c @@ -0,0 +1,483 @@ +/* + * Copyright (c) 1995-2003, Index Data. + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: nmem.c,v 1.1 2003-10-27 12:21:32 adam Exp $ + */ + +/* + * This is a simple and fairly wasteful little module for nibble memory + * allocation. Evemtually we'll put in something better. + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#ifdef WIN32 +#include +#endif + +#if YAZ_POSIX_THREADS +#include +#endif + +#if YAZ_GNU_THREADS +#include +#endif + +#define NMEM_CHUNK (4*1024) + +#ifdef WIN32 +static CRITICAL_SECTION critical_section; +#define NMEM_ENTER EnterCriticalSection(&critical_section) +#define NMEM_LEAVE LeaveCriticalSection(&critical_section) +struct nmem_mutex { + CRITICAL_SECTION m_handle; +}; +#elif YAZ_POSIX_THREADS +static pthread_mutex_t nmem_mutex = PTHREAD_MUTEX_INITIALIZER; +#define NMEM_ENTER pthread_mutex_lock(&nmem_mutex); +#define NMEM_LEAVE pthread_mutex_unlock(&nmem_mutex); +struct nmem_mutex { + pthread_mutex_t m_handle; +}; +#elif YAZ_GNU_THREADS +static pth_mutex_t nmem_mutex = PTH_MUTEX_INIT; +#define NMEM_ENTER pth_mutex_acquire(&nmem_mutex, 0, 0) +#define NMEM_LEAVE pth_mutex_release(&nmem_mutex) +struct nmem_mutex { + pth_mutex_t m_handle; +}; +#else +#define NMEM_ENTER +#define NMEM_LEAVE +struct nmem_mutex { + int dummy; +}; +#endif + +YAZ_EXPORT void nmem_mutex_create(NMEM_MUTEX *p) +{ + NMEM_ENTER; + if (!*p) + { + *p = (NMEM_MUTEX) malloc (sizeof(**p)); +#ifdef WIN32 + InitializeCriticalSection(&(*p)->m_handle); +#elif YAZ_POSIX_THREADS + pthread_mutex_init (&(*p)->m_handle, 0); +#elif YAZ_GNU_THREADS + pth_mutex_init (&(*p)->m_handle); +#endif + } + NMEM_LEAVE; +} + +YAZ_EXPORT void nmem_mutex_enter(NMEM_MUTEX p) +{ + if (p) + { +#ifdef WIN32 + EnterCriticalSection(&p->m_handle); +#elif YAZ_POSIX_THREADS + pthread_mutex_lock(&p->m_handle); +#endif + } +} + +YAZ_EXPORT void nmem_mutex_leave(NMEM_MUTEX p) +{ + if (p) + { +#ifdef WIN32 + LeaveCriticalSection(&p->m_handle); +#elif YAZ_POSIX_THREADS + pthread_mutex_unlock(&p->m_handle); +#endif + } +} + +YAZ_EXPORT void nmem_mutex_destroy(NMEM_MUTEX *p) +{ + NMEM_ENTER; + if (*p) + { +#ifdef WIN32 + DeleteCriticalSection(&(*p)->m_handle); +#endif + free (*p); + *p = 0; + } + NMEM_LEAVE; +} + +static nmem_block *freelist = NULL; /* "global" freelists */ +static nmem_control *cfreelist = NULL; +static int nmem_active_no = 0; +static int nmem_init_flag = 0; + +#if NMEM_DEBUG +struct nmem_debug_info { + void *p; + char file[40]; + int line; + struct nmem_debug_info *next; +}; + +struct nmem_debug_info *nmem_debug_list = 0; +#endif + +static void free_block(nmem_block *p) +{ + p->next = freelist; + freelist = p; +#if NMEM_DEBUG + yaz_log (LOG_DEBUG, "nmem free_block p=%p", p); +#endif +} + +#if NMEM_DEBUG +void nmem_print_list (void) +{ + struct nmem_debug_info *p; + + yaz_log (LOG_DEBUG, "nmem print list"); + NMEM_ENTER; + for (p = nmem_debug_list; p; p = p->next) + yaz_log (LOG_DEBUG, " %s:%d p=%p size=%d", p->file, p->line, p->p, + nmem_total(p->p)); + NMEM_LEAVE; +} +#endif +/* + * acquire a block with a minimum of size free bytes. + */ +static nmem_block *get_block(int size) +{ + nmem_block *r, *l; + +#if NMEM_DEBUG + yaz_log (LOG_DEBUG, "nmem get_block size=%d", size); +#endif + for (r = freelist, l = 0; r; l = r, r = r->next) + if (r->size >= size) + break; + if (r) + { +#if NMEM_DEBUG + yaz_log (LOG_DEBUG, "nmem get_block found free block p=%p", r); +#endif + if (l) + l->next = r->next; + else + freelist = r->next; + } + else + { + int get = NMEM_CHUNK; + + if (get < size) + get = size; +#if NMEM_DEBUG + yaz_log (LOG_DEBUG, "nmem get_block alloc new block size=%d", get); +#endif + r = (nmem_block *)xmalloc(sizeof(*r)); + r->buf = (char *)xmalloc(r->size = get); + } + r->top = 0; + return r; +} + +void nmem_reset(NMEM n) +{ + nmem_block *t; + +#if NMEM_DEBUG + yaz_log (LOG_DEBUG, "nmem_reset p=%p", n); +#endif + if (!n) + return; + NMEM_ENTER; + while (n->blocks) + { + t = n->blocks; + n->blocks = n->blocks->next; + free_block(t); + } + n->total = 0; + NMEM_LEAVE; +} + +#if NMEM_DEBUG +void *nmem_malloc_f (const char *file, int line, NMEM n, int size) +#else +void *nmem_malloc(NMEM n, int size) +#endif +{ + struct nmem_block *p; + char *r; + +#if NMEM_DEBUG + yaz_log (LOG_DEBUG, "%s:%d: nmem_malloc p=%p size=%d", file, line, + n, size); +#endif + if (!n) + { + yaz_log (LOG_FATAL, "calling nmem_malloc with an null pointer"); + abort (); + } +#ifdef WIN32 + assert (nmem_init_flag); +#endif + NMEM_ENTER; + p = n->blocks; + if (!p || p->size - p->top < size) + { + p = get_block(size); + p->next = n->blocks; + n->blocks = p; + } + r = p->buf + p->top; + /* align size */ + p->top += (size + (sizeof(long) - 1)) & ~(sizeof(long) - 1); + n->total += size; + NMEM_LEAVE; + return r; +} + +int nmem_total(NMEM n) +{ + return n->total; +} + +#if NMEM_DEBUG +NMEM nmem_create_f(const char *file, int line) +#else +NMEM nmem_create(void) +#endif +{ + NMEM r; +#if NMEM_DEBUG + struct nmem_debug_info *debug_p; +#endif + + NMEM_ENTER; + nmem_active_no++; + r = cfreelist; + if (r) + cfreelist = cfreelist->next; + else + r = (nmem_control *)xmalloc(sizeof(*r)); + NMEM_LEAVE; + +#if NMEM_DEBUG + yaz_log (LOG_DEBUG, "%s:%d: nmem_create %d p=%p", file, line, + nmem_active_no, r); +#endif + r->blocks = 0; + r->total = 0; + r->next = 0; + +#if NMEM_DEBUG + for (debug_p = nmem_debug_list; debug_p; debug_p = debug_p->next) + if (debug_p->p == r) + { + yaz_log (LOG_FATAL, "multi used block in nmem"); + abort (); + } + debug_p = xmalloc (sizeof(*debug_p)); + strncpy (debug_p->file, file, sizeof(debug_p->file)-1); + debug_p->file[sizeof(debug_p->file)-1] = '\0'; + debug_p->line = line; + debug_p->p = r; + debug_p->next = nmem_debug_list; + nmem_debug_list = debug_p; + + nmem_print_list(); +#endif + return r; +} + +#if NMEM_DEBUG +void nmem_destroy_f(const char *file, int line, NMEM n) +#else +void nmem_destroy(NMEM n) +#endif +{ +#if NMEM_DEBUG + struct nmem_debug_info **debug_p; + int ok = 0; +#endif + if (!n) + return; + +#if NMEM_DEBUG + yaz_log (LOG_DEBUG, "%s:%d: nmem_destroy %d p=%p", file, line, + nmem_active_no-1, n); + NMEM_ENTER; + for (debug_p = &nmem_debug_list; *debug_p; debug_p = &(*debug_p)->next) + if ((*debug_p)->p == n) + { + struct nmem_debug_info *debug_save = *debug_p; + *debug_p = (*debug_p)->next; + xfree (debug_save); + ok = 1; + break; + } + NMEM_LEAVE; + nmem_print_list(); + if (!ok) + { + yaz_log (LOG_WARN, "%s:%d destroying unallocated nmem block p=%p", + file, line, n); + return; + } +#endif + nmem_reset(n); + NMEM_ENTER; + nmem_active_no--; + n->next = cfreelist; + cfreelist = n; + NMEM_LEAVE; +} + +void nmem_transfer (NMEM dst, NMEM src) +{ + nmem_block *t; + while ((t=src->blocks)) + { + src->blocks = t->next; + t->next = dst->blocks; + dst->blocks = t; + } + dst->total += src->total; + src->total = 0; +} + +void nmem_critical_enter (void) +{ + NMEM_ENTER; +} + +void nmem_critical_leave (void) +{ + NMEM_LEAVE; +} + +void nmem_init (void) +{ + if (++nmem_init_flag == 1) + { +#ifdef WIN32 + InitializeCriticalSection(&critical_section); +#elif YAZ_GNU_THREADS + yaz_log (LOG_LOG, "pth_init"); + pth_init (); +#endif + nmem_active_no = 0; + freelist = NULL; + cfreelist = NULL; + } +} + +void nmem_exit (void) +{ + if (--nmem_init_flag == 0) + { + oid_exit(); + while (freelist) + { + struct nmem_block *fl = freelist; + freelist = freelist->next; + xfree (fl->buf); + xfree (fl); + } + while (cfreelist) + { + struct nmem_control *cfl = cfreelist; + cfreelist = cfreelist->next; + xfree (cfl); + } +#ifdef WIN32 + DeleteCriticalSection(&critical_section); +#endif + } +} + + +#ifdef WIN32 +BOOL WINAPI DllMain (HINSTANCE hinstDLL, + DWORD reason, + LPVOID reserved) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + nmem_init (); + break; + case DLL_PROCESS_DETACH: + nmem_exit (); + } + return TRUE; +} +#endif + +int yaz_errno(void) +{ + return errno; +} + +void yaz_set_errno(int v) +{ + errno = v; +} + +void yaz_strerror(char *buf, int max) +{ + char *cp; +#ifdef WIN32 + DWORD err = GetLastError(); + if (err) + { + FormatMessage( + FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + err, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default lang */ + (LPTSTR) buf, + max-1, + NULL); + } + else + *buf = '\0'; +#else +/* UNIX */ +#if HAVE_STRERROR_R +#if YAZ_POSIX_THREADS + *buf = '\0'; + strerror_r(errno, buf, max); + /* if buffer is unset - use strerror anyway (GLIBC bug) */ + if (*buf == '\0') + strcpy(buf, strerror(yaz_errno())); +#else + strcpy(buf, strerror(yaz_errno())); +#endif +#else + strcpy(buf, strerror(yaz_errno())); +#endif +/* UNIX */ +#endif + if ((cp=strrchr(buf, '\n'))) + *cp = '\0'; + if ((cp=strrchr(buf, '\r'))) + *cp = '\0'; +} diff --git a/src/nmemsdup.c b/src/nmemsdup.c new file mode 100644 index 0000000..69343f4 --- /dev/null +++ b/src/nmemsdup.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 1997-2003, Index Data. + * See the file LICENSE for details. + * + * $Id: nmemsdup.c,v 1.1 2003-10-27 12:21:33 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include + +char *nmem_strdup (NMEM mem, const char *src) +{ + char *dst = (char *)nmem_malloc (mem, strlen(src)+1); + strcpy (dst, src); + return dst; +} + +char *nmem_strdupn (NMEM mem, const char *src, size_t n) +{ + char *dst = (char *)nmem_malloc (mem, n+1); + memcpy (dst, src, n); + dst[n] = '\0'; + return dst; +} + +int *nmem_intdup(NMEM mem, int v) +{ + int *dst = (int*) nmem_malloc (mem, sizeof(int)); + *dst = v; + return dst; +} diff --git a/src/oclcui.asn b/src/oclcui.asn new file mode 100644 index 0000000..33b4c23 --- /dev/null +++ b/src/oclcui.asn @@ -0,0 +1,33 @@ +UserInfoFormat-oclcUserInformation +{Z39-50-userInfoFormat OCLCUserInformation (7)} DEFINITIONS ::= +BEGIN + +-- $Id: oclcui.asn,v 1.1 2003-10-27 12:21:33 adam Exp $ +-- +-- This format is returned from the server at +-- fsz3950test.oclc.org:210 +-- I found the definition at +-- http://www.oclc.org/firstsearch/documentation/z3950/config_guide.htm +-- +-- I have added OPTIONAL modifiers to the `dblist' and and `code' +-- elements because they appear to be admitted from the APDU returned +-- as an Init diagnostic from fsz3950test.oclc.org:210. Adam further +-- removed the SEQUENCE structure, changed failReason to a BOOLEAN and +-- deleted diagnosticSetId altogether, to make the ASN.1 conform to +-- what's actually returned on the wire. Finally, I removed the +-- OPTIONAL on failReason on the advice of OCLC's Keith Neibarger +-- (although he'd also advised me, wrongly, that I +-- could remove the OPTIONAL on dblist). + +OCLC-UserInformation ::= SEQUENCE { + motd [1] IMPLICIT VisibleString OPTIONAL, + dblist SEQUENCE OF DBName OPTIONAL, + failReason [3] IMPLICIT BOOLEAN OPTIONAL, + code [1] IMPLICIT INTEGER OPTIONAL, + text [2] IMPLICIT VisibleString OPTIONAL +} + +DBName ::= [2] IMPLICIT VisibleString + +END + diff --git a/src/odr-priv.h b/src/odr-priv.h new file mode 100644 index 0000000..6aef58b --- /dev/null +++ b/src/odr-priv.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 1995-2003, Index Data. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation, in whole or in part, for any purpose, is hereby granted, + * provided that: + * + * 1. This copyright and permission notice appear in all copies of the + * software and its documentation. Notices of copyright or attribution + * which appear at the beginning of any file must remain unchanged. + * + * 2. The name of Index Data or the individual authors may not be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR + * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + * + * $Id: odr-priv.h,v 1.1 2003-10-27 12:21:33 adam Exp $ + */ + +#ifndef ODR_PRIV_H + +#define ODR_PRIV_H + +#include +#include + +struct Odr_ber_tag { /* used to be statics in ber_tag... */ + int lclass; + int ltag; + int br; + int lcons; +}; + +#define odr_max(o) ((o)->size - ((o)->bp - (o)->buf)) +#define odr_offset(o) ((o)->bp - (o)->buf) + +struct Odr_private { + /* stack for constructed types */ +#define ODR_MAX_STACK 50 + int stackp; /* top of stack (-1 == initial state) */ + odr_constack stack[ODR_MAX_STACK]; + + struct Odr_ber_tag odr_ber_tag; + yaz_iconv_t iconv_handle; + int error_id; + char element[80]; +}; + +/* Private macro. + * write a single character at the current position - grow buffer if + * necessary. + * (no, we're not usually this anal about our macros, but this baby is + * next to unreadable without some indentation :) + */ +#define odr_putc(o, c) \ +( \ + ( \ + (o)->pos < (o)->size ? \ + ( \ + (o)->buf[(o)->pos++] = (c), \ + 0 \ + ) : \ + ( \ + odr_grow_block((o), 1) == 0 ? \ + ( \ + (o)->buf[(o)->pos++] = (c), \ + 0 \ + ) : \ + ( \ + (o)->error = OSPACE, \ + -1 \ + ) \ + ) \ + ) == 0 ? \ + ( \ + (o)->pos > (o)->top ? \ + ( \ + (o)->top = (o)->pos, \ + 0 \ + ) : \ + 0 \ + ) : \ + -1 \ +) + +#endif diff --git a/src/odr.c b/src/odr.c new file mode 100644 index 0000000..acc7b19 --- /dev/null +++ b/src/odr.c @@ -0,0 +1,183 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * + * $Id: odr.c,v 1.1 2003-10-27 12:21:33 adam Exp $ + * + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include +#include "odr-priv.h" + +Odr_null *ODR_NULLVAL = (Odr_null *) "NULL"; /* the presence of a null value */ + +Odr_null *odr_nullval (void) +{ + return ODR_NULLVAL; +} + +char *odr_errlist[] = +{ + "No (unknown) error", + "Memory allocation failed", + "System error", + "No space in buffer", + "Required data element missing", + "Unexpected tag", + "Other error", + "Protocol error", + "Malformed data", + "Stack overflow", + "Length of constructed type different from sum of members", + "Overflow writing definite length of constructed type", + "Bad HTTP Request" +}; + +char *odr_errmsg(int n) +{ + return odr_errlist[n]; +} + +void odr_perror(ODR o, const char *message) +{ + const char *e = odr_getelement(o); + int err, x; + + err = odr_geterrorx(o, &x); + fprintf(stderr, "%s: %s (code %d:%d)", message, odr_errlist[err], err, x); + if (e && *e) + fprintf (stderr, " element %s", e); + fprintf(stderr, "\n"); +} + +int odr_geterror(ODR o) +{ + return o->error; +} + +int odr_geterrorx(ODR o, int *x) +{ + if (x) + *x = o->op->error_id; + return o->error; +} + +char *odr_getelement(ODR o) +{ + return o->op->element; +} + +void odr_seterror(ODR o, int error, int id) +{ + o->error = error; + o->op->error_id = id; + o->op->element[0] = '\0'; +} + +void odr_setelement(ODR o, const char *element) +{ + if (element) + { + strncpy(o->op->element, element, sizeof(o->op->element)-1); + o->op->element[sizeof(o->op->element)-1] = '\0'; + } +} + +void odr_setprint(ODR o, FILE *file) +{ + o->print = file; +} + +int odr_set_charset(ODR o, const char *to, const char *from) +{ + if (o->op->iconv_handle) + yaz_iconv_close (o->op->iconv_handle); + o->op->iconv_handle = 0; + if (to && from) + { + o->op->iconv_handle = yaz_iconv_open (to, from); + if (o->op->iconv_handle == 0) + return -1; + } + return 0; +} + +#include + +ODR odr_createmem(int direction) +{ + ODR r; + + if (!(r = (ODR)xmalloc(sizeof(*r)))) + return 0; + r->direction = direction; + r->print = stderr; + r->buf = 0; + r->size = r->pos = r->top = 0; + r->can_grow = 1; + r->mem = nmem_create(); + r->enable_bias = 1; + r->op = (struct Odr_private *) xmalloc (sizeof(*r->op)); + r->op->odr_ber_tag.lclass = -1; + r->op->iconv_handle = 0; + odr_reset(r); + yaz_log (LOG_DEBUG, "odr_createmem dir=%d o=%p", direction, r); + return r; +} + +void odr_reset(ODR o) +{ + odr_seterror(o, ONONE, 0); + o->bp = o->buf; + odr_seek(o, ODR_S_SET, 0); + o->top = 0; + o->t_class = -1; + o->t_tag = -1; + o->indent = 0; + o->op->stackp = -1; + nmem_reset(o->mem); + o->choice_bias = -1; + o->lenlen = 1; + if (o->op->iconv_handle != 0) + yaz_iconv(o->op->iconv_handle, 0, 0, 0, 0); + yaz_log (LOG_DEBUG, "odr_reset o=%p", o); +} + +void odr_destroy(ODR o) +{ + nmem_destroy(o->mem); + if (o->buf && o->can_grow) + xfree(o->buf); + if (o->print && o->print != stderr) + fclose(o->print); + if (o->op->iconv_handle != 0) + yaz_iconv_close (o->op->iconv_handle); + xfree(o->op); + xfree(o); + yaz_log (LOG_DEBUG, "odr_destroy o=%p", o); +} + +void odr_setbuf(ODR o, char *buf, int len, int can_grow) +{ + o->bp = (unsigned char *) buf; + + o->buf = (unsigned char *) buf; + o->can_grow = can_grow; + o->top = o->pos = 0; + o->size = len; +} + +char *odr_getbuf(ODR o, int *len, int *size) +{ + *len = o->top; + if (size) + *size = o->size; + return (char*) o->buf; +} + diff --git a/src/odr_any.c b/src/odr_any.c new file mode 100644 index 0000000..ac1a4f5 --- /dev/null +++ b/src/odr_any.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: odr_any.c,v 1.1 2003-10-27 12:21:33 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include "odr-priv.h" + +/* + * This is a catch-all type. It stuffs a random ostring (assumed to be properly + * encoded) into the stream, or reads a full data element. Implicit tagging + * does not work, and neither does the optional flag, unless the element + * is the last in a sequence. + */ +int odr_any(ODR o, Odr_any **p, int opt, const char *name) +{ + if (o->error) + return 0; + if (o->direction == ODR_PRINT) + { + odr_prname(o, name); + fprintf(o->print, "ANY (len=%d)\n", (*p)->len); + return 1; + } + if (o->direction == ODR_DECODE) + *p = (Odr_oct *)odr_malloc(o, sizeof(**p)); + if (ber_any(o, p)) + return 1; + *p = 0; + return odr_missing(o, opt, name); +} diff --git a/src/odr_bit.c b/src/odr_bit.c new file mode 100644 index 0000000..05ef420 --- /dev/null +++ b/src/odr_bit.c @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: odr_bit.c,v 1.1 2003-10-27 12:21:33 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include "odr-priv.h" + +/* + * Top level bitstring string en/decoder. + * Returns 1 on success, 0 on error. + */ +int odr_bitstring(ODR o, Odr_bitmask **p, int opt, const char *name) +{ + int res, cons = 0; + + if (o->error) + return 0; + if (o->t_class < 0) + { + o->t_class = ODR_UNIVERSAL; + o->t_tag = ODR_BITSTRING; + } + if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + return 0; + if (!res) + return odr_missing(o, opt, name); + if (o->direction == ODR_PRINT) + { + odr_prname(o, name); + fprintf(o->print, "BITSTRING(len=%d)\n",(*p)->top + 1); + return 1; + } + if (o->direction == ODR_DECODE) + { + *p = (Odr_bitmask *)odr_malloc(o, sizeof(Odr_bitmask)); + memset((*p)->bits, 0, ODR_BITMASK_SIZE); + (*p)->top = -1; + } +#if 0 + /* ignoring the cons helps with at least one target. + * http://bugzilla.indexdata.dk/cgi-bin/bugzilla/show_bug.cgi?id=24 + */ + return ber_bitstring(o, *p, 0); +#else + return ber_bitstring(o, *p, cons); +#endif +} diff --git a/src/odr_bool.c b/src/odr_bool.c new file mode 100644 index 0000000..36c858b --- /dev/null +++ b/src/odr_bool.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: odr_bool.c,v 1.1 2003-10-27 12:21:33 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include "odr-priv.h" + +/* + * Top level boolean en/decoder. + * Returns 1 on success, 0 on error. + */ +int odr_bool(ODR o, int **p, int opt, const char *name) +{ + int res, cons = 0; + + if (o->error) + return 0; + if (o->t_class < 0) + { + o->t_class = ODR_UNIVERSAL; + o->t_tag = ODR_BOOLEAN; + } + if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + return 0; + if (!res) + return odr_missing(o, opt, name); + if (o->direction == ODR_PRINT) + { + odr_prname(o, name); + fprintf(o->print, "%s\n", (**p ? "TRUE" : "FALSE")); + return 1; + } + if (cons) + return 0; + if (o->direction == ODR_DECODE) + *p = (int *)odr_malloc(o, sizeof(int)); + return ber_boolean(o, *p); +} diff --git a/src/odr_choice.c b/src/odr_choice.c new file mode 100644 index 0000000..53b6516 --- /dev/null +++ b/src/odr_choice.c @@ -0,0 +1,96 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: odr_choice.c,v 1.1 2003-10-27 12:21:33 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include "odr-priv.h" + +int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, + const char *name) +{ + int i, cl = -1, tg, cn, *which = (int *)whichp, bias = o->choice_bias; + + if (o->error) + return 0; + if (o->direction != ODR_DECODE && !*(char**)p) + return 0; + + if (o->direction == ODR_DECODE) + { + *which = -1; + *(char**)p = 0; + } + o->choice_bias = -1; + + if (o->direction == ODR_PRINT) + { + if (name) + { + odr_prname(o, name); + fprintf (o->print, "choice\n"); + } + } + for (i = 0; arm[i].fun; i++) + { + if (o->direction == ODR_DECODE) + { + if (bias >= 0 && bias != arm[i].which) + continue; + *which = arm[i].which; + } + else if (*which != arm[i].which) + continue; + + if (arm[i].tagmode != ODR_NONE) + { + if (o->direction == ODR_DECODE && cl < 0) + { + if (o->op->stackp > -1 && !odr_constructed_more(o)) + return 0; + if (ber_dectag(o->bp, &cl, &tg, &cn, odr_max(o)) <= 0) + return 0; + } + else if (o->direction != ODR_DECODE) + { + cl = arm[i].zclass; + tg = arm[i].tag; + } + if (tg == arm[i].tag && cl == arm[i].zclass) + { + if (arm[i].tagmode == ODR_IMPLICIT) + { + odr_implicit_settag(o, cl, tg); + return (*arm[i].fun)(o, (char **)p, 0, arm[i].name); + } + /* explicit */ + if (!odr_constructed_begin(o, p, cl, tg, 0)) + return 0; + return (*arm[i].fun)(o, (char **)p, 0, arm[i].name) && + odr_constructed_end(o); + } + } + else /* no tagging. Have to poll type */ + { + if ((*arm[i].fun)(o, (char **)p, 1, arm[i].name) && *(char**)p) + return 1; + } + } + return 0; +} + +void odr_choice_bias(ODR o, int what) +{ + if (o->enable_bias) + o->choice_bias = what; +} + +void odr_choice_enable_bias (ODR o, int mode) +{ + o->enable_bias = mode; +} diff --git a/src/odr_cons.c b/src/odr_cons.c new file mode 100644 index 0000000..7f455dd --- /dev/null +++ b/src/odr_cons.c @@ -0,0 +1,180 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * + * $Id: odr_cons.c,v 1.1 2003-10-27 12:21:33 adam Exp $ + * + */ +#if HAVE_CONFIG_H +#include +#endif + +#include "odr-priv.h" + +void odr_setlenlen(ODR o, int len) +{ + o->lenlen = len; +} + +int odr_constructed_begin(ODR o, void *p, int zclass, int tag, + const char *name) +{ + int res; + int cons = 1; + int lenlen = o->lenlen; + + if (o->error) + return 0; + o->lenlen = 1; /* reset lenlen */ + if (o->t_class < 0) + { + o->t_class = zclass; + o->t_tag = tag; + } + if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, 1, name)) < 0) + return 0; + if (!res || !cons) + return 0; + + if (o->op->stackp == ODR_MAX_STACK - 1) + { + odr_seterror(o, OSTACK, 30); + return 0; + } + o->op->stack[++(o->op->stackp)].lenb = o->bp; + o->op->stack[o->op->stackp].len_offset = odr_tell(o); +#ifdef ODR_DEBUG + fprintf(stderr, "[cons_begin(%d)]", o->op->stackp); +#endif + if (o->direction == ODR_ENCODE) + { + static unsigned char dummy[sizeof(int)+1]; + + o->op->stack[o->op->stackp].lenlen = lenlen; + + if (odr_write(o, dummy, lenlen) < 0) /* dummy */ + { + --(o->op->stackp); + return 0; + } + } + else if (o->direction == ODR_DECODE) + { + if ((res = ber_declen(o->bp, &o->op->stack[o->op->stackp].len, + odr_max(o))) < 0) + { + odr_seterror(o, OOTHER, 31); + --(o->op->stackp); + return 0; + } + o->op->stack[o->op->stackp].lenlen = res; + o->bp += res; + if (o->op->stack[o->op->stackp].len > odr_max(o)) + { + odr_seterror(o, OOTHER, 32); + --(o->op->stackp); + return 0; + } + } + else if (o->direction == ODR_PRINT) + { + odr_prname(o, name); + fprintf(o->print, "{\n"); + o->indent++; + } + else + { + odr_seterror(o, OOTHER, 33); + --(o->op->stackp); + return 0; + } + o->op->stack[o->op->stackp].base = o->bp; + o->op->stack[o->op->stackp].base_offset = odr_tell(o); + return 1; +} + +int odr_constructed_more(ODR o) +{ + if (o->error) + return 0; + if (o->op->stackp < 0) + return 0; + if (o->op->stack[o->op->stackp].len >= 0) + return o->bp - o->op->stack[o->op->stackp].base < o->op->stack[o->op->stackp].len; + else + return (!(*o->bp == 0 && *(o->bp + 1) == 0)); +} + +int odr_constructed_end(ODR o) +{ + int res; + int pos; + + if (o->error) + return 0; + if (o->op->stackp < 0) + { + odr_seterror(o, OOTHER, 34); + return 0; + } + switch (o->direction) + { + case ODR_DECODE: + if (o->op->stack[o->op->stackp].len < 0) + { + if (*o->bp++ == 0 && *(o->bp++) == 0) + { + o->op->stackp--; + return 1; + } + else + { + odr_seterror(o, OOTHER, 35); + return 0; + } + } + else if (o->bp - o->op->stack[o->op->stackp].base != + o->op->stack[o->op->stackp].len) + { + odr_seterror(o, OCONLEN, 36); + return 0; + } + o->op->stackp--; + return 1; + case ODR_ENCODE: + pos = odr_tell(o); + odr_seek(o, ODR_S_SET, o->op->stack[o->op->stackp].len_offset); + if ((res = ber_enclen(o, pos - o->op->stack[o->op->stackp].base_offset, + o->op->stack[o->op->stackp].lenlen, 1)) < 0) + { + odr_seterror(o, OLENOV, 37); + return 0; + } + odr_seek(o, ODR_S_END, 0); + if (res == 0) /* indefinite encoding */ + { +#ifdef ODR_DEBUG + fprintf(stderr, "[cons_end(%d): indefinite]", o->op->stackp); +#endif + if (odr_putc(o, 0) < 0 || odr_putc(o, 0) < 0) + return 0; + } +#ifdef ODR_DEBUG + else + { + fprintf(stderr, "[cons_end(%d): definite]", o->op->stackp); + } +#endif + o->op->stackp--; + return 1; + case ODR_PRINT: + o->op->stackp--; + o->indent--; + odr_prname(o, 0); + fprintf(o->print, "}\n"); + return 1; + default: + odr_seterror(o, OOTHER, 38); + return 0; + } +} diff --git a/src/odr_enum.c b/src/odr_enum.c new file mode 100644 index 0000000..45710f6 --- /dev/null +++ b/src/odr_enum.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: odr_enum.c,v 1.1 2003-10-27 12:21:33 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include "odr-priv.h" + +/* + * Top level enum en/decoder. + * Returns 1 on success, 0 on error. + */ +int odr_enum(ODR o, int **p, int opt, const char *name) +{ + int res, cons = 0; + + if (o->error) + return 0; + if (o->t_class < 0) + { + o->t_class = ODR_UNIVERSAL; + o->t_tag = ODR_ENUM; + } + if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + return 0; + if (!res) + return odr_missing(o, opt, name); + if (o->direction == ODR_PRINT) + { + odr_prname(o, name); + fprintf(o->print, "%d\n", **p); + return 1; + } + if (cons) + { + odr_seterror(o, OPROTO, 54); + return 0; + } + if (o->direction == ODR_DECODE) + *p = (int *)odr_malloc(o, sizeof(int)); + return ber_integer(o, *p); +} diff --git a/src/odr_int.c b/src/odr_int.c new file mode 100644 index 0000000..33e86fb --- /dev/null +++ b/src/odr_int.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: odr_int.c,v 1.1 2003-10-27 12:21:33 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include "odr-priv.h" + +/* + * Top level integer en/decoder. + * Returns 1 on success, 0 on error. + */ +int odr_integer(ODR o, int **p, int opt, const char *name) +{ + int res, cons = 0; + + if (o->error) + return 0; + if (o->t_class < 0) + { + o->t_class = ODR_UNIVERSAL; + o->t_tag = ODR_INTEGER; + } + if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + return 0; + if (!res) + return odr_missing(o, opt, name); + if (o->direction == ODR_PRINT) + { + odr_prname(o, name); + fprintf(o->print, "%d\n", **p); + return 1; + } + if (cons) + { + odr_seterror(o, OPROTO, 1); + return 0; + } + if (o->direction == ODR_DECODE) + *p = (int *)odr_malloc(o, sizeof(int)); + return ber_integer(o, *p); +} diff --git a/src/odr_mem.c b/src/odr_mem.c new file mode 100644 index 0000000..a18b372 --- /dev/null +++ b/src/odr_mem.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * + * $Id: odr_mem.c,v 1.1 2003-10-27 12:21:33 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include "odr-priv.h" +#include + +/* ------------------------ NIBBLE MEMORY ---------------------- */ + +/* + * Extract the memory control block from o. + */ +NMEM odr_extract_mem(ODR o) +{ + NMEM r = o->mem; + + o->mem = 0; + return r; +} + +void *odr_malloc(ODR o, int size) +{ + if (o && !o->mem) + o->mem = nmem_create(); + return nmem_malloc(o ? o->mem : 0, size); +} + +char *odr_strdup(ODR o, const char *str) +{ + return nmem_strdup(o->mem, str); +} + +char *odr_strdupn(ODR o, const char *str, size_t n) +{ + return nmem_strdupn(o->mem, str, n); +} + +int *odr_intdup(ODR o, int v) +{ + return nmem_intdup(o->mem, v); +} + +int odr_total(ODR o) +{ + return o->mem ? nmem_total(o->mem) : 0; +} + +/* ---------- memory management for data encoding ----------*/ + + +int odr_grow_block(ODR b, int min_bytes) +{ + int togrow; + + if (!b->can_grow) + return -1; + if (!b->size) + togrow = 1024; + else + togrow = b->size; + if (togrow < min_bytes) + togrow = min_bytes; + if (b->size && !(b->buf = + (unsigned char *) xrealloc(b->buf, b->size += togrow))) + abort(); + else if (!b->size && !(b->buf = (unsigned char *) + xmalloc(b->size = togrow))) + abort(); +#ifdef ODR_DEBUG + fprintf(stderr, "New size for encode_buffer: %d\n", b->size); +#endif + return 0; +} + +int odr_write(ODR o, unsigned char *buf, int bytes) +{ + if (o->pos + bytes >= o->size && odr_grow_block(o, bytes)) + { + odr_seterror(o, OSPACE, 40); + return -1; + } + memcpy(o->buf + o->pos, buf, bytes); + o->pos += bytes; + if (o->pos > o->top) + o->top = o->pos; + return 0; +} + +int odr_seek(ODR o, int whence, int offset) +{ + if (whence == ODR_S_CUR) + offset += o->pos; + else if (whence == ODR_S_END) + offset += o->top; + if (offset > o->size && odr_grow_block(o, offset - o->size)) + { + odr_seterror(o, OSPACE, 41); + return -1; + } + o->pos = offset; + return 0; +} diff --git a/src/odr_null.c b/src/odr_null.c new file mode 100644 index 0000000..cc33ff7 --- /dev/null +++ b/src/odr_null.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: odr_null.c,v 1.1 2003-10-27 12:21:33 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include "odr-priv.h" + +/* + * Top level null en/decoder. + * Returns 1 on success, 0 on error. + */ +int odr_null(ODR o, Odr_null **p, int opt, const char *name) +{ + int res, cons = 0; + + if (o->error) + return 0; + if (o->t_class < 0) + { + o->t_class = ODR_UNIVERSAL; + o->t_tag = ODR_NULL; + } + if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + return 0; + if (!res) + return odr_missing(o, opt, name); + if (o->direction == ODR_PRINT) + { + odr_prname(o, name); + fprintf(o->print, "NULL\n"); + return 1; + } + if (cons) + { +#ifdef ODR_STRICT_NULL + odr_seterror(OPROTO, 42); + return 0; +#else + fprintf(stderr, "odr: Warning: Bad NULL\n"); +#endif + } + if (o->direction == ODR_DECODE) + *p = odr_nullval(); + return ber_null(o); +} diff --git a/src/odr_oct.c b/src/odr_oct.c new file mode 100644 index 0000000..f8e2682 --- /dev/null +++ b/src/odr_oct.c @@ -0,0 +1,206 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: odr_oct.c,v 1.1 2003-10-27 12:21:33 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include "odr-priv.h" + +/* + * Top level octet string en/decoder. + * Returns 1 on success, 0 on error. + */ +int odr_octetstring(ODR o, Odr_oct **p, int opt, const char *name) +{ + int res, cons = 0; + + if (o->error) + return 0; + if (o->t_class < 0) + { + o->t_class = ODR_UNIVERSAL; + o->t_tag = ODR_OCTETSTRING; + } + if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + return 0; + if (!res) + return odr_missing(o, opt, name); + if (o->direction == ODR_PRINT) + { + int i; + odr_prname(o, name); + fprintf(o->print, "OCTETSTRING(len=%d)", (*p)->len); + for (i = 0; i<(*p)->len; i++) + { + if (i < 5 || i > ((*p)->len - 4)) + { + fprintf (o->print, " %02X", (*p)->buf[i]); + } + else if (i == 5) + fprintf (o->print, " .. "); + } + fprintf(o->print, "\n"); + return 1; + } + if (o->direction == ODR_DECODE) + { + *p = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct)); + (*p)->size= 0; + (*p)->len = 0; + (*p)->buf = 0; + } + if (ber_octetstring(o, *p, cons)) + return 1; + odr_seterror(o, OOTHER, 43); + return 0; +} + +/* + * Friendlier interface to octetstring. + */ +int odr_cstring(ODR o, char **p, int opt, const char *name) +{ + int cons = 0, res; + Odr_oct *t; + + if (o->error) + return 0; + if (o->t_class < 0) + { + o->t_class = ODR_UNIVERSAL; + o->t_tag = ODR_OCTETSTRING; + } + if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + return 0; + if (!res) + return odr_missing(o, opt, name); + if (o->direction == ODR_PRINT) + { + odr_prname(o, name); + fprintf(o->print, "'%s'\n", *p); + return 1; + } + t = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct)); /* wrapper for octstring */ + if (o->direction == ODR_ENCODE) + { + t->buf = (unsigned char *) *p; + t->size = t->len = strlen(*p); + } + else + { + t->size= 0; + t->len = 0; + t->buf = 0; + } + if (!ber_octetstring(o, t, cons)) + return 0; + if (o->direction == ODR_DECODE) + { + *p = (char *) t->buf; + *(*p + t->len) = '\0'; /* ber_octs reserves space for this */ + } + return 1; +} + +/* + * iconv interface to octetstring. + */ +int odr_iconv_string(ODR o, char **p, int opt, const char *name) +{ + int cons = 0, res; + Odr_oct *t; + + if (o->error) + return 0; + if (o->t_class < 0) + { + o->t_class = ODR_UNIVERSAL; + o->t_tag = ODR_OCTETSTRING; + } + if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + return 0; + if (!res) + return odr_missing(o, opt, name); + if (o->direction == ODR_PRINT) + { + odr_prname(o, name); + fprintf(o->print, "'%s'\n", *p); + return 1; + } + t = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct)); /* wrapper for octstring */ + if (o->direction == ODR_ENCODE) + { + t->buf = 0; + + if (o->op->iconv_handle != 0) + { + size_t inleft = strlen(*p); + char *inbuf = *p; + size_t outleft = 4 * inleft + 2; + char *outbuf = (char *) odr_malloc (o, outleft); + size_t ret; + + t->buf = (unsigned char *) outbuf; + + ret = yaz_iconv (o->op->iconv_handle, &inbuf, &inleft, + &outbuf, &outleft); + if (ret == (size_t)(-1)) + { + odr_seterror(o, ODATA, 44); + return 0; + } + t->size = t->len = outbuf - (char*) t->buf; + } + if (!t->buf) + { + t->buf = (unsigned char *) *p; + t->size = t->len = strlen(*p); + } + } + else + { + t->size= 0; + t->len = 0; + t->buf = 0; + } + if (!ber_octetstring(o, t, cons)) + return 0; + if (o->direction == ODR_DECODE) + { + *p = 0; + + if (o->op->iconv_handle != 0) + { + size_t inleft = t->len; + char *inbuf = (char *) t->buf; + size_t outleft = 4 * inleft + 2; + char *outbuf = (char *) odr_malloc (o, outleft); + size_t ret; + + *p = outbuf; + + ret = yaz_iconv (o->op->iconv_handle, &inbuf, &inleft, + &outbuf, &outleft); + if (ret == (size_t)(-1)) + { + odr_seterror(o, ODATA, 45); + return 0; + } + inleft = outbuf - (char*) *p; + + (*p)[inleft] = '\0'; /* null terminate it */ + } + if (!*p) + { + *p = (char *) t->buf; + *(*p + t->len) = '\0'; /* ber_octs reserves space for this */ + } + } + return 1; +} diff --git a/src/odr_oid.c b/src/odr_oid.c new file mode 100644 index 0000000..5ff3f18 --- /dev/null +++ b/src/odr_oid.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: odr_oid.c,v 1.1 2003-10-27 12:21:33 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include "odr-priv.h" +#include + +/* + * Top level oid en/decoder. + * Returns 1 on success, 0 on error. + */ +int odr_oid(ODR o, Odr_oid **p, int opt, const char *name) +{ + int res, cons = 0; + + if (o->error) + return 0; + if (o->t_class < 0) + { + o->t_class = ODR_UNIVERSAL; + o->t_tag = ODR_OID; + } + if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + return 0; + if (!res) + return odr_missing(o, opt, name); + if (cons) + { + odr_seterror(o, OPROTO, 46); + return 0; + } + if (o->direction == ODR_PRINT) + { + int i; + + odr_prname(o, name); + fprintf(o->print, "OID:"); + for (i = 0; (*p)[i] > -1; i++) + fprintf(o->print, " %d", (*p)[i]); + fprintf(o->print, "\n"); + return 1; + } + if (o->direction == ODR_DECODE) + *p = (int *)odr_malloc(o, OID_SIZE * sizeof(**p)); + return ber_oidc(o, *p); +} diff --git a/src/odr_seq.c b/src/odr_seq.c new file mode 100644 index 0000000..c642ac1 --- /dev/null +++ b/src/odr_seq.c @@ -0,0 +1,150 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: odr_seq.c,v 1.1 2003-10-27 12:21:34 adam Exp $ + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include "odr-priv.h" + +int odr_sequence_begin(ODR o, void *p, int size, const char *name) +{ + char **pp = (char**) p; + + if (o->error) + return 0; + if (o->t_class < 0) + { + o->t_class = ODR_UNIVERSAL; + o->t_tag = ODR_SEQUENCE; + } + if (o->direction == ODR_DECODE) + *pp = 0; + if (odr_constructed_begin(o, p, o->t_class, o->t_tag, name)) + { + if (o->direction == ODR_DECODE && size) + *pp = (char *)odr_malloc(o, size); + return 1; + } + else + return 0; +} + +int odr_set_begin(ODR o, void *p, int size, const char *name) +{ + char **pp = (char**) p; + + if (o->error) + return 0; + if (o->t_class < 0) + { + o->t_class = ODR_UNIVERSAL; + o->t_tag = ODR_SET; + } + if (o->direction == ODR_DECODE) + *pp = 0; + if (odr_constructed_begin(o, p, o->t_class, o->t_tag, name)) + { + if (o->direction == ODR_DECODE && size) + *pp = (char *)odr_malloc(o, size); + return 1; + } + else + return 0; +} + +int odr_sequence_end(ODR o) +{ + return odr_constructed_end(o); +} + +int odr_set_end(ODR o) +{ + return odr_constructed_end(o); +} + +static int odr_sequence_more(ODR o) +{ + return odr_constructed_more(o); +} + +static int odr_sequence_x (ODR o, Odr_fun type, void *p, int *num) +{ + char ***pp = (char***) p; /* for dereferencing */ + char **tmp = 0; + int size = 0, i; + + switch (o->direction) + { + case ODR_DECODE: + *num = 0; + *pp = (char **)odr_nullval(); + while (odr_sequence_more(o)) + { + /* outgrown array? */ + if (*num * (int) sizeof(void*) >= size) + { + /* double the buffer size */ + tmp = (char **)odr_malloc(o, sizeof(void*) * + (size += size ? size : 128)); + if (*num) + { + memcpy(tmp, *pp, *num * sizeof(void*)); + /* + * For now, we just throw the old *p away, since we use + * nibble memory anyway (disgusting, isn't it?). + */ + } + *pp = tmp; + } + if (!(*type)(o, (*pp) + *num, 0, 0)) + return 0; + (*num)++; + } + break; + case ODR_ENCODE: case ODR_PRINT: +#ifdef ODR_DEBUG + fprintf(stderr, "[seqof: num=%d]", *num); +#endif + for (i = 0; i < *num; i++) + { +#ifdef ODR_DEBUG + fprintf(stderr, "[seqof: elem #%d]", i); +#endif + if (!(*type)(o, *pp + i, 0, 0)) + return 0; + } + break; + default: + odr_seterror(o, OOTHER, 47); + return 0; + } + return odr_sequence_end(o); +} + +int odr_set_of(ODR o, Odr_fun type, void *p, int *num, const char *name) +{ + if (!odr_set_begin(o, p, 0, name)) { + if (o->direction == ODR_DECODE) + *num = 0; + return 0; + } + return odr_sequence_x (o, type, p, num); +} + +int odr_sequence_of(ODR o, Odr_fun type, void *p, int *num, + const char *name) +{ + if (!odr_sequence_begin(o, p, 0, name)) { + if (o->direction == ODR_DECODE) + *num = 0; + return 0; + } + return odr_sequence_x (o, type, p, num); +} + diff --git a/src/odr_tag.c b/src/odr_tag.c new file mode 100644 index 0000000..a8f31f2 --- /dev/null +++ b/src/odr_tag.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: odr_tag.c,v 1.1 2003-10-27 12:21:34 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include "odr-priv.h" + +int odr_peektag(ODR o, int *zclass, int *tag, int *cons) +{ + if (o->direction != ODR_DECODE) + { + odr_seterror(o, OOTHER, 48); + return 0; + } + if (o->op->stackp > -1 && !odr_constructed_more(o)) + return 0; + if (ber_dectag(o->bp, zclass, tag, cons, odr_max(o)) <= 0) + { + odr_seterror(o, OREQUIRED, 49); + return 0; + } + return 1; +} + +int odr_implicit_settag(ODR o, int zclass, int tag) +{ + if (o->error) + return 0; + if (o->t_class < 0) + { + o->t_class = zclass; + o->t_tag = tag; + } + return 1; +} + +int odr_initmember(ODR o, void *p, int size) +{ + char **pp = (char **) p; + + if (o->error) + return 0; + if (o->direction == ODR_DECODE) + *pp = (char *)odr_malloc(o, size); + else if (!*pp) + { + o->t_class = -1; + return 0; + } + return 1; +} diff --git a/src/odr_use.c b/src/odr_use.c new file mode 100644 index 0000000..92e0363 --- /dev/null +++ b/src/odr_use.c @@ -0,0 +1,66 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: odr_use.c,v 1.1 2003-10-27 12:21:34 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include "odr-priv.h" + +int odr_external(ODR o, Odr_external **p, int opt, const char *name) +{ + Odr_external *pp; + static Odr_arm arm[] = + { + {ODR_EXPLICIT, ODR_CONTEXT, 0, ODR_EXTERNAL_single, + (Odr_fun)odr_any, "single"}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, ODR_EXTERNAL_octet, + (Odr_fun)odr_octetstring, "octet"}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, ODR_EXTERNAL_arbitrary, + (Odr_fun)odr_bitstring, "arbitrary"}, + {-1, -1, -1, -1, 0, 0} + }; + + odr_implicit_settag(o, ODR_UNIVERSAL, ODR_EXTERNAL); + if (!odr_sequence_begin(o, p, sizeof(Odr_external), name)) + return odr_missing(o, opt, name); + pp = *p; + return + odr_oid(o, &pp->direct_reference, 1, "direct") && + odr_integer(o, &pp->indirect_reference, 1, "indirect") && + odr_graphicstring(o, &pp->descriptor, 1, "descriptor") && + odr_choice(o, arm, &pp->u, &pp->which, 0) && + odr_sequence_end(o); +} + +int odr_visiblestring(ODR o, char **p, int opt, const char *name) +{ + return odr_implicit_tag(o, odr_cstring, p, ODR_UNIVERSAL, + ODR_VISIBLESTRING, opt, name); +} + +/* + * a char may not be sufficient to hold a general string, but we'll deal + * with that once we start looking more closely at UniCode & co. + */ +int odr_generalstring(ODR o, char **p, int opt, const char *name) +{ + return odr_implicit_tag(o, odr_iconv_string, p, ODR_UNIVERSAL, + ODR_GENERALSTRING,opt, name); +} + +int odr_graphicstring(ODR o, char **p, int opt, const char *name) +{ + return odr_implicit_tag(o, odr_cstring, p, ODR_UNIVERSAL, + ODR_GRAPHICSTRING, opt, name); +} + +int odr_generalizedtime(ODR o, char **p, int opt, const char *name) +{ + return odr_implicit_tag(o, odr_cstring, p, ODR_UNIVERSAL, + ODR_GENERALIZEDTIME, opt, name); +} diff --git a/src/odr_util.c b/src/odr_util.c new file mode 100644 index 0000000..d95a693 --- /dev/null +++ b/src/odr_util.c @@ -0,0 +1,94 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * + * $Id: odr_util.c,v 1.1 2003-10-27 12:21:34 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include "odr-priv.h" +#include + +void odr_prname(ODR o, const char *name) +{ + if (name) + fprintf (o->print, "%*s%s ", o->indent*4, "", name); + else + fprintf (o->print, "%*s", o->indent*4, ""); +} + +int odp_more_chunks(ODR o, const unsigned char *base, int len) +{ + if (!len) + return 0; + if (len < 0) /* indefinite length */ + { + if (*o->bp == 0 && *(o->bp + 1) == 0) + { + o->bp += 2; + return 0; + } + else + return 1; + } + else + return o->bp - base < len; +} + +Odr_oid *odr_oiddup_nmem(NMEM nmem, Odr_oid *o) +{ + Odr_oid *r; + + if (!o) + return 0; + if (!(r = (int *)nmem_malloc(nmem, (oid_oidlen(o) + 1) * sizeof(int)))) + return 0; + oid_oidcpy(r, o); + return r; +} + +Odr_oid *odr_oiddup(ODR odr, Odr_oid *o) +{ + return odr_oiddup_nmem (odr->mem, o); +} + +Odr_oid *odr_getoidbystr_nmem(NMEM nmem, const char *str) +{ + int num = 1, i = 0; + const char *p = str; + Odr_oid *ret; + + if (!isdigit(*str)) + return 0; + while ((p = strchr(p, '.'))) + num++, p++; + ret = (int *)nmem_malloc(nmem, sizeof(*ret)*(num + 1)); + p = str; + do + ret[i++] = atoi(p); + while ((p = strchr(p, '.')) && *++p); + ret[i] = -1; + return ret; +} + +Odr_oid *odr_getoidbystr(ODR o, const char *str) +{ + return odr_getoidbystr_nmem (o->mem, str); +} + +int odr_missing(ODR o, int opt, const char *name) +{ + if (o->error) + return 0; + if (!opt) + { + odr_seterror(o, OREQUIRED, 53); + odr_setelement(o, name); + } + return opt; +} diff --git a/src/oid.c b/src/oid.c new file mode 100644 index 0000000..2b7fb2d --- /dev/null +++ b/src/oid.c @@ -0,0 +1,614 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * + * $Id: oid.c,v 1.1 2003-10-27 12:21:34 adam Exp $ + */ + +/* + * More or less protocol-transparent OID database. + * We could (and should?) extend this so that the user app can add new + * entries to the list at initialization. + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include +#include + +static int z3950_prefix[] = { 1, 2, 840, 10003, -1 }; +static int sr_prefix[] = { 1, 0, 10163, -1 }; + +struct oident_list { + struct oident oident; + struct oident_list *next; +}; + +static struct oident_list *oident_table = NULL; +static int oid_value_dynamic = VAL_DYNAMIC; +static int oid_init_flag = 0; +static NMEM_MUTEX oid_mutex = 0; +static NMEM oid_nmem = 0; + +/* + * OID database + */ +static oident standard_oids[] = +{ + /* General definitions */ + {PROTO_GENERAL, CLASS_TRANSYN, VAL_BER, {2,1,1,-1}, + "BER" }, + {PROTO_GENERAL, CLASS_TRANSYN, VAL_ISO2709, {1,0,2709,1,1,-1}, + "ISO2709"}, + {PROTO_GENERAL, CLASS_GENERAL, VAL_ISO_ILL_1, {1,0,10161,2,1,-1}, + "ISOILL-1"}, + /* Z39.50v3 definitions */ + {PROTO_Z3950, CLASS_ABSYN, VAL_APDU, {2,1,-1}, + "Z-APDU"}, + {PROTO_Z3950, CLASS_APPCTX, VAL_BASIC_CTX, {1,1,-1}, + "Z-BASIC"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_BIB1, {3,1,-1}, + "Bib-1"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_EXP1, {3,2,-1}, + "Exp-1"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_EXT1, {3,3,-1}, + "Ext-1"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_CCL1, {3,4,-1}, + "CCL-1"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_GILS, {3,5,-1}, + "GILS-attset"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_GILS, {3,5,-1}, + "GILS"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_STAS, {3,6,-1}, + "STAS-attset"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_COLLECT1, {3,7,-1}, + "Collections-attset"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_CIMI1, {3,8,-1}, + "CIMI-attset"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_GEO, {3,9,-1}, + "Geo-attset"}, + + {PROTO_Z3950, CLASS_ATTSET, VAL_ZBIG, {3,10,-1}, + "ZBIG"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_UTIL, {3,11,-1}, + "Util"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_XD1, {3,12,-1}, + "XD-1"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_ZTHES, {3,13,-1}, + "Zthes"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_FIN1, {3,14,-1}, + "Fin-1"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_DAN1, {3,15,-1}, + "Dan-1"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_HOLDINGS, {3,16,-1}, + "Holdings"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_USMARC, {3,17,-1}, + "MARC"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_BIB2, {3,18,-1}, + "Bib-2"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_ZEEREX, {3,19,-1}, + "ZeeRex"}, + /* New applications should use Zthes-1 instead of this Satan-spawn */ + {PROTO_Z3950, CLASS_ATTSET, VAL_THESAURUS, {3,1000,81,1,-1}, + "Thesaurus-attset"}, + {PROTO_Z3950, CLASS_ATTSET, VAL_IDXPATH, {3,1000,81,2,-1}, + "IDXPATH"}, + {PROTO_Z3950, CLASS_DIAGSET, VAL_BIB1, {4,1,-1}, + "Bib-1"}, + {PROTO_Z3950, CLASS_DIAGSET, VAL_DIAG1, {4,2,-1}, + "Diag-1"}, + {PROTO_Z3950, CLASS_DIAGSET, VAL_DIAG_ES, {4,3,-1}, + "Diag-ES"}, + {PROTO_Z3950, CLASS_DIAGSET, VAL_DIAG_GENERAL, {4,3,-1}, + "Diag-General"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_UNIMARC, {5,1,-1}, + "Unimarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_INTERMARC, {5,2,-1}, + "Intermarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_CCF, {5,3,-1}, + "CCF"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_USMARC, {5,10,-1}, + "USmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_UKMARC, {5,11,-1}, + "UKmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_NORMARC, {5,12,-1}, + "Normarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_LIBRISMARC, {5,13,-1}, + "Librismarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_DANMARC, {5,14,-1}, + "Danmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_FINMARC, {5,15,-1}, + "Finmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_MAB, {5,16,-1}, + "MAB"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_CANMARC, {5,17,-1}, + "Canmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_SBN, {5,18,-1}, + "SBN"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_PICAMARC, {5,19,-1}, + "Picamarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_AUSMARC, {5,20,-1}, + "Ausmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_IBERMARC, {5,21,-1}, + "Ibermarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_CATMARC, {5,22,-1}, + "Carmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_MALMARC, {5,23,-1}, + "Malmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_JPMARC, {5,24,-1}, + "JPmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_SWEMARC, {5,25,-1}, + "SWEmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_SIGLEMARC, {5,26,-1}, + "SIGLEmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_ISDSMARC, {5,27,-1}, + "ISDSmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_RUSMARC, {5,28,-1}, + "RUSmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_HUNMARC, {5,29,-1}, + "Hunmarc"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_EXPLAIN, {5,100,-1}, + "Explain"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_SUTRS, {5,101,-1}, + "SUTRS"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_OPAC, {5,102,-1}, + "OPAC"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_SUMMARY, {5,103,-1}, + "Summary"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_GRS0, {5,104,-1}, + "GRS-0"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_GRS1, {5,105,-1}, + "GRS-1"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_EXTENDED, {5,106,-1}, + "Extended"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_FRAGMENT, {5,107,-1}, + "Fragment"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_PDF, {5,109,1,-1}, + "pdf"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_POSTSCRIPT, {5,109,2,-1}, + "postscript"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_HTML, {5,109,3,-1}, + "html"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_TIFF, {5,109,4,-1}, + "tiff"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_GIF, {5,109,5,-1}, + "gif"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_JPEG, {5,109,6,-1}, + "jpeg"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_PNG, {5,109,7,-1}, + "png"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_MPEG, {5,109,8,-1}, + "mpeg"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_SGML, {5,109,9,-1}, + "sgml"}, + + {PROTO_Z3950, CLASS_RECSYN, VAL_TIFFB, {5,110,1,-1}, + "tiff-b"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_WAV, {5,110,2,-1}, + "wav"}, + + {PROTO_Z3950, CLASS_RECSYN, VAL_SQLRS, {5,111,-1}, + "SQL-RS"}, + {PROTO_Z3950, CLASS_RECSYN, VAL_SOIF, {5,1000,81,2,-1}, + "SOIF" }, + {PROTO_Z3950, CLASS_RECSYN, VAL_TEXT_XML, {5,109,10,-1}, + "text-XML" }, + {PROTO_Z3950, CLASS_RECSYN, VAL_TEXT_XML, {5,109,10,-1}, + "XML" }, + {PROTO_Z3950, CLASS_RECSYN, VAL_APPLICATION_XML, {5,109,11,-1}, + "application-XML" }, + {PROTO_Z3950, CLASS_RESFORM, VAL_RESOURCE1, {7,1,-1}, + "Resource-1"}, + {PROTO_Z3950, CLASS_RESFORM, VAL_RESOURCE2, {7,2,-1}, + "Resource-2"}, + {PROTO_Z3950, CLASS_RESFORM, VAL_UNIVERSE_REPORT, {7,1000,81,1,-1}, + "UNIverse-Resource-Report"}, + + {PROTO_Z3950, CLASS_ACCFORM, VAL_PROMPT1, {8,1,-1}, + "Prompt-1"}, + {PROTO_Z3950, CLASS_ACCFORM, VAL_DES1, {8,2,-1}, + "Des-1"}, + {PROTO_Z3950, CLASS_ACCFORM, VAL_KRB1, {8,3,-1}, + "Krb-1"}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_PRESSET, {9,1,-1}, + "Pers. set"}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_PQUERY, {9,2,-1}, + "Pers. query"}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_PCQUERY, {9,3,-1}, + "Per'd query"}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_ITEMORDER, {9,4,-1}, + "Item order"}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_DBUPDATE0, {9,5,-1}, + "DB. Update (first version)"}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_DBUPDATE1, {9,5,1,-1}, + "DB. Update (second version)"}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_DBUPDATE, {9,5,1,1,-1}, + "DB. Update"}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_EXPORTSPEC, {9,6,-1}, + "exp. spec."}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_EXPORTINV, {9,7,-1}, + "exp. inv."}, + {PROTO_Z3950, CLASS_EXTSERV, VAL_ADMINSERVICE, {9,1000,81,1,-1}, + "Admin"}, + {PROTO_Z3950, CLASS_USERINFO,VAL_SEARCHRES1, {10,1,-1}, + "searchResult-1"}, + {PROTO_Z3950, CLASS_USERINFO,VAL_CHARLANG, {10,2,-1}, + "CharSetandLanguageNegotiation"}, + {PROTO_Z3950, CLASS_USERINFO,VAL_USERINFO1, {10,3,-1}, + "UserInfo-1"}, + {PROTO_Z3950, CLASS_USERINFO,VAL_MULTISRCH1, {10,4,-1}, + "MultipleSearchTerms-1"}, + {PROTO_Z3950, CLASS_USERINFO,VAL_MULTISRCH2, {10,5,-1}, + "MultipleSearchTerms-2"}, + {PROTO_Z3950, CLASS_USERINFO,VAL_DATETIME, {10,6,-1}, + "DateTime"}, + {PROTO_Z3950, CLASS_USERINFO,VAL_PROXY, {10,1000,81,1,-1}, + "Proxy" }, + {PROTO_Z3950, CLASS_USERINFO,VAL_COOKIE, {10,1000,81,2,-1}, + "Cookie" }, + {PROTO_Z3950, CLASS_USERINFO,VAL_CLIENT_IP, {10,1000,81,3,-1}, + "Client-IP" }, + {PROTO_Z3950, CLASS_ELEMSPEC,VAL_ESPEC1, {11,1,-1}, + "Espec-1"}, + {PROTO_Z3950, CLASS_VARSET, VAL_VAR1, {12,1,-1}, + "Variant-1"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_WAIS, {13,1,-1}, + "WAIS-schema"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_GILS, {13,2,-1}, + "GILS-schema"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_COLLECT1, {13,3,-1}, + "Collections-schema"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_GEO, {13,4,-1}, + "Geo-schema"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_CIMI1, {13,5,-1}, + "CIMI-schema"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_UPDATEES, {13,6,-1}, + "Update ES"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_HOLDINGS, {13,7,-1}, + "Holdings"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_ZTHES, {13,8,-1}, + "Zthes"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_THESAURUS, {13,1000,81,1,-1}, + "thesaurus-schema"}, + {PROTO_Z3950, CLASS_SCHEMA, VAL_EXPLAIN, {13,1000,81,2,-1}, + "Explain-schema"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_SETM, {14,1,-1}, + "TagsetM"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_SETG, {14,2,-1}, + "TagsetG"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_STAS, {14,3,-1}, + "STAS-tagset"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_GILS, {14,4,-1}, + "GILS-tagset"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_COLLECT1, {14,5,-1}, + "Collections-tagset"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_CIMI1, {14,6,-1}, + "CIMI-tagset"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_THESAURUS, {14,1000,81,1,-1}, + "thesaurus-tagset"}, /* What is this Satan-spawn doing here? */ + {PROTO_Z3950, CLASS_TAGSET, VAL_EXPLAIN, {14,1000,81,2,-1}, + "Explain-tagset"}, + {PROTO_Z3950, CLASS_TAGSET, VAL_ZTHES, {14,8,-1}, + "Zthes-tagset"}, + {PROTO_Z3950, CLASS_NEGOT, VAL_CHARNEG3, {15,3,-1}, + "CharSetandLanguageNegotiation-3"}, + {PROTO_Z3950, CLASS_NEGOT, VAL_ID_CHARSET, {15,1000,81,1,-1}, + "ID-Charset" }, + {PROTO_Z3950, CLASS_USERINFO,VAL_CQL, {16, 2, -1}, + "CQL"}, + {PROTO_GENERAL, CLASS_GENERAL, VAL_UCS2, {1,0,10646,1,0,2,-1}, + "UCS-2"}, + {PROTO_GENERAL, CLASS_GENERAL, VAL_UCS4, {1,0,10646,1,0,4,-1}, + "UCS-4"}, + {PROTO_GENERAL, CLASS_GENERAL, VAL_UTF16, {1,0,10646,1,0,5,-1}, + "UTF-16"}, + {PROTO_GENERAL, CLASS_GENERAL, VAL_UTF8, {1,0,10646,1,0,8,-1}, + "UTF-8"}, + {PROTO_Z3950, CLASS_USERINFO,VAL_OCLCUI, {10, 1000, 17, 1, -1}, + "OCLC-userInfo"}, + {PROTO_NOP, CLASS_NOP, VAL_NOP, {-1}, 0 } +}; + +/* OID utilities */ + +void oid_oidcpy(int *t, int *s) +{ + while ((*(t++) = *(s++)) > -1); +} + +void oid_oidcat(int *t, int *s) +{ + while (*t > -1) + t++; + while ((*(t++) = *(s++)) > -1); +} + +int oid_oidcmp(int *o1, int *o2) +{ + while (*o1 == *o2 && *o1 > -1) + { + o1++; + o2++; + } + if (*o1 == *o2) + return 0; + else if (*o1 > *o2) + return 1; + else + return -1; +} + +int oid_oidlen(int *o) +{ + int len = 0; + + while (*(o++) >= 0) + len++; + return len; +} + + +static int match_prefix(int *look, int *prefix) +{ + int len; + + for (len = 0; *look == *prefix; look++, prefix++, len++); + if (*prefix < 0) /* did we reach the end of the prefix? */ + return len; + return 0; +} + +void oid_transfer (struct oident *oidentp) +{ + while (*oidentp->oidsuffix >= 0) + { + oid_addent (oidentp->oidsuffix, oidentp->proto, + oidentp->oclass, + oidentp->desc, oidentp->value); + oidentp++; + } +} + +void oid_init (void) +{ + if (oid_init_flag == 0) + { + /* oid_transfer is thread safe, so there's nothing wrong in having + two threads calling it simultaniously. On the other hand + no thread may exit oid_init before all OID's bave been + transferred - which is why checked is set after oid_transfer... + */ + nmem_mutex_create (&oid_mutex); + nmem_mutex_enter (oid_mutex); + if (!oid_nmem) + oid_nmem = nmem_create (); + nmem_mutex_leave (oid_mutex); + oid_transfer (standard_oids); + oid_init_flag = 1; + } +} + +void oid_exit (void) +{ + if (oid_init_flag) + { + oid_init_flag = 0; + nmem_mutex_destroy (&oid_mutex); + nmem_destroy (oid_nmem); + oid_nmem = 0; + } +} + +static struct oident *oid_getentbyoid_x(int *o) +{ + enum oid_proto proto; + int prelen; + struct oident_list *ol; + + /* determine protocol type */ + if ((prelen = match_prefix(o, z3950_prefix)) != 0) + proto = PROTO_Z3950; + else if ((prelen = match_prefix(o, sr_prefix)) != 0) + proto = PROTO_SR; + else + proto = PROTO_GENERAL; + for (ol = oident_table; ol; ol = ol->next) + { + struct oident *p = &ol->oident; + if (p->proto == proto && !oid_oidcmp(o + prelen, p->oidsuffix)) + return p; + if (p->proto == PROTO_GENERAL && !oid_oidcmp (o, p->oidsuffix)) + return p; + } + return 0; +} + +/* + * To query, fill out proto, class, and value of the ent parameter. + */ +int *oid_ent_to_oid(struct oident *ent, int *ret) +{ + struct oident_list *ol; + + oid_init (); + for (ol = oident_table; ol; ol = ol->next) + { + struct oident *p = &ol->oident; + if (ent->value == p->value && + (p->proto == PROTO_GENERAL || (ent->proto == p->proto && + (ent->oclass == p->oclass || ent->oclass == CLASS_GENERAL)))) + { + if (p->proto == PROTO_Z3950) + oid_oidcpy(ret, z3950_prefix); + else if (p->proto == PROTO_SR) + oid_oidcpy(ret, sr_prefix); + else + ret[0] = -1; + oid_oidcat(ret, p->oidsuffix); + ent->desc = p->desc; + return ret; + } + } + ret[0] = -1; + return 0; +} + +/* + * To query, fill out proto, class, and value of the ent parameter. + */ +int *oid_getoidbyent(struct oident *ent) +{ + static int ret[OID_SIZE]; + + return oid_ent_to_oid (ent, ret); +} + +struct oident *oid_addent (int *oid, enum oid_proto proto, + enum oid_class oclass, + const char *desc, int value) +{ + struct oident *oident = 0; + + nmem_mutex_enter (oid_mutex); + if (!oident) + { + char desc_str[200]; + struct oident_list *oident_list; + oident_list = (struct oident_list *) + nmem_malloc (oid_nmem, sizeof(*oident_list)); + oident = &oident_list->oident; + oident->proto = proto; + oident->oclass = oclass; + + if (!desc) + { + int i; + + sprintf (desc_str, "%d", *oid); + for (i = 1; i < 12 && oid[i] >= 0; i++) + sprintf (desc_str+strlen(desc_str), ".%d", oid[i]); + desc = desc_str; + } + oident->desc = nmem_strdup (oid_nmem, desc); + if (value == VAL_DYNAMIC) + oident->value = (enum oid_value) (++oid_value_dynamic); + else + oident->value = (enum oid_value) value; + oid_oidcpy (oident->oidsuffix, oid); + oident_list->next = oident_table; + oident_table = oident_list; + } + nmem_mutex_leave (oid_mutex); + return oident; +} + +struct oident *oid_getentbyoid(int *oid) +{ + struct oident *oident; + + if (!oid) + return 0; + oid_init (); + oident = oid_getentbyoid_x (oid); + if (!oident) + oident = oid_addent (oid, PROTO_GENERAL, CLASS_GENERAL, + NULL, VAL_DYNAMIC); + return oident; +} + +static oid_value oid_getval_raw(const char *name) +{ + int val = 0, i = 0, oid[OID_SIZE]; + struct oident *oident; + + while (isdigit (*name)) + { + val = val*10 + (*name - '0'); + name++; + if (*name == '.') + { + if (i < OID_SIZE-1) + oid[i++] = val; + val = 0; + name++; + } + } + oid[i] = val; + oid[i+1] = -1; + oident = oid_getentbyoid_x (oid); + if (!oident) + oident = oid_addent (oid, PROTO_GENERAL, CLASS_GENERAL, NULL, + VAL_DYNAMIC); + return oident->value; +} + +oid_value oid_getvalbyname(const char *name) +{ + struct oident_list *ol; + + oid_init (); + if (isdigit (*name)) + return oid_getval_raw (name); + for (ol = oident_table; ol; ol = ol->next) + if (!yaz_matchstr(ol->oident.desc, name)) + { + return ol->oident.value; + } + return VAL_NONE; +} + +void oid_setprivateoids(oident *list) +{ + oid_transfer (list); +} + +void oid_trav (void (*func)(struct oident *oidinfo, void *vp), void *vp) +{ + struct oident_list *ol; + + oid_init (); + for (ol = oident_table; ol; ol = ol->next) + (*func)(&ol->oident, vp); +} + +int *oid_name_to_oid(oid_class oclass, const char *name, int *oid) { + struct oident ent; + + /* Translate syntax to oid_val */ + oid_value value = oid_getvalbyname(name); + + /* Build it into an oident */ + ent.proto = PROTO_Z3950; + ent.oclass = oclass; + ent.value = value; + + /* Translate to an array of int */ + return oid_ent_to_oid(&ent, oid); +} + +char *oid_to_dotstring(const int *oid, char *oidbuf) { + char tmpbuf[20]; + int i; + + oidbuf[0] = '\0'; + for (i = 0; oid[i] != -1; i++) { + sprintf(tmpbuf, "%d", oid[i]); + if (i > 0) strcat(oidbuf, "."); + strcat(oidbuf, tmpbuf); + } + + return oidbuf; +} + +char *oid_name_to_dotstring(oid_class oclass, const char *name, char *oidbuf) { + int oid[OID_SIZE]; + + (void) oid_name_to_oid(oclass, name, oid); + return oid_to_dotstring(oid, oidbuf); +} + diff --git a/src/opacdisp.c b/src/opacdisp.c new file mode 100644 index 0000000..157e58f --- /dev/null +++ b/src/opacdisp.c @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2003, Index Data. + * See the file LICENSE for details. + * + * $Id: opacdisp.c,v 1.1 2003-10-27 12:21:34 adam Exp $ + */ + +#include +#include +#include +#include + +#include + +static void opac_element_str(WRBUF wrbuf, int l, const char *elem, + const char *data) +{ + if (data) + { + while (--l >= 0) + wrbuf_puts(wrbuf, " "); + wrbuf_puts(wrbuf, "<"); + wrbuf_puts(wrbuf, elem); + wrbuf_puts(wrbuf, ">"); + wrbuf_xmlputs(wrbuf, data); + wrbuf_puts(wrbuf, "\n"); + } +} + +static void opac_element_bool(WRBUF wrbuf, int l, const char *elem, int *data) +{ + if (data) + { + while (--l >= 0) + wrbuf_puts(wrbuf, " "); + wrbuf_puts(wrbuf, "<"); + wrbuf_puts(wrbuf, elem); + if (*data) + wrbuf_puts(wrbuf, " value=\"1\""); + else + wrbuf_puts(wrbuf, " value=\"0\""); + wrbuf_puts(wrbuf, "/>\n"); + } +} + +void yaz_display_OPAC(WRBUF wrbuf, Z_OPACRecord *r, int flags) +{ + int i; + wrbuf_puts(wrbuf, "\n"); + + for (i = 0; i < r->num_holdingsData; i++) + { + Z_HoldingsRecord *h = r->holdingsData[i]; + wrbuf_puts(wrbuf, " \n"); + + if (h->which == Z_HoldingsRecord_marcHoldingsRecord) + { + wrbuf_puts (wrbuf, " \n"); + /* h->u.marcHoldingsRecord) */ + } + else if (h->which == Z_HoldingsRecord_holdingsAndCirc) + { + int j; + + Z_HoldingsAndCircData *d = h->u.holdingsAndCirc; + + opac_element_str(wrbuf, 2, "typeOfRecord", d->typeOfRecord); + opac_element_str(wrbuf, 2, "encodingLevel", d->encodingLevel); + opac_element_str(wrbuf, 2, "format", d->format); + opac_element_str(wrbuf, 2, "receiptAcqStatus", d->receiptAcqStatus); + opac_element_str (wrbuf, 2, "generalRetention", d->generalRetention); + opac_element_str (wrbuf, 2, "completeness", d->completeness); + opac_element_str (wrbuf, 2, "dateOfReport", d->dateOfReport); + opac_element_str (wrbuf, 2, "nucCode", d->nucCode); + opac_element_str (wrbuf, 2, "localLocation", d->localLocation); + opac_element_str (wrbuf, 2, "shelvingLocation", d->shelvingLocation); + opac_element_str (wrbuf, 2, "callNumber", d->callNumber); + opac_element_str (wrbuf, 2, "copyNumber", d->copyNumber); + opac_element_str (wrbuf, 2, "publicNote", d->publicNote); + opac_element_str (wrbuf, 2, "reproductionNote", d->reproductionNote); + opac_element_str (wrbuf, 2, "termsUseRepro", d->termsUseRepro); + opac_element_str (wrbuf, 2, "enumAndChron", d->enumAndChron); + if (d->num_volumes) + { + wrbuf_puts (wrbuf, " \n"); + for (j = 0; jnum_volumes; j++) + { + wrbuf_puts (wrbuf, " \n"); + opac_element_str (wrbuf, 4, "enumeration", + d->volumes[j]->enumeration); + opac_element_str (wrbuf, 4, "chronology", + d->volumes[j]->chronology); + opac_element_str (wrbuf, 4, "enumAndChron", + d->volumes[j]->enumAndChron); + wrbuf_puts (wrbuf, " \n"); + } + wrbuf_puts (wrbuf, " \n"); + } + if (d->num_circulationData) + { + wrbuf_puts (wrbuf, " \n"); + for (j = 0; jnum_circulationData; j++) + { + wrbuf_puts (wrbuf," \n"); + opac_element_bool (wrbuf, 4, "availableNow", + d->circulationData[j]->availableNow); + opac_element_str (wrbuf, 4, "availabiltyDate", + d->circulationData[j]->availablityDate); + opac_element_str (wrbuf, 4, "availableThru", + d->circulationData[j]->availableThru); + opac_element_str (wrbuf, 4, "restrictions", + d->circulationData[j]->restrictions); + opac_element_str (wrbuf, 4, "itemId", + d->circulationData[j]->itemId); + opac_element_bool (wrbuf, 4, "renewable", + d->circulationData[j]->renewable); + opac_element_bool (wrbuf, 4, "onHold", + d->circulationData[j]->onHold); + opac_element_str (wrbuf, 4, "enumAndChron", + d->circulationData[j]->enumAndChron); + opac_element_str (wrbuf, 4, "midspine", + d->circulationData[j]->midspine); + opac_element_str (wrbuf, 4, "temporaryLocation", + d->circulationData[j]->temporaryLocation); + wrbuf_puts (wrbuf, " \n"); + } + wrbuf_puts (wrbuf, " \n"); + } + } + wrbuf_puts(wrbuf, " \n"); + } + wrbuf_puts(wrbuf, "\n"); +} diff --git a/src/options.c b/src/options.c new file mode 100644 index 0000000..ee836da --- /dev/null +++ b/src/options.c @@ -0,0 +1,121 @@ +/* + * Copyright (c) 1995-2000, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Log: options.c,v $ + * Revision 1.1 2003-10-27 12:21:34 adam + * Source restructure. yaz-marcdump part of installation + * + * Revision 1.8 2000/02/29 13:44:55 adam + * Check for config.h (currently not generated). + * + * Revision 1.7 1999/11/30 13:47:12 adam + * Improved installation. Moved header files to include/yaz. + * + * Revision 1.6 1997/09/01 08:54:13 adam + * New windows NT/95 port using MSV5.0. Made prefix query handling + * thread safe. The function options ignores empty arguments when met. + * + * Revision 1.5 1995/12/06 13:00:19 adam + * Minus alone not treated as an option. + * + * Revision 1.4 1995/09/29 17:12:35 quinn + * Smallish + * + * Revision 1.3 1995/09/27 15:03:03 quinn + * Modified function heads & prototypes. + * + * Revision 1.2 1995/05/16 08:51:13 quinn + * License, documentation, and memory fixes + * + * Revision 1.1 1995/03/27 08:35:18 quinn + * Created util library + * Added memory debugging module. Imported options-manager + * + * Revision 1.2 1994/10/04 17:47:10 adam + * Function options now returns arg with error option. + * + * Revision 1.1 1994/08/16 15:57:22 adam + * The first utility modules. + * + */ +#if HAVE_CONFIG_H +#include +#endif + +#include + +#include + +static int arg_no = 1; +static int arg_off = 0; + +int options (const char *desc, char **argv, int argc, char **arg) +{ + int ch, i = 0; + + if (arg_no >= argc) + return -2; + if (arg_off == 0) + { + while (argv[arg_no][0] == '\0') + { + arg_no++; + if (arg_no >= argc) + return -2; + } + if (argv[arg_no][0] != '-' || argv[arg_no][1] == '\0') + { + *arg = argv[arg_no++]; + return 0; + } + arg_off++; + } + ch = argv[arg_no][arg_off++]; + while (desc[i]) + { + int desc_char = desc[i++]; + int type = 0; + if (desc[i] == ':') + { /* string argument */ + type = desc[i++]; + } + if (desc_char == ch) + { /* option with argument */ + if (type) + { + if (argv[arg_no][arg_off]) + { + *arg = argv[arg_no]+arg_off; + arg_no++; + arg_off = 0; + } + else + { + arg_no++; + arg_off = 0; + if (arg_no < argc) + *arg = argv[arg_no++]; + else + *arg = ""; + } + } + else /* option with no argument */ + { + if (argv[arg_no][arg_off]) + arg_off++; + else + { + arg_off = 0; + arg_no++; + } + } + return ch; + } + } + *arg = argv[arg_no]+arg_off-1; + arg_no = arg_no + 1; + arg_off = 0; + return -1; +} diff --git a/src/otherinfo.c b/src/otherinfo.c new file mode 100644 index 0000000..72de061 --- /dev/null +++ b/src/otherinfo.c @@ -0,0 +1,211 @@ +/* + * Copyright (c) 1999-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: otherinfo.c,v 1.1 2003-10-27 12:21:34 adam Exp $ + */ + +#include +#include + +#include + +void yaz_oi_APDU(Z_APDU *apdu, Z_OtherInformation ***oip) +{ + switch (apdu->which) + { + case Z_APDU_initRequest: + *oip = &apdu->u.initRequest->otherInfo; + break; + case Z_APDU_searchRequest: + *oip = &apdu->u.searchRequest->otherInfo; + break; + case Z_APDU_presentRequest: + *oip = &apdu->u.presentRequest->otherInfo; + break; + case Z_APDU_sortRequest: + *oip = &apdu->u.sortRequest->otherInfo; + break; + case Z_APDU_scanRequest: + *oip = &apdu->u.scanRequest->otherInfo; + break; + case Z_APDU_extendedServicesRequest: + *oip = &apdu->u.extendedServicesRequest->otherInfo; + break; + case Z_APDU_deleteResultSetRequest: + *oip = &apdu->u.deleteResultSetRequest->otherInfo; + break; + case Z_APDU_initResponse: + *oip = &apdu->u.initResponse->otherInfo; + break; + case Z_APDU_searchResponse: + *oip = &apdu->u.searchResponse->otherInfo; + break; + case Z_APDU_presentResponse: + *oip = &apdu->u.presentResponse->otherInfo; + break; + case Z_APDU_sortResponse: + *oip = &apdu->u.sortResponse->otherInfo; + break; + case Z_APDU_scanResponse: + *oip = &apdu->u.scanResponse->otherInfo; + break; + case Z_APDU_extendedServicesResponse: + *oip = &apdu->u.extendedServicesResponse->otherInfo; + break; + case Z_APDU_deleteResultSetResponse: + *oip = &apdu->u.deleteResultSetResponse->otherInfo; + break; + case Z_APDU_duplicateDetectionRequest: + *oip = &apdu->u.duplicateDetectionRequest->otherInfo; + break; + case Z_APDU_duplicateDetectionResponse: + *oip = &apdu->u.duplicateDetectionResponse->otherInfo; + break; + default: + *oip = 0; + break; + } +} + +Z_OtherInformationUnit *yaz_oi_update ( + Z_OtherInformation **otherInformationP, ODR odr, + int *oid, int categoryValue, int delete_flag) +{ + int i; + Z_OtherInformation *otherInformation; + + if (!otherInformationP) + return 0; + otherInformation = *otherInformationP; + if (!otherInformation) + { + if (!odr) + return 0; + otherInformation = *otherInformationP = (Z_OtherInformation *) + odr_malloc (odr, sizeof(*otherInformation)); + otherInformation->num_elements = 0; + otherInformation->list = 0; + } + for (i = 0; inum_elements; i++) + { + if (!oid) + { + if (!otherInformation->list[i]->category) + return otherInformation->list[i]; + } + else + { + if (otherInformation->list[i]->category && + categoryValue == + *otherInformation->list[i]->category->categoryValue && + !oid_oidcmp (oid, otherInformation->list[i]->category-> + categoryTypeId)) + { + Z_OtherInformationUnit *this_list = otherInformation->list[i]; + + if (delete_flag) + { + (otherInformation->num_elements)--; + while (i < otherInformation->num_elements) + { + otherInformation->list[i] = + otherInformation->list[i+1]; + i++; + } + } + return this_list; + } + } + } + if (!odr) + return 0; + else + { + Z_OtherInformationUnit **newlist = (Z_OtherInformationUnit**) + odr_malloc(odr, (otherInformation->num_elements+1) * + sizeof(*newlist)); + for (i = 0; inum_elements; i++) + newlist[i] = otherInformation->list[i]; + otherInformation->list = newlist; + + otherInformation->list[i] = (Z_OtherInformationUnit*) + odr_malloc (odr, sizeof(Z_OtherInformationUnit)); + if (oid) + { + otherInformation->list[i]->category = (Z_InfoCategory*) + odr_malloc (odr, sizeof(Z_InfoCategory)); + otherInformation->list[i]->category->categoryTypeId = (int*) + odr_oiddup (odr, oid); + otherInformation->list[i]->category->categoryValue = (int*) + odr_malloc (odr, sizeof(int)); + *otherInformation->list[i]->category->categoryValue = + categoryValue; + } + else + otherInformation->list[i]->category = 0; + otherInformation->list[i]->which = Z_OtherInfo_characterInfo; + otherInformation->list[i]->information.characterInfo = 0; + + otherInformation->num_elements = i+1; + return otherInformation->list[i]; + } +} + +void yaz_oi_set_string_oid ( + Z_OtherInformation **otherInformation, ODR odr, + int *oid, int categoryValue, + const char *str) +{ + Z_OtherInformationUnit *oi = + yaz_oi_update(otherInformation, odr, oid, categoryValue, 0); + if (!oi) + return; + oi->which = Z_OtherInfo_characterInfo; + oi->information.characterInfo = odr_strdup (odr, str); +} + +void yaz_oi_set_string_oidval ( + Z_OtherInformation **otherInformation, ODR odr, + int oidval, int categoryValue, + const char *str) +{ + int oid[OID_SIZE]; + struct oident ent; + ent.proto = PROTO_Z3950; + ent.oclass = CLASS_USERINFO; + ent.value = (oid_value) oidval; + if (!oid_ent_to_oid (&ent, oid)) + return ; + yaz_oi_set_string_oid(otherInformation, + odr, oid, categoryValue, str); +} + +char *yaz_oi_get_string_oid ( + Z_OtherInformation **otherInformation, + int *oid, int categoryValue, int delete_flag) +{ + Z_OtherInformationUnit *oi; + + if ((oi = yaz_oi_update(otherInformation, 0, oid, 1, delete_flag)) && + oi->which == Z_OtherInfo_characterInfo) + return oi->information.characterInfo; + return 0; +} + +char *yaz_oi_get_string_oidval(Z_OtherInformation **otherInformation, + int oidval, int categoryValue, int delete_flag) +{ + int oid[OID_SIZE]; + struct oident ent; + ent.proto = PROTO_Z3950; + ent.oclass = CLASS_USERINFO; + ent.value = (oid_value) oidval; + + if (!oid_ent_to_oid (&ent, oid)) + return 0; + return yaz_oi_get_string_oid (otherInformation, oid, categoryValue, + delete_flag); +} + diff --git a/src/pquery.c b/src/pquery.c new file mode 100644 index 0000000..bcaa487 --- /dev/null +++ b/src/pquery.c @@ -0,0 +1,817 @@ +/* + * Copyright (c) 1995-2003, Index Data. + * See the file LICENSE for details. + * + * $Id: pquery.c,v 1.1 2003-10-27 12:21:35 adam Exp $ + */ + +#include +#include +#include +#include + +#include +#include +#include + +static oid_value p_query_dfset = VAL_NONE; + +struct yaz_pqf_parser { + const char *query_buf; + const char *query_ptr; + const char *lex_buf; + size_t lex_len; + int query_look; + char *left_sep; + char *right_sep; + int escape_char; + int term_type; + int external_type; + int error; +}; + +static Z_RPNStructure *rpn_structure (struct yaz_pqf_parser *li, ODR o, + oid_proto, + int num_attr, int max_attr, + int *attr_list, char **attr_clist, + oid_value *attr_set); + +static enum oid_value query_oid_getvalbyname (struct yaz_pqf_parser *li) +{ + enum oid_value value; + char buf[32]; + + if (li->lex_len > 31) + return VAL_NONE; + memcpy (buf, li->lex_buf, li->lex_len); + buf[li->lex_len] = '\0'; + value = oid_getvalbyname (buf); + return value; +} + +static int compare_term (struct yaz_pqf_parser *li, const char *src, + size_t off) +{ + size_t len=strlen(src); + + if (li->lex_len == len+off && !memcmp (li->lex_buf+off, src, len-off)) + return 1; + return 0; +} + +static int query_token (struct yaz_pqf_parser *li) +{ + int sep_char = ' '; + const char *sep_match; + const char **qptr = &li->query_ptr; + + while (**qptr == ' ') + (*qptr)++; + if (**qptr == '\0') + return 0; + li->lex_len = 0; + if ((sep_match = strchr (li->left_sep, **qptr))) + { + sep_char = li->right_sep[sep_match - li->left_sep]; + ++(*qptr); + } + li->lex_buf = *qptr; + + if (**qptr == li->escape_char && isdigit ((*qptr)[1])) + { + ++(li->lex_len); + ++(*qptr); + return 'l'; + } + while (**qptr && **qptr != sep_char) + { + if (**qptr == '\\') + { + ++(li->lex_len); + ++(*qptr); + } + ++(li->lex_len); + ++(*qptr); + } + if (**qptr) + ++(*qptr); + if (sep_char == ' ' && + li->lex_len >= 1 && li->lex_buf[0] == li->escape_char) + { + if (compare_term (li, "and", 1)) + return 'a'; + if (compare_term (li, "or", 1)) + return 'o'; + if (compare_term (li, "not", 1)) + return 'n'; + if (compare_term (li, "attr", 1)) + return 'l'; + if (compare_term (li, "set", 1)) + return 's'; + if (compare_term (li, "attrset", 1)) + return 'r'; + if (compare_term (li, "prox", 1)) + return 'p'; + if (compare_term (li, "term", 1)) + return 'y'; + } + return 't'; +} + +static int lex (struct yaz_pqf_parser *li) +{ + return li->query_look = query_token (li); +} + +static int escape_string(char *out_buf, const char *in, int len) +{ + + char *out = out_buf; + while (--len >= 0) + if (*in == '\\' && len > 0) + { + --len; + switch (*++in) + { + case 't': + *out++ = '\t'; + break; + case 'n': + *out++ = '\n'; + break; + case 'r': + *out++ = '\r'; + break; + case 'f': + *out++ = '\f'; + break; + case 'x': + if (len > 1) + { + char s[4]; + int n = 0; + s[0] = *++in; + s[1] = *++in; + s[2] = '\0'; + len = len - 2; + sscanf (s, "%x", &n); + *out++ = n; + } + break; + case '0': + case '1': + case '2': + case '3': + if (len > 1) + { + char s[4]; + int n = 0; + s[0] = *in; + s[1] = *++in; + s[2] = *++in; + s[3] = '\0'; + len = len - 2; + sscanf (s, "%o", &n); + *out++ = n; + } + break; + default: + *out++ = *in; + break; + } + in++; + } + else + *out++ = *in++; + return out - out_buf; +} + +static int p_query_parse_attr(struct yaz_pqf_parser *li, ODR o, + int num_attr, int *attr_list, + char **attr_clist, oid_value *attr_set) +{ + const char *cp; + if (!(cp = strchr (li->lex_buf, '=')) || + (size_t) (cp-li->lex_buf) > li->lex_len) + { + attr_set[num_attr] = query_oid_getvalbyname (li); + if (attr_set[num_attr] == VAL_NONE) + { + li->error = YAZ_PQF_ERROR_ATTSET; + return 0; + } + if (!lex (li)) + { + li->error = YAZ_PQF_ERROR_MISSING; + return 0; + } + if (!(cp = strchr (li->lex_buf, '='))) + { + li->error = YAZ_PQF_ERROR_BADATTR; + return 0; + } + } + else + { + if (num_attr > 0) + attr_set[num_attr] = attr_set[num_attr-1]; + else + attr_set[num_attr] = VAL_NONE; + } + attr_list[2*num_attr] = atoi(li->lex_buf); + cp++; + if (*cp >= '0' && *cp <= '9') + { + attr_list[2*num_attr+1] = atoi (cp); + attr_clist[num_attr] = 0; + } + else + { + int len = li->lex_len - (cp - li->lex_buf); + attr_list[2*num_attr+1] = 0; + attr_clist[num_attr] = (char *) odr_malloc (o, len+1); + len = escape_string(attr_clist[num_attr], cp, len); + attr_clist[num_attr][len] = '\0'; + } + return 1; +} + +static Z_AttributesPlusTerm *rpn_term (struct yaz_pqf_parser *li, ODR o, + oid_proto proto, + int num_attr, int *attr_list, + char **attr_clist, oid_value *attr_set) +{ + Z_AttributesPlusTerm *zapt; + Odr_oct *term_octet; + Z_Term *term; + Z_AttributeElement **elements; + + zapt = (Z_AttributesPlusTerm *)odr_malloc (o, sizeof(*zapt)); + term_octet = (Odr_oct *)odr_malloc (o, sizeof(*term_octet)); + term = (Z_Term *)odr_malloc (o, sizeof(*term)); + + if (!num_attr) + elements = (Z_AttributeElement**)odr_nullval(); + else + { + int i, k = 0; + int *attr_tmp; + + elements = (Z_AttributeElement**) + odr_malloc (o, num_attr * sizeof(*elements)); + + attr_tmp = (int *)odr_malloc (o, num_attr * 2 * sizeof(int)); + memcpy (attr_tmp, attr_list, num_attr * 2 * sizeof(int)); + for (i = num_attr; --i >= 0; ) + { + int j; + for (j = i+1; jattributeType = &attr_tmp[2*i]; + elements[k]->attributeSet = + yaz_oidval_to_z3950oid(o, CLASS_ATTSET, attr_set[i]); + + if (attr_clist[i]) + { + elements[k]->which = Z_AttributeValue_complex; + elements[k]->value.complex = (Z_ComplexAttribute *) + odr_malloc (o, sizeof(Z_ComplexAttribute)); + elements[k]->value.complex->num_list = 1; + elements[k]->value.complex->list = + (Z_StringOrNumeric **) + odr_malloc (o, 1 * sizeof(Z_StringOrNumeric *)); + elements[k]->value.complex->list[0] = + (Z_StringOrNumeric *) + odr_malloc (o, sizeof(Z_StringOrNumeric)); + elements[k]->value.complex->list[0]->which = + Z_StringOrNumeric_string; + elements[k]->value.complex->list[0]->u.string = + attr_clist[i]; + elements[k]->value.complex->semanticAction = (int **) + odr_nullval(); + elements[k]->value.complex->num_semanticAction = 0; + } + else + { + elements[k]->which = Z_AttributeValue_numeric; + elements[k]->value.numeric = &attr_tmp[2*i+1]; + } + k++; + } + num_attr = k; + } + zapt->attributes = (Z_AttributeList *) + odr_malloc (o, sizeof(*zapt->attributes)); + zapt->attributes->num_attributes = num_attr; + zapt->attributes->attributes = elements; + + zapt->term = term; + + term_octet->buf = (unsigned char *)odr_malloc (o, 1 + li->lex_len); + term_octet->size = term_octet->len = + escape_string ((char *) (term_octet->buf), li->lex_buf, li->lex_len); + term_octet->buf[term_octet->size] = 0; /* null terminate */ + + switch (li->term_type) + { + case Z_Term_general: + term->which = Z_Term_general; + term->u.general = term_octet; + break; + case Z_Term_characterString: + term->which = Z_Term_characterString; + term->u.characterString = (char*) term_octet->buf; + /* null terminated above */ + break; + case Z_Term_numeric: + term->which = Z_Term_numeric; + term->u.numeric = odr_intdup (o, atoi((char*) (term_octet->buf))); + break; + case Z_Term_null: + term->which = Z_Term_null; + term->u.null = odr_nullval(); + break; + case Z_Term_external: + term->which = Z_Term_external; + term->u.external = 0; + break; + default: + term->which = Z_Term_null; + term->u.null = odr_nullval(); + break; + } + return zapt; +} + +static Z_Operand *rpn_simple (struct yaz_pqf_parser *li, ODR o, oid_proto proto, + int num_attr, int *attr_list, char **attr_clist, + oid_value *attr_set) +{ + Z_Operand *zo; + + zo = (Z_Operand *)odr_malloc (o, sizeof(*zo)); + switch (li->query_look) + { + case 't': + zo->which = Z_Operand_APT; + if (!(zo->u.attributesPlusTerm = + rpn_term (li, o, proto, num_attr, attr_list, attr_clist, + attr_set))) + return 0; + lex (li); + break; + case 's': + lex (li); + if (!li->query_look) + { + li->error = YAZ_PQF_ERROR_MISSING; + return 0; + } + zo->which = Z_Operand_resultSetId; + zo->u.resultSetId = (char *)odr_malloc (o, li->lex_len+1); + memcpy (zo->u.resultSetId, li->lex_buf, li->lex_len); + zo->u.resultSetId[li->lex_len] = '\0'; + lex (li); + break; + default: + /* we're only called if one of the above types are seens so + this shouldn't happen */ + li->error = YAZ_PQF_ERROR_INTERNAL; + return 0; + } + return zo; +} + +static Z_ProximityOperator *rpn_proximity (struct yaz_pqf_parser *li, ODR o) +{ + Z_ProximityOperator *p = (Z_ProximityOperator *)odr_malloc (o, sizeof(*p)); + + if (!lex (li)) + { + li->error = YAZ_PQF_ERROR_MISSING; + return NULL; + } + if (*li->lex_buf == '1') + { + p->exclusion = (int *)odr_malloc (o, sizeof(*p->exclusion)); + *p->exclusion = 1; + } + else if (*li->lex_buf == '0') + { + p->exclusion = (int *)odr_malloc (o, sizeof(*p->exclusion)); + *p->exclusion = 0; + } + else + p->exclusion = NULL; + + if (!lex (li)) + { + li->error = YAZ_PQF_ERROR_MISSING; + return NULL; + } + p->distance = (int *)odr_malloc (o, sizeof(*p->distance)); + *p->distance = atoi (li->lex_buf); + + if (!lex (li)) + { + li->error = YAZ_PQF_ERROR_MISSING; + return NULL; + } + p->ordered = (int *)odr_malloc (o, sizeof(*p->ordered)); + *p->ordered = atoi (li->lex_buf); + + if (!lex (li)) + { + li->error = YAZ_PQF_ERROR_MISSING; + return NULL; + } + p->relationType = (int *)odr_malloc (o, sizeof(*p->relationType)); + *p->relationType = atoi (li->lex_buf); + + if (!lex (li)) + { + li->error = YAZ_PQF_ERROR_MISSING; + return NULL; + } + if (*li->lex_buf == 'k') + p->which = 0; + else if (*li->lex_buf == 'p') + p->which = 1; + else + p->which = atoi (li->lex_buf); + + if (!lex (li)) + { + li->error = YAZ_PQF_ERROR_MISSING; + return NULL; + } + p->which = Z_ProximityOperator_known; + p->u.known = (int *)odr_malloc (o, sizeof(*p->u.known)); + *p->u.known = atoi (li->lex_buf); + return p; +} + +static Z_Complex *rpn_complex (struct yaz_pqf_parser *li, ODR o, oid_proto proto, + int num_attr, int max_attr, + int *attr_list, char **attr_clist, + oid_value *attr_set) +{ + Z_Complex *zc; + Z_Operator *zo; + + zc = (Z_Complex *)odr_malloc (o, sizeof(*zc)); + zo = (Z_Operator *)odr_malloc (o, sizeof(*zo)); + zc->roperator = zo; + switch (li->query_look) + { + case 'a': + zo->which = Z_Operator_and; + zo->u.and_not = odr_nullval(); + break; + case 'o': + zo->which = Z_Operator_or; + zo->u.and_not = odr_nullval(); + break; + case 'n': + zo->which = Z_Operator_and_not; + zo->u.and_not = odr_nullval(); + break; + case 'p': + zo->which = Z_Operator_prox; + zo->u.prox = rpn_proximity (li, o); + if (!zo->u.prox) + return NULL; + break; + default: + /* we're only called if one of the above types are seens so + this shouldn't happen */ + li->error = YAZ_PQF_ERROR_INTERNAL; + return NULL; + } + lex (li); + if (!(zc->s1 = + rpn_structure (li, o, proto, num_attr, max_attr, attr_list, + attr_clist, attr_set))) + return NULL; + if (!(zc->s2 = + rpn_structure (li, o, proto, num_attr, max_attr, attr_list, + attr_clist, attr_set))) + return NULL; + return zc; +} + +static void rpn_term_type (struct yaz_pqf_parser *li, ODR o) +{ + if (!li->query_look) + return ; + if (compare_term (li, "general", 0)) + li->term_type = Z_Term_general; + else if (compare_term (li, "numeric", 0)) + li->term_type = Z_Term_numeric; + else if (compare_term (li, "string", 0)) + li->term_type = Z_Term_characterString; + else if (compare_term (li, "oid", 0)) + li->term_type = Z_Term_oid; + else if (compare_term (li, "datetime", 0)) + li->term_type = Z_Term_dateTime; + else if (compare_term (li, "null", 0)) + li->term_type = Z_Term_null; + else if (compare_term(li, "range", 0)) + { + /* prepare for external: range search .. */ + li->term_type = Z_Term_external; + li->external_type = VAL_MULTISRCH2; + } + lex (li); +} + +static Z_RPNStructure *rpn_structure (struct yaz_pqf_parser *li, ODR o, + oid_proto proto, + int num_attr, int max_attr, + int *attr_list, + char **attr_clist, + oid_value *attr_set) +{ + Z_RPNStructure *sz; + + sz = (Z_RPNStructure *)odr_malloc (o, sizeof(*sz)); + switch (li->query_look) + { + case 'a': + case 'o': + case 'n': + case 'p': + sz->which = Z_RPNStructure_complex; + if (!(sz->u.complex = + rpn_complex (li, o, proto, num_attr, max_attr, attr_list, + attr_clist, attr_set))) + return NULL; + break; + case 't': + case 's': + sz->which = Z_RPNStructure_simple; + if (!(sz->u.simple = + rpn_simple (li, o, proto, num_attr, attr_list, + attr_clist, attr_set))) + return NULL; + break; + case 'l': + lex (li); + if (!li->query_look) + { + li->error = YAZ_PQF_ERROR_MISSING; + return 0; + } + if (num_attr >= max_attr) + { + li->error = YAZ_PQF_ERROR_TOOMANY; + return 0; + } + if (!p_query_parse_attr(li, o, num_attr, attr_list, + attr_clist, attr_set)) + return 0; + num_attr++; + lex (li); + return + rpn_structure (li, o, proto, num_attr, max_attr, attr_list, + attr_clist, attr_set); + case 'y': + lex (li); + rpn_term_type (li, o); + return + rpn_structure (li, o, proto, num_attr, max_attr, attr_list, + attr_clist, attr_set); + case 0: /* operator/operand expected! */ + li->error = YAZ_PQF_ERROR_MISSING; + return 0; + } + return sz; +} + +Z_RPNQuery *p_query_rpn_mk (ODR o, struct yaz_pqf_parser *li, oid_proto proto, + const char *qbuf) +{ + Z_RPNQuery *zq; + int attr_array[1024]; + char *attr_clist[512]; + oid_value attr_set[512]; + oid_value topSet = VAL_NONE; + + zq = (Z_RPNQuery *)odr_malloc (o, sizeof(*zq)); + lex (li); + if (li->query_look == 'r') + { + lex (li); + topSet = query_oid_getvalbyname (li); + if (topSet == VAL_NONE) + { + li->error = YAZ_PQF_ERROR_ATTSET; + return NULL; + } + + lex (li); + } + if (topSet == VAL_NONE) + topSet = p_query_dfset; + if (topSet == VAL_NONE) + topSet = VAL_BIB1; + + zq->attributeSetId = yaz_oidval_to_z3950oid(o, CLASS_ATTSET, topSet); + + if (!zq->attributeSetId) + { + li->error = YAZ_PQF_ERROR_ATTSET; + return 0; + } + + if (!(zq->RPNStructure = rpn_structure (li, o, proto, 0, 512, + attr_array, attr_clist, attr_set))) + return 0; + if (li->query_look) + { + li->error = YAZ_PQF_ERROR_EXTRA; + return 0; + } + return zq; +} + +Z_RPNQuery *p_query_rpn (ODR o, oid_proto proto, + const char *qbuf) +{ + struct yaz_pqf_parser li; + + li.error = 0; + li.left_sep = "{\""; + li.right_sep = "}\""; + li.escape_char = '@'; + li.term_type = Z_Term_general; + li.query_buf = li.query_ptr = qbuf; + li.lex_buf = 0; + return p_query_rpn_mk (o, &li, proto, qbuf); +} + + +Z_AttributesPlusTerm *p_query_scan_mk (struct yaz_pqf_parser *li, + ODR o, oid_proto proto, + Odr_oid **attributeSetP, + const char *qbuf) +{ + int attr_list[1024]; + char *attr_clist[512]; + oid_value attr_set[512]; + int num_attr = 0; + int max_attr = 512; + oid_value topSet = VAL_NONE; + Z_AttributesPlusTerm *apt; + + lex (li); + if (li->query_look == 'r') + { + lex (li); + topSet = query_oid_getvalbyname (li); + + lex (li); + } + if (topSet == VAL_NONE) + topSet = p_query_dfset; + if (topSet == VAL_NONE) + topSet = VAL_BIB1; + + *attributeSetP = yaz_oidval_to_z3950oid (o, CLASS_ATTSET, topSet); + + while (1) + { + if (li->query_look == 'l') + { + lex (li); + if (!li->query_look) + { + li->error = YAZ_PQF_ERROR_MISSING; + return 0; + } + if (num_attr >= max_attr) + { + li->error = YAZ_PQF_ERROR_TOOMANY; + return 0; + } + if (!p_query_parse_attr(li, o, num_attr, attr_list, + attr_clist, attr_set)) + return 0; + num_attr++; + lex (li); + } + else if (li->query_look == 'y') + { + lex (li); + rpn_term_type (li, o); + } + else + break; + } + if (!li->query_look) + { + li->error = YAZ_PQF_ERROR_MISSING; + return 0; + } + apt = rpn_term (li, o, proto, num_attr, attr_list, attr_clist, attr_set); + + lex (li); + + if (li->query_look != 0) + { + li->error = YAZ_PQF_ERROR_EXTRA; + return 0; + } + return apt; +} + +Z_AttributesPlusTerm *p_query_scan (ODR o, oid_proto proto, + Odr_oid **attributeSetP, + const char *qbuf) +{ + struct yaz_pqf_parser li; + + li.error = 0; + li.left_sep = "{\""; + li.right_sep = "}\""; + li.escape_char = '@'; + li.term_type = Z_Term_general; + li.query_buf = li.query_ptr = qbuf; + li.lex_buf = 0; + + return p_query_scan_mk (&li, o, proto, attributeSetP, qbuf); +} + +int p_query_attset (const char *arg) +{ + p_query_dfset = oid_getvalbyname (arg); + return (p_query_dfset == VAL_NONE) ? -1 : 0; +} + +YAZ_PQF_Parser yaz_pqf_create (void) +{ + YAZ_PQF_Parser p = (YAZ_PQF_Parser) xmalloc (sizeof(*p)); + + p->error = 0; + p->left_sep = "{\""; + p->right_sep = "}\""; + p->escape_char = '@'; + p->term_type = Z_Term_general; + + return p; +} + +void yaz_pqf_destroy (YAZ_PQF_Parser p) +{ + xfree (p); +} + +Z_RPNQuery *yaz_pqf_parse (YAZ_PQF_Parser p, ODR o, const char *qbuf) +{ + if (!p) + return 0; + p->query_buf = p->query_ptr = qbuf; + p->lex_buf = 0; + return p_query_rpn_mk (o, p, PROTO_Z3950, qbuf); +} + +Z_AttributesPlusTerm *yaz_pqf_scan (YAZ_PQF_Parser p, ODR o, + Odr_oid **attributeSetP, + const char *qbuf) +{ + if (!p) + return 0; + p->query_buf = p->query_ptr = qbuf; + p->lex_buf = 0; + return p_query_scan_mk (p, o, PROTO_Z3950, attributeSetP, qbuf); +} + +int yaz_pqf_error (YAZ_PQF_Parser p, const char **msg, size_t *off) +{ + switch (p->error) + { + case YAZ_PQF_ERROR_NONE: + *msg = "no error"; break; + case YAZ_PQF_ERROR_EXTRA: + *msg = "extra token"; break; + case YAZ_PQF_ERROR_MISSING: + *msg = "missing token"; break; + case YAZ_PQF_ERROR_ATTSET: + *msg = "unknown attribute set"; break; + case YAZ_PQF_ERROR_TOOMANY: + *msg = "too many attributes"; break; + case YAZ_PQF_ERROR_BADATTR: + *msg = "bad attribute specification"; break; + case YAZ_PQF_ERROR_INTERNAL: + *msg = "internal error"; break; + default: + *msg = "unknown error"; break; + } + *off = p->query_ptr - p->query_buf; + return p->error; +} diff --git a/src/prt-ext.c b/src/prt-ext.c new file mode 100644 index 0000000..e3b0c5b --- /dev/null +++ b/src/prt-ext.c @@ -0,0 +1,232 @@ +/* + * Copyright (c) 1995-2003, Index Data. + * See the file LICENSE for details. + * + * $Id: prt-ext.c,v 1.1 2003-10-27 12:21:35 adam Exp $ + */ + +#include + +/* + * The table below should be moved to the ODR structure itself and + * be an image of the association context: To help + * map indirect references when they show up. + */ +static Z_ext_typeent type_table[] = +{ + {VAL_SUTRS, Z_External_sutrs, (Odr_fun) z_SUTRS}, + {VAL_EXPLAIN, Z_External_explainRecord, (Odr_fun)z_ExplainRecord}, + {VAL_RESOURCE1, Z_External_resourceReport1, (Odr_fun)z_ResourceReport1}, + {VAL_RESOURCE2, Z_External_resourceReport2, (Odr_fun)z_ResourceReport2}, + {VAL_PROMPT1, Z_External_promptObject1, (Odr_fun)z_PromptObject1 }, + {VAL_GRS1, Z_External_grs1, (Odr_fun)z_GenericRecord}, + {VAL_EXTENDED, Z_External_extendedService, (Odr_fun)z_TaskPackage}, + {VAL_ITEMORDER, Z_External_itemOrder, (Odr_fun)z_IOItemOrder}, + {VAL_DIAG1, Z_External_diag1, (Odr_fun)z_DiagnosticFormat}, + {VAL_ESPEC1, Z_External_espec1, (Odr_fun)z_Espec1}, + {VAL_SUMMARY, Z_External_summary, (Odr_fun)z_BriefBib}, + {VAL_OPAC, Z_External_OPAC, (Odr_fun)z_OPACRecord}, + {VAL_SEARCHRES1, Z_External_searchResult1, (Odr_fun)z_SearchInfoReport}, + {VAL_DBUPDATE, Z_External_update, (Odr_fun)z_IUUpdate}, + {VAL_DBUPDATE0, Z_External_update0, (Odr_fun)z_IU0Update}, + {VAL_DBUPDATE1, Z_External_update0, (Odr_fun)z_IU0Update}, + {VAL_DATETIME, Z_External_dateTime, (Odr_fun)z_DateTime}, + {VAL_UNIVERSE_REPORT, Z_External_universeReport,(Odr_fun)z_UniverseReport}, + {VAL_ADMINSERVICE, Z_External_ESAdmin, (Odr_fun)z_Admin}, + {VAL_USERINFO1, Z_External_userInfo1, (Odr_fun) z_OtherInformation}, + {VAL_CHARNEG3, Z_External_charSetandLanguageNegotiation, (Odr_fun) + z_CharSetandLanguageNegotiation}, + {VAL_PROMPT1, Z_External_acfPrompt1, (Odr_fun) z_PromptObject1}, + {VAL_DES1, Z_External_acfDes1, (Odr_fun) z_DES_RN_Object}, + {VAL_KRB1, Z_External_acfKrb1, (Odr_fun) z_KRBObject}, + {VAL_MULTISRCH2, Z_External_multisrch2, (Odr_fun) z_MultipleSearchTerms_2}, + {VAL_CQL, Z_External_CQL, (Odr_fun) z_InternationalString}, + {VAL_OCLCUI, Z_External_OCLCUserInfo, (Odr_fun) z_OCLC_UserInformation}, + {VAL_NONE, 0, 0} +}; + +Z_ext_typeent *z_ext_getentbyref(oid_value val) +{ + Z_ext_typeent *i; + + for (i = type_table; i->dref != VAL_NONE; i++) + if (i->dref == val) + return i; + return 0; +} + +int z_External(ODR o, Z_External **p, int opt, const char *name) +{ + oident *oid; + Z_ext_typeent *type; + + static Odr_arm arm[] = + { + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_single, + (Odr_fun)odr_any, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_External_octet, + (Odr_fun)odr_octetstring, 0}, + {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_External_arbitrary, + (Odr_fun)odr_bitstring, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_sutrs, + (Odr_fun)z_SUTRS, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_explainRecord, + (Odr_fun)z_ExplainRecord, 0}, + + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_resourceReport1, + (Odr_fun)z_ResourceReport1, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_resourceReport2, + (Odr_fun)z_ResourceReport2, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_promptObject1, + (Odr_fun)z_PromptObject1, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_grs1, + (Odr_fun)z_GenericRecord, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_extendedService, + (Odr_fun)z_TaskPackage, 0}, + + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_itemOrder, + (Odr_fun)z_IOItemOrder, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_diag1, + (Odr_fun)z_DiagnosticFormat, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_espec1, + (Odr_fun)z_Espec1, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_summary, + (Odr_fun)z_BriefBib, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_OPAC, + (Odr_fun)z_OPACRecord, 0}, + + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_searchResult1, + (Odr_fun)z_SearchInfoReport, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_update, + (Odr_fun)z_IUUpdate, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_dateTime, + (Odr_fun)z_DateTime, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_universeReport, + (Odr_fun)z_UniverseReport, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_ESAdmin, + (Odr_fun)z_Admin, 0}, + + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_update0, + (Odr_fun)z_IU0Update, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_userInfo1, + (Odr_fun)z_OtherInformation, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_charSetandLanguageNegotiation, + (Odr_fun)z_CharSetandLanguageNegotiation, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_acfPrompt1, + (Odr_fun)z_PromptObject1, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_acfDes1, + (Odr_fun)z_DES_RN_Object, 0}, + + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_acfKrb1, + (Odr_fun)z_KRBObject, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_multisrch2, + (Odr_fun)z_MultipleSearchTerms_2, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_CQL, + (Odr_fun)z_InternationalString, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_OCLCUserInfo, + (Odr_fun)z_OCLC_UserInformation, 0}, + {-1, -1, -1, -1, 0, 0} + }; + + odr_implicit_settag(o, ODR_UNIVERSAL, ODR_EXTERNAL); + if (!odr_sequence_begin(o, p, sizeof(**p), name)) + return opt && odr_ok(o); + if (!(odr_oid(o, &(*p)->direct_reference, 1, 0) && + odr_integer(o, &(*p)->indirect_reference, 1, 0) && + odr_graphicstring(o, &(*p)->descriptor, 1, 0))) + return 0; + /* + * Do we know this beast? + */ + if (o->direction == ODR_DECODE && (*p)->direct_reference && + (oid = oid_getentbyoid((*p)->direct_reference)) && + (type = z_ext_getentbyref(oid->value))) + { + int zclass, tag, cons; + + /* + * We know it. If it's represented as an ASN.1 type, bias the CHOICE. + */ + if (!odr_peektag(o, &zclass, &tag, &cons)) + return opt && odr_ok(o); + if (zclass == ODR_CONTEXT && tag == 0 && cons == 1) + odr_choice_bias(o, type->what); + } + return + odr_choice(o, arm, &(*p)->u, &(*p)->which, name) && + odr_sequence_end(o); +} + +Z_External *z_ext_record(ODR o, int format, const char *buf, int len) +{ + Z_External *thisext; + + thisext = (Z_External *) odr_malloc(o, sizeof(*thisext)); + thisext->descriptor = 0; + thisext->indirect_reference = 0; + + thisext->direct_reference = + yaz_oidval_to_z3950oid (o, CLASS_RECSYN, format); + if (!thisext->direct_reference) + return 0; + + if (len < 0) /* Structured data */ + { + + /* + * We cheat on the pointers here. Obviously, the record field + * of the backend-fetch structure should have been a union for + * correctness, but we're stuck with this for backwards + * compatibility. + */ + thisext->u.grs1 = (Z_GenericRecord*) buf; + + switch (format) + { + case VAL_SUTRS: + thisext->which = Z_External_sutrs; + break; + case VAL_GRS1: + thisext->which = Z_External_grs1; + break; + case VAL_EXPLAIN: + thisext->which = Z_External_explainRecord; + break; + case VAL_SUMMARY: + thisext->which = Z_External_summary; + break; + case VAL_OPAC: + thisext->which = Z_External_OPAC; + break; + case VAL_EXTENDED: + thisext->which = Z_External_extendedService; + break; + default: + return 0; + } + } + else if (format == VAL_SUTRS) /* SUTRS is a single-ASN.1-type */ + { + Odr_oct *sutrs = (Odr_oct *)odr_malloc(o, sizeof(*sutrs)); + + thisext->which = Z_External_sutrs; + thisext->u.sutrs = sutrs; + sutrs->buf = (unsigned char *)odr_malloc(o, len); + sutrs->len = sutrs->size = len; + memcpy(sutrs->buf, buf, len); + } + else + { + thisext->which = Z_External_octet; + if (!(thisext->u.octet_aligned = (Odr_oct *) + odr_malloc(o, sizeof(Odr_oct)))) + return 0; + if (!(thisext->u.octet_aligned->buf = (unsigned char *) + odr_malloc(o, len))) + return 0; + memcpy(thisext->u.octet_aligned->buf, buf, len); + thisext->u.octet_aligned->len = thisext->u.octet_aligned->size = len; + } + return thisext; +} + diff --git a/src/query.c b/src/query.c new file mode 100644 index 0000000..ec0bdcb --- /dev/null +++ b/src/query.c @@ -0,0 +1,116 @@ +/* + * Copyright (c) 1995-2001, Index Data + * See the file LICENSE for details. + * + * $Id: query.c,v 1.1 2003-10-27 12:21:35 adam Exp $ + */ + +#include +#include +#include + +#include +#include + +static Z_Complex *makecomplex(ODR o, char **buf); +static Z_Operand *makesimple(ODR o, char **buf); +Z_RPNStructure *makerpn(ODR o, char **buf); + +void skip_spaces(char**p) +{ + while (**p && isspace(**p)) + (*p)++; +} + +static Z_Operand *makesimple(ODR o, char **buf) +{ + Z_Operand *r; + Z_AttributesPlusTerm *t; + char *b; + + r = odr_malloc(o, sizeof(*r)); + if (**buf == 's' && *((*buf) + 1) == '=') + { + char *b = odr_malloc(o, 100); + + r->which = Z_Operand_resultSetId; + r->u.resultSetId = b; + (*buf)++; + (*buf)++; + while (**buf && !isspace(**buf)) + *(b++) = *((*buf)++); + *b = 0; + return r; + } + else if (**buf != '"') + return 0; + (*buf)++; + r->which = Z_Operand_APT; + r->u.attributesPlusTerm = t = odr_malloc(o, sizeof(*t)); + t->attributes = odr_malloc(o, sizeof(*t)); + t->attributes->num_attributes = 0; + t->attributes->attributes = 0; + t->term = odr_malloc(o, sizeof(*t->term)); + t->term->which = Z_Term_general; + t->term->u.general = odr_malloc(o, sizeof(Odr_oct)); + t->term->u.general->buf = odr_malloc(o, 100); + t->term->u.general->size = 100; + t->term->u.general->len = 0; + b = (char*) t->term->u.general->buf; + while (**buf && **buf != '"') + { + *(b++) = *((*buf)++); + t->term->u.general->len++; + } + if (**buf != '"') + return 0; + (*buf)++; + return r; +} + +static Z_Complex *makecomplex(ODR o, char **buf) +{ + Z_Complex *r; + char op[100], *b; + + r = odr_malloc(o, sizeof(*r)); + r->roperator = odr_malloc(o, sizeof(*r->roperator)); + + b = op; + while (**buf && !isspace(**buf)) + *(b++) = *((*buf)++); + *b = 0; + if (!strcmp(op, "and")) + r->roperator->which = Z_Operator_and; + else if (!strcmp(op, "or")) + r->roperator->which = Z_Operator_or; + else if (!strcmp(op, "not")) + r->roperator->which = Z_Operator_and_not; + r->roperator->u.and = ""; + while (**buf && !isspace(**buf)) + (*buf)++; + if (!(r->s1 = makerpn(o, buf))) + return 0; + if (!(r->s2 = makerpn(o, buf))) + return 0; + return r; +} + +Z_RPNStructure *makerpn(ODR o, char **buf) +{ + Z_RPNStructure *r; + + r = odr_malloc(o, sizeof(*r)); + skip_spaces(buf); + if (**buf == '"' || **buf == 's') + { + r->which = Z_RPNStructure_simple; + if (!(r->u.simple = makesimple(o, buf))) + return 0; + return r; + } + r->which = Z_RPNStructure_complex; + if (!(r->u.complex = makecomplex(o, buf))) + return 0; + return r; +} diff --git a/src/readconf.c b/src/readconf.c new file mode 100644 index 0000000..3b36874 --- /dev/null +++ b/src/readconf.c @@ -0,0 +1,132 @@ +/* + * Copyright (C) 1994-2000, Index Data + * All rights reserved. + * Sebastian Hammer, Adam Dickmeiss + * + * $Log: readconf.c,v $ + * Revision 1.1 2003-10-27 12:21:35 adam + * Source restructure. yaz-marcdump part of installation + * + * Revision 1.10 2000/02/29 13:44:55 adam + * Check for config.h (currently not generated). + * + * Revision 1.9 1999/11/30 13:47:12 adam + * Improved installation. Moved header files to include/yaz. + * + * Revision 1.8 1999/08/27 09:40:32 adam + * Renamed logf function to yaz_log. Removed VC++ project files. + * + * Revision 1.7 1999/06/30 09:10:32 adam + * Fixed reading of MS-DOS files. + * + * Revision 1.6 1998/10/13 16:09:55 adam + * Added support for arbitrary OID's for tagsets, schemas and attribute sets. + * Added support for multiple attribute set references and tagset references + * from an abstract syntax file. + * Fixed many bad logs-calls in routines that read the various + * specifications regarding data1 (*.abs,*.att,...) and made the messages + * consistent whenever possible. + * Added extra 'lineno' argument to function readconf_line. + * + * Revision 1.5 1997/09/04 07:53:02 adam + * Added include readconf.h. + * + * Revision 1.4 1997/05/14 06:54:07 adam + * C++ support. + * + * Revision 1.3 1996/05/29 15:48:48 quinn + * Added \n to the isspace rule. + * + * Revision 1.2 1996/05/29 10:05:01 quinn + * Changed space criteria to support 8-bit characters + * + * Revision 1.1 1995/11/01 13:55:06 quinn + * Minor adjustments + * + * Revision 1.2 1995/10/30 13:54:27 quinn + * iRemoved fclose(). + * + * Revision 1.1 1995/10/10 16:28:18 quinn + * Initial revision + * + * + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include +#include + +#define l_isspace(c) ((c) == '\t' || (c) == ' ' || (c) == '\n' || (c) == '\r') + +int readconf_line(FILE *f, int *lineno, char *line, int len, + char *argv[], int num) +{ + char *p; + int argc; + + while ((p = fgets(line, len, f))) + { + (*lineno)++; + while (*p && l_isspace(*p)) + p++; + if (*p && *p != '#') + break; + } + if (!p) + return 0; + + for (argc = 0; *p ; argc++) + { + if (*p == '#') /* trailing comment */ + break; + argv[argc] = p; + while (*p && !l_isspace(*p)) + p++; + if (*p) + { + *(p++) = '\0'; + while (*p && l_isspace(*p)) + p++; + } + } + return argc; +} + +/* + * Read lines of a configuration file. + */ +int readconf(char *name, void *rprivate, + int (*fun)(char *name, void *rprivate, int argc, char *argv[])) +{ + FILE *f; + char line[512], *m_argv[50]; + int m_argc; + int lineno = 0; + + if (!(f = fopen(name, "r"))) + { + yaz_log(LOG_WARN|LOG_ERRNO, "readconf: %s", name); + return -1; + } + for (;;) + { + int res; + + if (!(m_argc = readconf_line(f, &lineno, line, 512, m_argv, 50))) + { + fclose(f); + return 0; + } + + if ((res = (*fun)(name, rprivate, m_argc, m_argv))) + { + fclose(f); + return res; + } + } +} diff --git a/src/requestq.c b/src/requestq.c new file mode 100644 index 0000000..bf9f7e2 --- /dev/null +++ b/src/requestq.c @@ -0,0 +1,100 @@ +/* + * Copyright (C) 1994-2003, Index Data. + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: requestq.c,v 1.1 2003-10-27 12:21:35 adam Exp $ + * + */ + +/* + * Simple queue management. + * + * We also use the request-freelist to store encoding buffers, rather than + * freeing and xmalloc'ing them on each cycle. + */ + +#include + +#include +#include "session.h" + +void request_enq(request_q *q, request *r) +{ + if (q->tail) + q->tail->next = r; + else + q->head = r; + q->tail = r; + q->num++; +} + +request *request_head(request_q *q) +{ + return q->head; +} + +request *request_deq(request_q *q) +{ + request *r = q->head; + + if (!r) + return 0; + q->head = q->head->next; + if (!q->head) + q->tail = 0; + q->num--; + return r; +} + +void request_initq(request_q *q) +{ + q->head = q->tail = q->list = 0; + q->num = 0; +} + +void request_delq(request_q *q) +{ + request *r1, *r = q->list; + while (r) + { + xfree (r->response); + r1 = r; + r = r->next; + xfree (r1); + } +} + +request *request_get(request_q *q) +{ + request *r = q->list; + + if (r) + q->list = r->next; + else + { + if (!(r = (request *)xmalloc(sizeof(*r)))) + abort(); + r->response = 0; + r->size_response = 0; + } + r->q = q; + r->len_refid = 0; + r->refid = 0; + r->gdu_request = 0; + r->apdu_request = 0; + r->request_mem = 0; + r->len_response = 0; + r->clientData = 0; + r->state = REQUEST_IDLE; + r->next = 0; + return r; +} + +void request_release(request *r) +{ + request_q *q = r->q; + r->next = q->list; + q->list = r; +} + diff --git a/src/service.c b/src/service.c new file mode 100644 index 0000000..3ed4a39 --- /dev/null +++ b/src/service.c @@ -0,0 +1,503 @@ +/* + * NT Service interface Utility. + * Based on code written by + * Chas Woodfield, Fretwell Downing Informatics. + * $Log: service.c,v $ + * Revision 1.1 2003-10-27 12:21:35 adam + * Source restructure. yaz-marcdump part of installation + * + * Revision 1.5 2001/11/13 23:00:42 adam + * Separate malloc debug library. Removal of ASN_COMPILED-#ifdefs. + * + * Revision 1.4 2000/12/05 19:05:10 adam + * Service automatically starts in the directory from which it was installed. + * + * Revision 1.3 1999/06/10 11:45:30 adam + * Added bend_start, bend_stop handlers and removed pre_init. + * Handlers bend_start/bend_stop are called when service/daemon is + * started/stopped. + * + * Revision 1.2 1999/02/02 13:57:36 adam + * Uses preprocessor define WIN32 instead of WINDOWS to build code + * for Microsoft WIN32. + * + * Revision 1.1 1997/11/07 13:31:52 adam + * Added NT Service name part of statserv_options_block. Moved NT + * service utility to server library. + * + * Revision 1.6 1997/09/18 08:49:14 adam + * Option -runnormal no needed to run server in standalone mode. + * + * Revision 1.5 1997/09/17 12:10:43 adam + * YAZ version 1.4. + * + * Revision 1.4 1997/09/09 10:10:20 adam + * Another MSV5.0 port. Changed projects to include proper + * library/include paths. + * Server starts server in test-mode when no options are given. + * + * Revision 1.3 1997/09/04 13:50:30 adam + * Bug fix in ztest. + * + */ + +/************************************************************/ +/* Note this file is shared by all processes */ +/* Should really put it somewhere other than here */ +/* For some strange reason it won't work when part of a lib */ +/************************************************************/ + +#ifdef WIN32 + +#include +#include +#include +#include + +#include "service.h" + +static AppService *pService = NULL; +static BOOL bRunAsService = TRUE; +static void *pAppHandle = NULL; + +/* Private functions to this module */ +void Service_Create(LPTSTR pAppName, LPTSTR pServiceName, LPTSTR pServiceDisplayName, LPTSTR pDependancies, int argc, char **argv); +void Service_Delete(); +void Service_Initialize(); +BOOL NotifyServiceController(); +BOOL UpdateServiceStatus(DWORD Status); +void FailServiceStart(DWORD Win32Code, DWORD PrivateCode); +void CmdInstallService(int argc, char *argv[], BOOL bAutoStart); +void CmdRemoveService(); +LPTSTR GetLastErrorText(LPTSTR lpszBuf, DWORD dwSize); +BOOL CheckServiceArguments(int argc, char *argv[]); + +/* Callback functions for thee service manager */ +void WINAPI ServiceMain(DWORD argc, LPTSTR argv[]); +void WINAPI ServiceControlHandler(DWORD fdwControl); + +/* Function to handle Ctrl + C etc... */ +BOOL EventHandlerRoutine(DWORD dwCtrlType); + +void Service_Create(LPTSTR pAppName, LPTSTR pServiceName, LPTSTR pServiceDisplayName, LPTSTR pDependancies, int argc, char **argv) +{ + pService = malloc(sizeof(AppService)); + pService->pAppName = pAppName; + pService->pServiceName = pServiceName; + pService->pServiceDisplayName = pServiceDisplayName; + pService->pDependancies = pDependancies; + pService->hService = 0; + pService->ServiceTable[0].lpServiceName = pServiceName; + pService->ServiceTable[0].lpServiceProc = ServiceMain; + pService->ServiceTable[1].lpServiceName = NULL; + pService->ServiceTable[1].lpServiceProc = NULL; + pService->argc = argc; + pService->argv = argv; +} + +void Service_Delete() +{ + if (pService != NULL) + { + /* Mark the service as stopping */ + UpdateServiceStatus(SERVICE_STOP_PENDING); + + /* Stop the service */ + StopAppService(pAppHandle); + + /* Service has now stopped */ + UpdateServiceStatus(SERVICE_STOPPED); + + /* Free the memory */ + free(pService); + pService = NULL; + } +} + +void Service_Initialize() +{ + if (pService != NULL) + { + /* Register ourselves with the control dispatcher */ + StartServiceCtrlDispatcher(pService->ServiceTable); + } +} + +void WINAPI ServiceMain(DWORD argc, LPTSTR argv[]) +{ + if (pService != NULL) + { + if (NotifyServiceController()) + { + /* Set the status to pending */ + UpdateServiceStatus(SERVICE_START_PENDING); + + /* Lets attempt to start the service */ + if (StartAppService(pAppHandle, pService->argc, pService->argv)) + { + /* Service is now up and running */ + UpdateServiceStatus(SERVICE_RUNNING); + + /* Lets wait for our clients */ + RunAppService(pAppHandle); + } + else + { + FailServiceStart(GetLastError(), 0); + Service_Delete(); + } + } + } +} + +BOOL NotifyServiceController() +{ + if (pService == NULL) + { + return(FALSE); + } + else + { + if (bRunAsService) + { + pService->ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; + pService->ServiceStatus.dwCurrentState = SERVICE_STOPPED; + pService->ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP; + pService->ServiceStatus.dwWin32ExitCode = 0; + pService->ServiceStatus.dwServiceSpecificExitCode = 0; + pService->ServiceStatus.dwCheckPoint = 0; + pService->ServiceStatus.dwWaitHint = 0; + pService->hService = RegisterServiceCtrlHandler(pService->pServiceName, ServiceControlHandler); + + if (pService->hService) + UpdateServiceStatus(SERVICE_START_PENDING); + else + return(FALSE); + } + return(TRUE); + } +} + +void WINAPI ServiceControlHandler(DWORD fdwControl) +{ + if (pService != NULL) + { + switch (fdwControl) + { + case SERVICE_CONTROL_STOP: + /* Update the service status to be pending */ + Service_Delete(); + break; + + case SERVICE_CONTROL_INTERROGATE: + UpdateServiceStatus(pService->ServiceStatus.dwCurrentState); + break; + + default: + break; + } + } +} + +BOOL UpdateServiceStatus(DWORD Status) +{ + if (pService != NULL) + { + if (pService->hService) + { + pService->ServiceStatus.dwCurrentState = Status; + if ((Status == SERVICE_START_PENDING) || (Status == SERVICE_STOP_PENDING)) + { + pService->ServiceStatus.dwCheckPoint ++; + pService->ServiceStatus.dwWaitHint = 5000; /* 5 sec.*/ + } + else + { + pService->ServiceStatus.dwCheckPoint = 0; + pService->ServiceStatus.dwWaitHint = 0; + } + + return(SetServiceStatus(pService->hService, &pService->ServiceStatus)); + } + } + + return(FALSE); +} + +void FailServiceStart(DWORD Win32Code, DWORD PrivateCode) +{ + if (pService != NULL) + { + pService->ServiceStatus.dwWin32ExitCode = Win32Code; + pService->ServiceStatus.dwServiceSpecificExitCode = PrivateCode; + UpdateServiceStatus(SERVICE_STOPPED); + } +} + +void CmdInstallService(int argc, char *argv[], BOOL bAutoStart) +{ + if (pService != NULL) + { + SC_HANDLE schService; + SC_HANDLE schSCManager; + + TCHAR szPath[2048]; + + if (GetModuleFileName(NULL, szPath, 512) == 0) + { + _tprintf(TEXT("Unable to install %s - %s\n"), TEXT(pService->pServiceDisplayName), GetLastErrorText(pService->szErr, 256)); + } + else + { + int i; + char cwdstr[_MAX_PATH]; + + if (!_getcwd(cwdstr, sizeof(cwdstr))) + strcpy (cwdstr, "."); + + strcat (szPath, TEXT(" -runservice \"")); + strcat (szPath, cwdstr); + strcat (szPath, "\""); + + for (i = 1; i < argc; i++) + { + /* We will add the given command line arguments to the command */ + /* We are not interested in the install and remove options */ + if ((stricmp("-install", argv[i]) != 0) && + (stricmp("-installa", argv[i]) != 0) && + (stricmp("-remove", argv[i]) != 0)) + { + strcat(szPath, TEXT(" ")); + strcat(szPath, argv[i]); + } + } + + schSCManager = OpenSCManager(NULL, /* machine (NULL == local) */ + NULL, /* database (NULL == default) */ + SC_MANAGER_ALL_ACCESS); /* access required */ + if (schSCManager) + { + schService = CreateService(schSCManager, /* SCManager database */ + TEXT(pService->pServiceName), /* name of service */ + TEXT(pService->pServiceDisplayName), /* name to display */ + SERVICE_ALL_ACCESS, /* desired access */ + SERVICE_WIN32_OWN_PROCESS, /* service type */ + bAutoStart ? SERVICE_AUTO_START : + SERVICE_DEMAND_START, /* start type */ + SERVICE_ERROR_NORMAL, /* error control type */ + szPath, /* service's binary */ + NULL, /* no load ordering group */ + NULL, /* no tag identifier */ + TEXT(pService->pDependancies), /* dependencies */ + NULL, /* LocalSystem account */ + NULL); /* no password */ + + if (schService) + { + _tprintf(TEXT("%s installed.\n"), TEXT(pService->pServiceDisplayName)); + CloseServiceHandle(schService); + } + else + { + _tprintf(TEXT("CreateService failed - %s\n"), GetLastErrorText(pService->szErr, 256)); + } + + CloseServiceHandle(schSCManager); + } + else + _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(pService->szErr,256)); + } + } +} + +void CmdRemoveService() +{ + if (pService != NULL) + { + SC_HANDLE schService; + SC_HANDLE schSCManager; + + schSCManager = OpenSCManager(NULL, /* machine (NULL == local) */ + NULL, /* database (NULL == default) */ + SC_MANAGER_ALL_ACCESS); /* access required */ + if (schSCManager) + { + schService = OpenService(schSCManager, TEXT(pService->pServiceName), SERVICE_ALL_ACCESS); + + if (schService) + { + /* try to stop the service */ + if (ControlService(schService, SERVICE_CONTROL_STOP, &pService->ServiceStatus)) + { + _tprintf(TEXT("Stopping %s."), TEXT(pService->pServiceDisplayName)); + Sleep(1000); + + while (QueryServiceStatus(schService, &pService->ServiceStatus)) + { + if (pService->ServiceStatus.dwCurrentState == SERVICE_STOP_PENDING) + { + _tprintf(TEXT(".")); + Sleep( 1000 ); + } + else + break; + } + + if (pService->ServiceStatus.dwCurrentState == SERVICE_STOPPED) + _tprintf(TEXT("\n%s stopped.\n"), TEXT(pService->pServiceDisplayName)); + else + _tprintf(TEXT("\n%s failed to stop.\n"), TEXT(pService->pServiceDisplayName)); + + } + + /* now remove the service */ + if(DeleteService(schService)) + _tprintf(TEXT("%s removed.\n"), TEXT(pService->pServiceDisplayName)); + else + _tprintf(TEXT("DeleteService failed - %s\n"), GetLastErrorText(pService->szErr,256)); + + CloseServiceHandle(schService); + } + else + _tprintf(TEXT("OpenService failed - %s\n"), GetLastErrorText(pService->szErr,256)); + + CloseServiceHandle(schSCManager); + } + else + _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(pService->szErr,256)); + } +} + +LPTSTR GetLastErrorText(LPTSTR lpszBuf, DWORD dwSize) +{ + DWORD dwRet; + LPTSTR lpszTemp = NULL; + + dwRet = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_ARGUMENT_ARRAY, + NULL, + GetLastError(), + LANG_NEUTRAL, + (LPTSTR)&lpszTemp, + 0, + NULL); + + /* supplied buffer is not long enough */ + if (!dwRet || ((long)dwSize < (long)dwRet + 14)) + lpszBuf[0] = TEXT('\0'); + else + { + lpszTemp[lstrlen(lpszTemp)-2] = TEXT('\0'); /* remove cr and newline character */ + _stprintf(lpszBuf, TEXT("%s (0x%x)"), lpszTemp, GetLastError()); + } + + if (lpszTemp) + LocalFree((HLOCAL)lpszTemp); + + return(lpszBuf); +} + +BOOL CheckServiceArguments(int argc, char *argv[]) +{ + int i; + + /* Lets process the arguments */ + for (i = 1; i < argc; i++) + { + if (stricmp("-install", argv[i]) == 0) + { + /* They want to install the service */ + CmdInstallService(argc, argv, FALSE); + + /* We don't carry on, after we have installed the service */ + return(FALSE); + } + else if (stricmp("-installa", argv[i]) == 0) + { + /* They want to install the service */ + CmdInstallService(argc, argv, TRUE); + + /* We don't carry on, after we have installed the service */ + return(FALSE); + } + else if (stricmp("-remove", argv[i]) == 0) + { + /* Here they want to remove it */ + CmdRemoveService(); + + /* We don't carry on, after we have removed the service */ + return(FALSE); + } + else if (stricmp ("-runservice", argv[i]) == 0) + { + /* We can carry on, if we reached here */ + chdir(argv[i+1]); + argv[i] = ""; + argv[i+1] = ""; + return(TRUE); + } + } + bRunAsService = FALSE; + return(TRUE); +} + +BOOL SetupService(int argc, char *argv[], void *pHandle, LPTSTR pAppName, LPTSTR pServiceName, LPTSTR pServiceDisplayName, LPTSTR pDependancies) +{ + BOOL bDeleteService = TRUE; + BOOL bResult = FALSE; + + /* Save the handle for later use */ + pAppHandle = pHandle; + + /* Create our service class */ + Service_Create(pAppName, pServiceName, pServiceDisplayName, pDependancies, argc, argv); + + if (CheckServiceArguments(argc, argv)) + { + if (bRunAsService) + { + /* No need to set the console control handler, as the service manager handles all this for us */ + Service_Initialize(); + bDeleteService = FALSE; + } + else + { + /* Set the console control handler for exiting the program */ + SetConsoleCtrlHandler((PHANDLER_ROUTINE)EventHandlerRoutine, TRUE); + + /* Now do the main work */ + ServiceMain(argc, argv); + } + + /* We have been successful initializing, so let the caller know */ + bResult = TRUE; + } + + if (bDeleteService) + { + /* Finished with the service now */ + Service_Delete(); + } + return(bResult); +} + +BOOL EventHandlerRoutine(DWORD dwCtrlType) +{ + /* This routine dosn't seem to get called all the time, Why ??? */ + switch (dwCtrlType) + { + case CTRL_C_EVENT: /* A CTRL+C signal was received, either from keyboard input or from a signal generated by the GenerateConsoleCtrlEvent function.*/ + case CTRL_BREAK_EVENT: /* A CTRL+BREAK signal was received, either from keyboard input or from a signal generated by GenerateConsoleCtrlEvent.*/ + case CTRL_CLOSE_EVENT: /* A signal that the system sends to all processes attached to a console when the user closes the console (either by choosing the Close command from the console window's System menu, or by choosing the End Task command from the Task List).*/ + case CTRL_LOGOFF_EVENT: /* A signal that the system sends to all console processes when a user is logging off. This signal does not indicate which user is logging off, so no assumptions can be made.*/ + case CTRL_SHUTDOWN_EVENT: /* A signal that the system sends to all console processes when the system */ + /* We are basically shutting down, so call Service_Delete */ + Service_Delete(); + return(FALSE); + break; + + default: + /* we are not handling this one, so return FALSE */ + return(FALSE); + } +} +#endif diff --git a/src/service.h b/src/service.h new file mode 100644 index 0000000..67fed2a --- /dev/null +++ b/src/service.h @@ -0,0 +1,54 @@ +/* + * NT Service interface Utility. + * Based on code written by + * Chas Woodfield, Fretwell Downing Datasystems. + * $Log: service.h,v $ + * Revision 1.1 2003-10-27 12:21:35 adam + * Source restructure. yaz-marcdump part of installation + * + * Revision 1.1 1997/11/07 13:31:52 adam + * Added NT Service name part of statserv_options_block. Moved NT + * service utility to server library. + * + * Revision 1.2 1997/09/04 13:50:30 adam + * Bug fix in ztest. + * + */ + +#ifndef SERVICE_INCLUDED +#define SERVICE_INCLUDED + +#ifdef WIN32 + +#include + +typedef struct _Service +{ + LPTSTR pAppName; + LPTSTR pServiceName; + LPTSTR pServiceDisplayName; + LPTSTR pDependancies; + TCHAR szErr[256]; + SERVICE_STATUS_HANDLE hService; + SERVICE_STATUS ServiceStatus; + SERVICE_TABLE_ENTRY ServiceTable[2]; + int argc; + char **argv; +} AppService; + +/* Called by the app to initialize the service */ +BOOL SetupService(int argc, char *argv[], void *pHandle, LPTSTR pAppName, LPTSTR pServiceName, LPTSTR pServiceDisplayName, LPTSTR pDependancies); + +#endif /* WIN32 */ + +/* Functions that must be in the main application */ +/* Initializes the app */ +int StartAppService(void *pHandle, int argc, char **argv); + +/* Now we wait for any connections */ +void RunAppService(void *pHandle); + +/* Time to tidyup and stop the service */ +void StopAppService(void *pHandle); + +#endif diff --git a/src/seshigh.c b/src/seshigh.c new file mode 100644 index 0000000..05cc464 --- /dev/null +++ b/src/seshigh.c @@ -0,0 +1,2605 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * + * $Id: seshigh.c,v 1.1 2003-10-27 12:21:35 adam Exp $ + */ + +/* + * Frontend server logic. + * + * This code receives incoming APDUs, and handles client requests by means + * of the backend API. + * + * Some of the code is getting quite involved, compared to simpler servers - + * primarily because it is asynchronous both in the communication with + * the user and the backend. We think the complexity will pay off in + * the form of greater flexibility when more asynchronous facilities + * are implemented. + * + * Memory management has become somewhat involved. In the simple case, where + * only one PDU is pending at a time, it will simply reuse the same memory, + * once it has found its working size. When we enable multiple concurrent + * operations, perhaps even with multiple parallel calls to the backend, it + * will maintain a pool of buffers for encoding and decoding, trying to + * minimize memory allocation/deallocation during normal operation. + * + */ + +#include +#include +#include +#ifdef WIN32 +#include +#define S_ISREG(x) (x & _S_IFREG) +#include +#include +#else +#include +#include +#endif +#include +#include + +#include +#include +#include +#include "eventl.h" +#include "session.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +static void process_gdu_request(association *assoc, request *req); +static int process_z_request(association *assoc, request *req, char **msg); +void backend_response(IOCHAN i, int event); +static int process_gdu_response(association *assoc, request *req, Z_GDU *res); +static int process_z_response(association *assoc, request *req, Z_APDU *res); +static Z_APDU *process_initRequest(association *assoc, request *reqb); +static Z_External *init_diagnostics(ODR odr, int errcode, char *errstring); +static Z_APDU *process_searchRequest(association *assoc, request *reqb, + int *fd); +static Z_APDU *response_searchRequest(association *assoc, request *reqb, + bend_search_rr *bsrr, int *fd); +static Z_APDU *process_presentRequest(association *assoc, request *reqb, + int *fd); +static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd); +static Z_APDU *process_sortRequest(association *assoc, request *reqb, int *fd); +static void process_close(association *assoc, request *reqb); +void save_referenceId (request *reqb, Z_ReferenceId *refid); +static Z_APDU *process_deleteRequest(association *assoc, request *reqb, + int *fd); +static Z_APDU *process_segmentRequest (association *assoc, request *reqb); + +static FILE *apduf = 0; /* for use in static mode */ +static statserv_options_block *control_block = 0; + +static Z_APDU *process_ESRequest(association *assoc, request *reqb, int *fd); + +/* + * Create and initialize a new association-handle. + * channel : iochannel for the current line. + * link : communications channel. + * Returns: 0 or a new association handle. + */ +association *create_association(IOCHAN channel, COMSTACK link) +{ + association *anew; + + if (!control_block) + control_block = statserv_getcontrol(); + if (!(anew = (association *)xmalloc(sizeof(*anew)))) + return 0; + anew->init = 0; + anew->version = 0; + anew->client_chan = channel; + anew->client_link = link; + anew->cs_get_mask = 0; + anew->cs_put_mask = 0; + anew->cs_accept_mask = 0; + if (!(anew->decode = odr_createmem(ODR_DECODE)) || + !(anew->encode = odr_createmem(ODR_ENCODE))) + return 0; + if (*control_block->apdufile) + { + char filename[256]; + FILE *f; + + strcpy(filename, control_block->apdufile); + if (!(anew->print = odr_createmem(ODR_PRINT))) + return 0; + if (*control_block->apdufile == '@') + { + odr_setprint(anew->print, yaz_log_file()); + } + else if (*control_block->apdufile != '-') + { + strcpy(filename, control_block->apdufile); + if (!control_block->dynamic) + { + if (!apduf) + { + if (!(apduf = fopen(filename, "w"))) + { + yaz_log(LOG_WARN|LOG_ERRNO, "%s", filename); + return 0; + } + setvbuf(apduf, 0, _IONBF, 0); + } + f = apduf; + } + else + { + sprintf(filename + strlen(filename), ".%d", getpid()); + if (!(f = fopen(filename, "w"))) + { + yaz_log(LOG_WARN|LOG_ERRNO, "%s", filename); + return 0; + } + setvbuf(f, 0, _IONBF, 0); + } + odr_setprint(anew->print, f); + } + } + else + anew->print = 0; + anew->input_buffer = 0; + anew->input_buffer_len = 0; + anew->backend = 0; + anew->state = ASSOC_NEW; + request_initq(&anew->incoming); + request_initq(&anew->outgoing); + anew->proto = cs_getproto(link); + return anew; +} + +/* + * Free association and release resources. + */ +void destroy_association(association *h) +{ + statserv_options_block *cb = statserv_getcontrol(); + request *req; + + xfree(h->init); + odr_destroy(h->decode); + odr_destroy(h->encode); + if (h->print) + odr_destroy(h->print); + if (h->input_buffer) + xfree(h->input_buffer); + if (h->backend) + (*cb->bend_close)(h->backend); + while ((req = request_deq(&h->incoming))) + request_release(req); + while ((req = request_deq(&h->outgoing))) + request_release(req); + request_delq(&h->incoming); + request_delq(&h->outgoing); + xfree(h); + xmalloc_trav("session closed"); + if (control_block && control_block->one_shot) + { + exit (0); + } +} + +static void do_close_req(association *a, int reason, char *message, + request *req) +{ + Z_APDU apdu; + Z_Close *cls = zget_Close(a->encode); + + /* Purge request queue */ + while (request_deq(&a->incoming)); + while (request_deq(&a->outgoing)); + if (a->version >= 3) + { + yaz_log(LOG_LOG, "Sending Close PDU, reason=%d, message=%s", + reason, message ? message : "none"); + apdu.which = Z_APDU_close; + apdu.u.close = cls; + *cls->closeReason = reason; + cls->diagnosticInformation = message; + process_z_response(a, req, &apdu); + iochan_settimeout(a->client_chan, 20); + } + else + { + request_release(req); + yaz_log(LOG_DEBUG, "v2 client. No Close PDU"); + iochan_setevent(a->client_chan, EVENT_TIMEOUT); /* force imm close */ + } + a->state = ASSOC_DEAD; +} + +static void do_close(association *a, int reason, char *message) +{ + request *req = request_get(&a->outgoing); + do_close_req (a, reason, message, req); +} + +/* + * This is where PDUs from the client are read and the further + * processing is initiated. Flow of control moves down through the + * various process_* functions below, until the encoded result comes back up + * to the output handler in here. + * + * h : the I/O channel that has an outstanding event. + * event : the current outstanding event. + */ +void ir_session(IOCHAN h, int event) +{ + int res; + association *assoc = (association *)iochan_getdata(h); + COMSTACK conn = assoc->client_link; + request *req; + + assert(h && conn && assoc); + if (event == EVENT_TIMEOUT) + { + if (assoc->state != ASSOC_UP) + { + yaz_log(LOG_LOG, "Final timeout - closing connection."); + cs_close(conn); + destroy_association(assoc); + iochan_destroy(h); + } + else + { + yaz_log(LOG_LOG, "Session idle too long. Sending close."); + do_close(assoc, Z_Close_lackOfActivity, 0); + } + return; + } + if (event & assoc->cs_accept_mask) + { + yaz_log (LOG_DEBUG, "ir_session (accept)"); + if (!cs_accept (conn)) + { + yaz_log (LOG_LOG, "accept failed"); + destroy_association(assoc); + iochan_destroy(h); + } + iochan_clearflag (h, EVENT_OUTPUT|EVENT_OUTPUT); + if (conn->io_pending) + { /* cs_accept didn't complete */ + assoc->cs_accept_mask = + ((conn->io_pending & CS_WANT_WRITE) ? EVENT_OUTPUT : 0) | + ((conn->io_pending & CS_WANT_READ) ? EVENT_INPUT : 0); + + iochan_setflag (h, assoc->cs_accept_mask); + } + else + { /* cs_accept completed. Prepare for reading (cs_get) */ + assoc->cs_accept_mask = 0; + assoc->cs_get_mask = EVENT_INPUT; + iochan_setflag (h, assoc->cs_get_mask); + } + return; + } + if ((event & assoc->cs_get_mask) || (event & EVENT_WORK)) /* input */ + { + if ((assoc->cs_put_mask & EVENT_INPUT) == 0 && (event & assoc->cs_get_mask)) + { + yaz_log(LOG_DEBUG, "ir_session (input)"); + /* We aren't speaking to this fellow */ + if (assoc->state == ASSOC_DEAD) + { + yaz_log(LOG_LOG, "Connection closed - end of session"); + cs_close(conn); + destroy_association(assoc); + iochan_destroy(h); + return; + } + assoc->cs_get_mask = EVENT_INPUT; + if ((res = cs_get(conn, &assoc->input_buffer, + &assoc->input_buffer_len)) <= 0) + { + yaz_log(LOG_LOG, "Connection closed by client"); + cs_close(conn); + destroy_association(assoc); + iochan_destroy(h); + return; + } + else if (res == 1) /* incomplete read - wait for more */ + { + if (conn->io_pending & CS_WANT_WRITE) + assoc->cs_get_mask |= EVENT_OUTPUT; + iochan_setflag(h, assoc->cs_get_mask); + return; + } + if (cs_more(conn)) /* more stuff - call us again later, please */ + iochan_setevent(h, EVENT_INPUT); + + /* we got a complete PDU. Let's decode it */ + yaz_log(LOG_DEBUG, "Got PDU, %d bytes: lead=%02X %02X %02X", res, + assoc->input_buffer[0] & 0xff, + assoc->input_buffer[1] & 0xff, + assoc->input_buffer[2] & 0xff); + req = request_get(&assoc->incoming); /* get a new request */ + odr_reset(assoc->decode); + odr_setbuf(assoc->decode, assoc->input_buffer, res, 0); + if (!z_GDU(assoc->decode, &req->gdu_request, 0, 0)) + { + yaz_log(LOG_LOG, "ODR error on incoming PDU: %s [element %s] " + "[near byte %d] ", + odr_errmsg(odr_geterror(assoc->decode)), + odr_getelement(assoc->decode), + odr_offset(assoc->decode)); + if (assoc->decode->error != OHTTP) + { + yaz_log(LOG_LOG, "PDU dump:"); + odr_dumpBER(yaz_log_file(), assoc->input_buffer, res); + request_release(req); + do_close(assoc, Z_Close_protocolError,"Malformed package"); + } + else + { + Z_GDU *p = z_get_HTTP_Response(assoc->encode, 400); + assoc->state = ASSOC_DEAD; + process_gdu_response(assoc, req, p); + } + return; + } + req->request_mem = odr_extract_mem(assoc->decode); + if (assoc->print && !z_GDU(assoc->print, &req->gdu_request, 0, 0)) + { + yaz_log(LOG_WARN, "ODR print error: %s", + odr_errmsg(odr_geterror(assoc->print))); + odr_reset(assoc->print); + } + request_enq(&assoc->incoming, req); + } + + /* can we do something yet? */ + req = request_head(&assoc->incoming); + if (req->state == REQUEST_IDLE) + { + request_deq(&assoc->incoming); + process_gdu_request(assoc, req); + } + } + if (event & assoc->cs_put_mask) + { + request *req = request_head(&assoc->outgoing); + + assoc->cs_put_mask = 0; + yaz_log(LOG_DEBUG, "ir_session (output)"); + req->state = REQUEST_PENDING; + switch (res = cs_put(conn, req->response, req->len_response)) + { + case -1: + yaz_log(LOG_LOG, "Connection closed by client"); + cs_close(conn); + destroy_association(assoc); + iochan_destroy(h); + break; + case 0: /* all sent - release the request structure */ + yaz_log(LOG_DEBUG, "Wrote PDU, %d bytes", req->len_response); +#if 0 + yaz_log(LOG_DEBUG, "HTTP out:\n%.*s", req->len_response, + req->response); +#endif + nmem_destroy(req->request_mem); + request_deq(&assoc->outgoing); + request_release(req); + if (!request_head(&assoc->outgoing)) + { /* restore mask for cs_get operation ... */ + iochan_clearflag(h, EVENT_OUTPUT|EVENT_INPUT); + iochan_setflag(h, assoc->cs_get_mask); + if (assoc->state == ASSOC_DEAD) + iochan_setevent(assoc->client_chan, EVENT_TIMEOUT); + } + else + { + assoc->cs_put_mask = EVENT_OUTPUT; + } + break; + default: + if (conn->io_pending & CS_WANT_WRITE) + assoc->cs_put_mask |= EVENT_OUTPUT; + if (conn->io_pending & CS_WANT_READ) + assoc->cs_put_mask |= EVENT_INPUT; + iochan_setflag(h, assoc->cs_put_mask); + } + } + if (event & EVENT_EXCEPT) + { + yaz_log(LOG_LOG, "ir_session (exception)"); + cs_close(conn); + destroy_association(assoc); + iochan_destroy(h); + } +} + +static int process_z_request(association *assoc, request *req, char **msg); + +static void assoc_init_reset(association *assoc) +{ + xfree (assoc->init); + assoc->init = (bend_initrequest *) xmalloc (sizeof(*assoc->init)); + + assoc->init->stream = assoc->encode; + assoc->init->print = assoc->print; + assoc->init->auth = 0; + assoc->init->referenceId = 0; + assoc->init->implementation_version = 0; + assoc->init->implementation_id = 0; + assoc->init->implementation_name = 0; + assoc->init->bend_sort = NULL; + assoc->init->bend_search = NULL; + assoc->init->bend_present = NULL; + assoc->init->bend_esrequest = NULL; + assoc->init->bend_delete = NULL; + assoc->init->bend_scan = NULL; + assoc->init->bend_segment = NULL; + assoc->init->bend_fetch = NULL; + assoc->init->bend_explain = NULL; + + assoc->init->charneg_request = NULL; + assoc->init->charneg_response = NULL; + + assoc->init->decode = assoc->decode; + assoc->init->peer_name = + odr_strdup (assoc->encode, cs_addrstr(assoc->client_link)); +} + +static int srw_bend_init(association *assoc) +{ + const char *encoding = "UTF-8"; + Z_External *ce; + bend_initresult *binitres; + statserv_options_block *cb = statserv_getcontrol(); + + assoc_init_reset(assoc); + + assoc->maximumRecordSize = 3000000; + assoc->preferredMessageSize = 3000000; +#if 1 + ce = yaz_set_proposal_charneg(assoc->decode, &encoding, 1, 0, 0, 1); + assoc->init->charneg_request = ce->u.charNeg3; +#endif + if (!(binitres = (*cb->bend_init)(assoc->init))) + { + yaz_log(LOG_WARN, "Bad response from backend."); + return 0; + } + assoc->backend = binitres->handle; + return 1; +} + +static int srw_bend_fetch(association *assoc, int pos, + Z_SRW_searchRetrieveRequest *srw_req, + Z_SRW_record *record) +{ + bend_fetch_rr rr; + ODR o = assoc->encode; + + rr.setname = "default"; + rr.number = pos; + rr.referenceId = 0; + rr.request_format = VAL_TEXT_XML; + rr.request_format_raw = yaz_oidval_to_z3950oid(assoc->decode, + CLASS_TRANSYN, + VAL_TEXT_XML); + rr.comp = (Z_RecordComposition *) + odr_malloc(assoc->decode, sizeof(*rr.comp)); + rr.comp->which = Z_RecordComp_complex; + rr.comp->u.complex = (Z_CompSpec *) + odr_malloc(assoc->decode, sizeof(Z_CompSpec)); + rr.comp->u.complex->selectAlternativeSyntax = (bool_t *) + odr_malloc(assoc->encode, sizeof(bool_t)); + *rr.comp->u.complex->selectAlternativeSyntax = 0; + rr.comp->u.complex->num_dbSpecific = 0; + rr.comp->u.complex->dbSpecific = 0; + rr.comp->u.complex->num_recordSyntax = 0; + rr.comp->u.complex->recordSyntax = 0; + + rr.comp->u.complex->generic = (Z_Specification *) + odr_malloc(assoc->decode, sizeof(Z_Specification)); + rr.comp->u.complex->generic->which = Z_Schema_uri; + rr.comp->u.complex->generic->schema.uri = srw_req->recordSchema; + rr.comp->u.complex->generic->elementSpec = 0; + + rr.stream = assoc->encode; + rr.print = assoc->print; + + rr.basename = 0; + rr.len = 0; + rr.record = 0; + rr.last_in_set = 0; + rr.output_format = VAL_TEXT_XML; + rr.output_format_raw = 0; + rr.errcode = 0; + rr.errstring = 0; + rr.surrogate_flag = 0; + rr.schema = srw_req->recordSchema; + + if (!assoc->init->bend_fetch) + return 1; + + (*assoc->init->bend_fetch)(assoc->backend, &rr); + + if (rr.len >= 0) + { + record->recordData_buf = rr.record; + record->recordData_len = rr.len; + record->recordPosition = odr_intdup(o, pos); + if (rr.schema) + record->recordSchema = odr_strdup(o, rr.schema); + else + record->recordSchema = 0; + } + return rr.errcode; +} + +static void srw_bend_search(association *assoc, request *req, + Z_SRW_searchRetrieveRequest *srw_req, + Z_SRW_searchRetrieveResponse *srw_res) +{ + int srw_error = 0; + bend_search_rr rr; + Z_External *ext; + + yaz_log(LOG_LOG, "Got SRW SearchRetrieveRequest"); + yaz_log(LOG_DEBUG, "srw_bend_search"); + if (!assoc->init) + { + yaz_log(LOG_DEBUG, "srw_bend_init"); + if (!srw_bend_init(assoc)) + { + srw_error = 3; /* assume Authentication error */ + + srw_res->num_diagnostics = 1; + srw_res->diagnostics = (Z_SRW_diagnostic *) + odr_malloc(assoc->encode, sizeof(*srw_res->diagnostics)); + srw_res->diagnostics[0].code = + odr_intdup(assoc->encode, srw_error); + srw_res->diagnostics[0].details = 0; + return; + } + } + + rr.setname = "default"; + rr.replace_set = 1; + rr.num_bases = 1; + rr.basenames = &srw_req->database; + rr.referenceId = 0; + + rr.query = (Z_Query *) odr_malloc (assoc->decode, sizeof(*rr.query)); + + if (srw_req->query_type == Z_SRW_query_type_cql) + { + ext = (Z_External *) odr_malloc(assoc->decode, sizeof(*ext)); + ext->direct_reference = odr_getoidbystr(assoc->decode, + "1.2.840.10003.16.2"); + ext->indirect_reference = 0; + ext->descriptor = 0; + ext->which = Z_External_CQL; + ext->u.cql = srw_req->query.cql; + + rr.query->which = Z_Query_type_104; + rr.query->u.type_104 = ext; + } + else if (srw_req->query_type == Z_SRW_query_type_pqf) + { + Z_RPNQuery *RPNquery; + YAZ_PQF_Parser pqf_parser; + + pqf_parser = yaz_pqf_create (); + + RPNquery = yaz_pqf_parse (pqf_parser, assoc->decode, + srw_req->query.pqf); + if (!RPNquery) + { + const char *pqf_msg; + size_t off; + int code = yaz_pqf_error (pqf_parser, &pqf_msg, &off); + yaz_log(LOG_LOG, "%*s^\n", off+4, ""); + yaz_log(LOG_LOG, "Bad PQF: %s (code %d)\n", pqf_msg, code); + + srw_error = 10; + } + + rr.query->which = Z_Query_type_1; + rr.query->u.type_1 = RPNquery; + + yaz_pqf_destroy (pqf_parser); + } + else + srw_error = 11; + + if (!srw_error && srw_req->sort_type != Z_SRW_sort_type_none) + srw_error = 80; + + if (!srw_error && !assoc->init->bend_search) + srw_error = 1; + + if (srw_error) + { + yaz_log(LOG_DEBUG, "srw_bend_search returned SRW error %d", srw_error); + srw_res->num_diagnostics = 1; + srw_res->diagnostics = (Z_SRW_diagnostic *) + odr_malloc(assoc->encode, sizeof(*srw_res->diagnostics)); + srw_res->diagnostics[0].code = + odr_intdup(assoc->encode, srw_error); + srw_res->diagnostics[0].details = 0; + return; + } + + rr.stream = assoc->encode; + rr.decode = assoc->decode; + rr.print = assoc->print; + rr.request = req; + rr.association = assoc; + rr.fd = 0; + rr.hits = 0; + rr.errcode = 0; + rr.errstring = 0; + rr.search_info = 0; + yaz_log_zquery(rr.query); + (assoc->init->bend_search)(assoc->backend, &rr); + srw_res->numberOfRecords = odr_intdup(assoc->encode, rr.hits); + if (rr.errcode) + { + yaz_log(LOG_DEBUG, "bend_search returned Bib-1 code %d", rr.errcode); + srw_res->num_diagnostics = 1; + srw_res->diagnostics = (Z_SRW_diagnostic *) + odr_malloc(assoc->encode, sizeof(*srw_res->diagnostics)); + srw_res->diagnostics[0].code = + odr_intdup(assoc->encode, + yaz_diag_bib1_to_srw (rr.errcode)); + srw_res->diagnostics[0].details = rr.errstring; + yaz_log(LOG_DEBUG, "srw_bend_search returned SRW error %d", + *srw_res->diagnostics[0].code); + + } + else + { + int number = srw_req->maximumRecords ? *srw_req->maximumRecords : 0; + int start = srw_req->startRecord ? *srw_req->startRecord : 1; + + yaz_log(LOG_LOG, "Request to pack %d+%d out of %d", + start, number, rr.hits); + + srw_res->numberOfRecords = odr_intdup(assoc->encode, rr.hits); + if (number > 0) + { + int i; + + if (start > rr.hits) + { + yaz_log(LOG_LOG, "Request out or range"); + } + else + { + int j = 0; + int packing = Z_SRW_recordPacking_string; + if (start + number > rr.hits) + number = rr.hits - start + 1; + if (srw_req->recordPacking && + !strcmp(srw_req->recordPacking, "xml")) + packing = Z_SRW_recordPacking_XML; + srw_res->records = (Z_SRW_record *) + odr_malloc(assoc->encode, + number * sizeof(*srw_res->records)); + for (i = 0; irecords[j].recordPacking = packing; + srw_res->records[j].recordData_buf = 0; + yaz_log(LOG_DEBUG, "srw_bend_fetch %d", i+start); + errcode = srw_bend_fetch(assoc, i+start, srw_req, + srw_res->records + j); + if (errcode) + { + srw_res->num_diagnostics = 1; + srw_res->diagnostics = (Z_SRW_diagnostic *) + odr_malloc(assoc->encode, + sizeof(*srw_res->diagnostics)); + srw_res->diagnostics[0].code = + odr_intdup(assoc->encode, + yaz_diag_bib1_to_srw (errcode)); + srw_res->diagnostics[0].details = rr.errstring; + break; + } + if (srw_res->records[j].recordData_buf) + j++; + } + srw_res->num_records = j; + if (!j) + srw_res->records = 0; + } + } + } +} + + +static void srw_bend_explain(association *assoc, request *req, + Z_SRW_explainRequest *srw_req, + Z_SRW_explainResponse *srw_res) +{ + yaz_log(LOG_LOG, "Got SRW ExplainRequest"); + if (!assoc->init) + { + yaz_log(LOG_DEBUG, "srw_bend_init"); + if (!srw_bend_init(assoc)) + return; + } + if (assoc->init && assoc->init->bend_explain) + { + bend_explain_rr rr; + + rr.stream = assoc->encode; + rr.decode = assoc->decode; + rr.print = assoc->print; + rr.explain_buf = 0; + (*assoc->init->bend_explain)(assoc->backend, &rr); + if (rr.explain_buf) + { + srw_res->explainData_buf = rr.explain_buf; + srw_res->explainData_len = strlen(rr.explain_buf); + } + } +} + +static int hex_digit (int ch) +{ + if (ch >= '0' && ch <= '9') + return ch - '0'; + else if (ch >= 'a' && ch <= 'f') + return ch - 'a'+10; + else if (ch >= 'A' && ch <= 'F') + return ch - 'A'+10; + return 0; +} + +static char *uri_val(const char *path, const char *name, ODR o) +{ + size_t nlen = strlen(name); + if (*path != '?') + return 0; + path++; + while (path && *path) + { + const char *p1 = strchr(path, '='); + if (!p1) + break; + if ((size_t)(p1 - path) == nlen && !memcmp(path, name, nlen)) + { + size_t i = 0; + char *ret; + + path = p1 + 1; + p1 = strchr(path, '&'); + if (!p1) + p1 = strlen(path) + path; + ret = odr_malloc(o, p1 - path + 1); + while (*path && *path != '&') + { + if (*path == '+') + { + ret[i++] = ' '; + path++; + } + else if (*path == '%' && path[1] && path[2]) + { + ret[i++] = hex_digit (path[1])*16 + hex_digit (path[2]); + path = path + 3; + } + else + ret[i++] = *path++; + } + ret[i] = '\0'; + return ret; + } + path = strchr(p1, '&'); + if (path) + path++; + } + return 0; +} + +void uri_val_int(const char *path, const char *name, ODR o, int **intp) +{ + const char *v = uri_val(path, name, o); + if (v) + *intp = odr_intdup(o, atoi(v)); +} + +static void process_http_request(association *assoc, request *req) +{ + Z_HTTP_Request *hreq = req->gdu_request->u.HTTP_Request; + ODR o = assoc->encode; + Z_GDU *p = 0; + Z_HTTP_Response *hres = 0; + int keepalive = 1; + + if (!strcmp(hreq->method, "GET")) + { + char *db = "Default"; + const char *p0 = hreq->path, *p1; +#if HAVE_XML2 + int ret = -1; + char *charset = 0; + Z_SOAP *soap_package = 0; + static Z_SOAP_Handler soap_handlers[2] = { + {"http://www.loc.gov/zing/srw/v1.0/", 0, + (Z_SOAP_fun) yaz_srw_codec}, + {0, 0, 0} + }; +#endif + + if (*p0 == '/') + p0++; + p1 = strchr(p0, '?'); + if (!p1) + p1 = p0 + strlen(p0); + if (p1 != p0) + { + db = odr_malloc(assoc->decode, p1 - p0 + 1); + memcpy (db, p0, p1 - p0); + db[p1 - p0] = '\0'; + } +#if HAVE_XML2 + if (p1 && *p1 == '?' && p1[1]) + { + Z_SRW_PDU *res = yaz_srw_get(o, Z_SRW_searchRetrieve_response); + Z_SRW_PDU *sr = yaz_srw_get(o, Z_SRW_searchRetrieve_request); + char *query = uri_val(p1, "query", o); + char *pQuery = uri_val(p1, "pQuery", o); + char *sortKeys = uri_val(p1, "sortKeys", o); + + if (query) + { + sr->u.request->query_type = Z_SRW_query_type_cql; + sr->u.request->query.cql = query; + } + if (pQuery) + { + sr->u.request->query_type = Z_SRW_query_type_pqf; + sr->u.request->query.pqf = pQuery; + } + if (sortKeys) + { + sr->u.request->sort_type = Z_SRW_sort_type_sort; + sr->u.request->sort.sortKeys = sortKeys; + } + sr->u.request->recordSchema = uri_val(p1, "recordSchema", o); + sr->u.request->recordPacking = uri_val(p1, "recordPacking", o); + if (!sr->u.request->recordPacking) + sr->u.request->recordPacking = "xml"; + uri_val_int(p1, "maximumRecords", o, + &sr->u.request->maximumRecords); + uri_val_int(p1, "startRecord", o, + &sr->u.request->startRecord); + if (sr->u.request->startRecord) + yaz_log(LOG_LOG, "startRecord=%d", *sr->u.request->startRecord); + sr->u.request->database = db; + srw_bend_search(assoc, req, sr->u.request, res->u.response); + + soap_package = odr_malloc(o, sizeof(*soap_package)); + soap_package->which = Z_SOAP_generic; + + soap_package->u.generic = + odr_malloc(o, sizeof(*soap_package->u.generic)); + + soap_package->u.generic->p = res; + soap_package->u.generic->ns = soap_handlers[0].ns; + soap_package->u.generic->no = 0; + + soap_package->ns = "SRU"; + + p = z_get_HTTP_Response(o, 200); + hres = p->u.HTTP_Response; + + ret = z_soap_codec_enc(assoc->encode, &soap_package, + &hres->content_buf, &hres->content_len, + soap_handlers, charset); + if (!charset) + z_HTTP_header_add(o, &hres->headers, "Content-Type", "text/xml"); + else + { + char ctype[60]; + strcpy(ctype, "text/xml; charset="); + strcat(ctype, charset); + z_HTTP_header_add(o, &hres->headers, "Content-Type", ctype); + } + + } + else + { + Z_SRW_PDU *res = yaz_srw_get(o, Z_SRW_explain_response); + Z_SRW_PDU *sr = yaz_srw_get(o, Z_SRW_explain_request); + + srw_bend_explain(assoc, req, sr->u.explain_request, + res->u.explain_response); + + if (res->u.explain_response->explainData_buf) + { + soap_package = odr_malloc(o, sizeof(*soap_package)); + soap_package->which = Z_SOAP_generic; + + soap_package->u.generic = + odr_malloc(o, sizeof(*soap_package->u.generic)); + + soap_package->u.generic->p = res; + soap_package->u.generic->ns = soap_handlers[0].ns; + soap_package->u.generic->no = 0; + + soap_package->ns = "SRU"; + + p = z_get_HTTP_Response(o, 200); + hres = p->u.HTTP_Response; + + ret = z_soap_codec_enc(assoc->encode, &soap_package, + &hres->content_buf, &hres->content_len, + soap_handlers, charset); + if (!charset) + z_HTTP_header_add(o, &hres->headers, "Content-Type", "text/xml"); + else + { + char ctype[60]; + strcpy(ctype, "text/xml; charset="); + strcat(ctype, charset); + z_HTTP_header_add(o, &hres->headers, "Content-Type", + ctype); + } + } + } +#endif +#ifdef DOCDIR + if (strlen(hreq->path) >= 5 && strlen(hreq->path) < 80 && + !memcmp(hreq->path, "/doc/", 5)) + { + FILE *f; + char fpath[120]; + + strcpy(fpath, DOCDIR); + strcat(fpath, hreq->path+4); + f = fopen(fpath, "rb"); + if (f) { + struct stat sbuf; + if (fstat(fileno(f), &sbuf) || !S_ISREG(sbuf.st_mode)) + { + fclose(f); + f = 0; + } + } + if (f) + { + long sz; + fseek(f, 0L, SEEK_END); + sz = ftell(f); + if (sz >= 0 && sz < 500000) + { + const char *ctype = "application/octet-stream"; + const char *cp; + + p = z_get_HTTP_Response(o, 200); + hres = p->u.HTTP_Response; + hres->content_buf = (char *) odr_malloc(o, sz + 1); + hres->content_len = sz; + fseek(f, 0L, SEEK_SET); + fread(hres->content_buf, 1, sz, f); + if ((cp = strrchr(fpath, '.'))) { + cp++; + if (!strcmp(cp, "png")) + ctype = "image/png"; + else if (!strcmp(cp, "gif")) + ctype = "image/gif"; + else if (!strcmp(cp, "xml")) + ctype = "text/xml"; + else if (!strcmp(cp, "html")) + ctype = "text/html"; + } + z_HTTP_header_add(o, &hres->headers, "Content-Type", ctype); + } + fclose(f); + } + } +#endif + +#if 0 + if (!strcmp(hreq->path, "/")) + { +#ifdef DOCDIR + struct stat sbuf; +#endif + const char *doclink = ""; + p = z_get_HTTP_Response(o, 200); + hres = p->u.HTTP_Response; + hres->content_buf = (char *) odr_malloc(o, 400); +#ifdef DOCDIR + if (stat(DOCDIR "/yaz.html", &sbuf) == 0 && S_ISREG(sbuf.st_mode)) + doclink = "

Documentation

"; +#endif + sprintf (hres->content_buf, + "\n" + "\n" + " \n" + " YAZ " YAZ_VERSION "\n" + " \n" + " \n" + "

YAZ " + YAZ_VERSION "

\n" + "%s" + " \n" + "\n", doclink); + hres->content_len = strlen(hres->content_buf); + z_HTTP_header_add(o, &hres->headers, "Content-Type", "text/html"); + } +#endif + + if (!p) + { + p = z_get_HTTP_Response(o, 404); + } + } + else if (!strcmp(hreq->method, "POST")) + { + const char *content_type = z_HTTP_header_lookup(hreq->headers, + "Content-Type"); + if (content_type && !yaz_strcmp_del("text/xml", content_type, "; ")) + { + Z_SOAP *soap_package = 0; + int ret = -1; + int http_code = 500; + const char *charset_p = 0; + char *charset = 0; + + static Z_SOAP_Handler soap_handlers[2] = { +#if HAVE_XML2 + {"http://www.loc.gov/zing/srw/v1.0/", 0, + (Z_SOAP_fun) yaz_srw_codec}, +#endif + {0, 0, 0} + }; + if ((charset_p = strstr(content_type, "; charset="))) + { + int i = 0; + charset_p += 10; + while (i < 20 && charset_p[i] && + !strchr("; \n\r", charset_p[i])) + i++; + charset = odr_malloc(assoc->encode, i+1); + memcpy(charset, charset_p, i); + charset[i] = '\0'; + yaz_log(LOG_LOG, "SOAP encoding %s", charset); + } + ret = z_soap_codec(assoc->decode, &soap_package, + &hreq->content_buf, &hreq->content_len, + soap_handlers); +#if HAVE_XML2 + if (!ret && soap_package->which == Z_SOAP_generic && + soap_package->u.generic->no == 0) + { + /* SRW package */ + Z_SRW_PDU *sr = soap_package->u.generic->p; + + if (sr->which == Z_SRW_searchRetrieve_request) + { + Z_SRW_PDU *res = + yaz_srw_get(assoc->encode, + Z_SRW_searchRetrieve_response); + + if (!sr->u.request->database) + { + const char *p0 = hreq->path, *p1; + if (*p0 == '/') + p0++; + p1 = strchr(p0, '?'); + if (!p1) + p1 = p0 + strlen(p0); + if (p1 != p0) + { + sr->u.request->database = + odr_malloc(assoc->decode, p1 - p0 + 1); + memcpy (sr->u.request->database, p0, p1 - p0); + sr->u.request->database[p1 - p0] = '\0'; + } + else + sr->u.request->database = "Default"; + } + srw_bend_search(assoc, req, sr->u.request, + res->u.response); + + soap_package->u.generic->p = res; + http_code = 200; + } + else if (sr->which == Z_SRW_explain_request) + { + Z_SRW_PDU *res = + yaz_srw_get(assoc->encode, Z_SRW_explain_response); + + srw_bend_explain(assoc, req, sr->u.explain_request, + res->u.explain_response); + if (!res->u.explain_response->explainData_buf) + { + z_soap_error(assoc->encode, soap_package, + "SOAP-ENV:Client", "Explain Not Supported", 0); + } + else + { + soap_package->u.generic->p = res; + http_code = 200; + } + } + else + { + z_soap_error(assoc->encode, soap_package, + "SOAP-ENV:Client", "Bad method", 0); + } + } +#endif + p = z_get_HTTP_Response(o, 200); + hres = p->u.HTTP_Response; + ret = z_soap_codec_enc(assoc->encode, &soap_package, + &hres->content_buf, &hres->content_len, + soap_handlers, charset); + hres->code = http_code; + if (!charset) + z_HTTP_header_add(o, &hres->headers, "Content-Type", "text/xml"); + else + { + char ctype[60]; + strcpy(ctype, "text/xml; charset="); + strcat(ctype, charset); + z_HTTP_header_add(o, &hres->headers, "Content-Type", ctype); + } + } + if (!p) /* still no response ? */ + p = z_get_HTTP_Response(o, 500); + } + else + { + p = z_get_HTTP_Response(o, 405); + hres = p->u.HTTP_Response; + + z_HTTP_header_add(o, &hres->headers, "Allow", "GET, POST"); + } + hres = p->u.HTTP_Response; + if (!strcmp(hreq->version, "1.0")) + { + const char *v = z_HTTP_header_lookup(hreq->headers, "Connection"); + if (v && !strcmp(v, "Keep-Alive")) + keepalive = 1; + else + keepalive = 0; + hres->version = "1.0"; + } + else + { + const char *v = z_HTTP_header_lookup(hreq->headers, "Connection"); + if (v && !strcmp(v, "close")) + keepalive = 0; + else + keepalive = 1; + hres->version = "1.1"; + } + if (!keepalive) + { + z_HTTP_header_add(o, &hres->headers, "Connection", "close"); + assoc->state = ASSOC_DEAD; + } + else + { + int t; + const char *alive = z_HTTP_header_lookup(hreq->headers, "Keep-Alive"); + + if (alive && isdigit(*alive)) + t = atoi(alive); + else + t = 15; + if (t < 0 || t > 3600) + t = 3600; + iochan_settimeout(assoc->client_chan,t); + z_HTTP_header_add(o, &hres->headers, "Connection", "Keep-Alive"); + } + process_gdu_response(assoc, req, p); +} + +static void process_gdu_request(association *assoc, request *req) +{ + if (req->gdu_request->which == Z_GDU_Z3950) + { + char *msg = 0; + req->apdu_request = req->gdu_request->u.z3950; + if (process_z_request(assoc, req, &msg) < 0) + do_close_req(assoc, Z_Close_systemProblem, msg, req); + } + else if (req->gdu_request->which == Z_GDU_HTTP_Request) + process_http_request(assoc, req); + else + { + do_close_req(assoc, Z_Close_systemProblem, "bad protocol packet", req); + } +} + +/* + * Initiate request processing. + */ +static int process_z_request(association *assoc, request *req, char **msg) +{ + int fd = -1; + Z_APDU *res; + int retval; + + *msg = "Unknown Error"; + assert(req && req->state == REQUEST_IDLE); + if (req->apdu_request->which != Z_APDU_initRequest && !assoc->init) + { + *msg = "Missing InitRequest"; + return -1; + } + switch (req->apdu_request->which) + { + case Z_APDU_initRequest: + iochan_settimeout(assoc->client_chan, + statserv_getcontrol()->idle_timeout * 60); + res = process_initRequest(assoc, req); break; + case Z_APDU_searchRequest: + res = process_searchRequest(assoc, req, &fd); break; + case Z_APDU_presentRequest: + res = process_presentRequest(assoc, req, &fd); break; + case Z_APDU_scanRequest: + if (assoc->init->bend_scan) + res = process_scanRequest(assoc, req, &fd); + else + { + *msg = "Cannot handle Scan APDU"; + return -1; + } + break; + case Z_APDU_extendedServicesRequest: + if (assoc->init->bend_esrequest) + res = process_ESRequest(assoc, req, &fd); + else + { + *msg = "Cannot handle Extended Services APDU"; + return -1; + } + break; + case Z_APDU_sortRequest: + if (assoc->init->bend_sort) + res = process_sortRequest(assoc, req, &fd); + else + { + *msg = "Cannot handle Sort APDU"; + return -1; + } + break; + case Z_APDU_close: + process_close(assoc, req); + return 0; + case Z_APDU_deleteResultSetRequest: + if (assoc->init->bend_delete) + res = process_deleteRequest(assoc, req, &fd); + else + { + *msg = "Cannot handle Delete APDU"; + return -1; + } + break; + case Z_APDU_segmentRequest: + if (assoc->init->bend_segment) + { + res = process_segmentRequest (assoc, req); + } + else + { + *msg = "Cannot handle Segment APDU"; + return -1; + } + break; + default: + *msg = "Bad APDU received"; + return -1; + } + if (res) + { + yaz_log(LOG_DEBUG, " result immediately available"); + retval = process_z_response(assoc, req, res); + } + else if (fd < 0) + { + yaz_log(LOG_DEBUG, " result unavailble"); + retval = 0; + } + else /* no result yet - one will be provided later */ + { + IOCHAN chan; + + /* Set up an I/O handler for the fd supplied by the backend */ + + yaz_log(LOG_DEBUG, " establishing handler for result"); + req->state = REQUEST_PENDING; + if (!(chan = iochan_create(fd, backend_response, EVENT_INPUT))) + abort(); + iochan_setdata(chan, assoc); + retval = 0; + } + return retval; +} + +/* + * Handle message from the backend. + */ +void backend_response(IOCHAN i, int event) +{ + association *assoc = (association *)iochan_getdata(i); + request *req = request_head(&assoc->incoming); + Z_APDU *res; + int fd; + + yaz_log(LOG_DEBUG, "backend_response"); + assert(assoc && req && req->state != REQUEST_IDLE); + /* determine what it is we're waiting for */ + switch (req->apdu_request->which) + { + case Z_APDU_searchRequest: + res = response_searchRequest(assoc, req, 0, &fd); break; +#if 0 + case Z_APDU_presentRequest: + res = response_presentRequest(assoc, req, 0, &fd); break; + case Z_APDU_scanRequest: + res = response_scanRequest(assoc, req, 0, &fd); break; +#endif + default: + yaz_log(LOG_WARN, "Serious programmer's lapse or bug"); + abort(); + } + if ((res && process_z_response(assoc, req, res) < 0) || fd < 0) + { + yaz_log(LOG_LOG, "Fatal error when talking to backend"); + do_close(assoc, Z_Close_systemProblem, 0); + iochan_destroy(i); + return; + } + else if (!res) /* no result yet - try again later */ + { + yaz_log(LOG_DEBUG, " no result yet"); + iochan_setfd(i, fd); /* in case fd has changed */ + } +} + +/* + * Encode response, and transfer the request structure to the outgoing queue. + */ +static int process_gdu_response(association *assoc, request *req, Z_GDU *res) +{ + odr_setbuf(assoc->encode, req->response, req->size_response, 1); + + if (assoc->print && !z_GDU(assoc->print, &res, 0, 0)) + { + yaz_log(LOG_WARN, "ODR print error: %s", + odr_errmsg(odr_geterror(assoc->print))); + odr_reset(assoc->print); + } + if (!z_GDU(assoc->encode, &res, 0, 0)) + { + yaz_log(LOG_WARN, "ODR error when encoding PDU: %s [element %s]", + odr_errmsg(odr_geterror(assoc->decode)), + odr_getelement(assoc->decode)); + request_release(req); + return -1; + } + req->response = odr_getbuf(assoc->encode, &req->len_response, + &req->size_response); + odr_setbuf(assoc->encode, 0, 0, 0); /* don'txfree if we abort later */ + odr_reset(assoc->encode); + req->state = REQUEST_IDLE; + request_enq(&assoc->outgoing, req); + /* turn the work over to the ir_session handler */ + iochan_setflag(assoc->client_chan, EVENT_OUTPUT); + assoc->cs_put_mask = EVENT_OUTPUT; + /* Is there more work to be done? give that to the input handler too */ +#if 1 + if (request_head(&assoc->incoming)) + { + yaz_log (LOG_DEBUG, "more work to be done"); + iochan_setevent(assoc->client_chan, EVENT_WORK); + } +#endif + return 0; +} + +/* + * Encode response, and transfer the request structure to the outgoing queue. + */ +static int process_z_response(association *assoc, request *req, Z_APDU *res) +{ + Z_GDU *gres = (Z_GDU *) odr_malloc(assoc->encode, sizeof(*res)); + gres->which = Z_GDU_Z3950; + gres->u.z3950 = res; + + return process_gdu_response(assoc, req, gres); +} + + +/* + * Handle init request. + * At the moment, we don't check the options + * anywhere else in the code - we just try not to do anything that would + * break a naive client. We'll toss 'em into the association block when + * we need them there. + */ +static Z_APDU *process_initRequest(association *assoc, request *reqb) +{ + statserv_options_block *cb = statserv_getcontrol(); + Z_InitRequest *req = reqb->apdu_request->u.initRequest; + Z_APDU *apdu = zget_APDU(assoc->encode, Z_APDU_initResponse); + Z_InitResponse *resp = apdu->u.initResponse; + bend_initresult *binitres; + + char options[140]; + + yaz_log(LOG_LOG, "Got initRequest"); + if (req->implementationId) + yaz_log(LOG_LOG, "Id: %s", req->implementationId); + if (req->implementationName) + yaz_log(LOG_LOG, "Name: %s", req->implementationName); + if (req->implementationVersion) + yaz_log(LOG_LOG, "Version: %s", req->implementationVersion); + + assoc_init_reset(assoc); + + assoc->init->auth = req->idAuthentication; + assoc->init->referenceId = req->referenceId; + + if (ODR_MASK_GET(req->options, Z_Options_negotiationModel)) + { + Z_CharSetandLanguageNegotiation *negotiation = + yaz_get_charneg_record (req->otherInfo); + if (negotiation->which == Z_CharSetandLanguageNegotiation_proposal) + assoc->init->charneg_request = negotiation; + } + + if (!(binitres = (*cb->bend_init)(assoc->init))) + { + yaz_log(LOG_WARN, "Bad response from backend."); + return 0; + } + + assoc->backend = binitres->handle; + if ((assoc->init->bend_sort)) + yaz_log (LOG_DEBUG, "Sort handler installed"); + if ((assoc->init->bend_search)) + yaz_log (LOG_DEBUG, "Search handler installed"); + if ((assoc->init->bend_present)) + yaz_log (LOG_DEBUG, "Present handler installed"); + if ((assoc->init->bend_esrequest)) + yaz_log (LOG_DEBUG, "ESRequest handler installed"); + if ((assoc->init->bend_delete)) + yaz_log (LOG_DEBUG, "Delete handler installed"); + if ((assoc->init->bend_scan)) + yaz_log (LOG_DEBUG, "Scan handler installed"); + if ((assoc->init->bend_segment)) + yaz_log (LOG_DEBUG, "Segment handler installed"); + + resp->referenceId = req->referenceId; + *options = '\0'; + /* let's tell the client what we can do */ + if (ODR_MASK_GET(req->options, Z_Options_search)) + { + ODR_MASK_SET(resp->options, Z_Options_search); + strcat(options, "srch"); + } + if (ODR_MASK_GET(req->options, Z_Options_present)) + { + ODR_MASK_SET(resp->options, Z_Options_present); + strcat(options, " prst"); + } + if (ODR_MASK_GET(req->options, Z_Options_delSet) && + assoc->init->bend_delete) + { + ODR_MASK_SET(resp->options, Z_Options_delSet); + strcat(options, " del"); + } + if (ODR_MASK_GET(req->options, Z_Options_extendedServices) && + assoc->init->bend_esrequest) + { + ODR_MASK_SET(resp->options, Z_Options_extendedServices); + strcat (options, " extendedServices"); + } + if (ODR_MASK_GET(req->options, Z_Options_namedResultSets)) + { + ODR_MASK_SET(resp->options, Z_Options_namedResultSets); + strcat(options, " namedresults"); + } + if (ODR_MASK_GET(req->options, Z_Options_scan) && assoc->init->bend_scan) + { + ODR_MASK_SET(resp->options, Z_Options_scan); + strcat(options, " scan"); + } + if (ODR_MASK_GET(req->options, Z_Options_concurrentOperations)) + { + ODR_MASK_SET(resp->options, Z_Options_concurrentOperations); + strcat(options, " concurrop"); + } + if (ODR_MASK_GET(req->options, Z_Options_sort) && assoc->init->bend_sort) + { + ODR_MASK_SET(resp->options, Z_Options_sort); + strcat(options, " sort"); + } + + if (ODR_MASK_GET(req->options, Z_Options_negotiationModel) + && assoc->init->charneg_response) + { + Z_OtherInformation **p; + Z_OtherInformationUnit *p0; + + yaz_oi_APDU(apdu, &p); + + if ((p0=yaz_oi_update(p, assoc->encode, NULL, 0, 0))) { + ODR_MASK_SET(resp->options, Z_Options_negotiationModel); + + p0->which = Z_OtherInfo_externallyDefinedInfo; + p0->information.externallyDefinedInfo = + assoc->init->charneg_response; + } + ODR_MASK_SET(resp->options, Z_Options_negotiationModel); + strcat(options, " negotiation"); + } + + if (ODR_MASK_GET(req->protocolVersion, Z_ProtocolVersion_1)) + { + ODR_MASK_SET(resp->protocolVersion, Z_ProtocolVersion_1); + assoc->version = 2; /* 1 & 2 are equivalent */ + } + if (ODR_MASK_GET(req->protocolVersion, Z_ProtocolVersion_2)) + { + ODR_MASK_SET(resp->protocolVersion, Z_ProtocolVersion_2); + assoc->version = 2; + } + if (ODR_MASK_GET(req->protocolVersion, Z_ProtocolVersion_3)) + { + ODR_MASK_SET(resp->protocolVersion, Z_ProtocolVersion_3); + assoc->version = 3; + } + + yaz_log(LOG_LOG, "Negotiated to v%d: %s", assoc->version, options); + assoc->maximumRecordSize = *req->maximumRecordSize; + if (assoc->maximumRecordSize > control_block->maxrecordsize) + assoc->maximumRecordSize = control_block->maxrecordsize; + assoc->preferredMessageSize = *req->preferredMessageSize; + if (assoc->preferredMessageSize > assoc->maximumRecordSize) + assoc->preferredMessageSize = assoc->maximumRecordSize; + + resp->preferredMessageSize = &assoc->preferredMessageSize; + resp->maximumRecordSize = &assoc->maximumRecordSize; + + resp->implementationName = "GFS/YAZ"; + + if (assoc->init->implementation_id) + { + char *nv = (char *) + odr_malloc (assoc->encode, + strlen(assoc->init->implementation_id) + 10 + + strlen(resp->implementationId)); + sprintf (nv, "%s / %s", + resp->implementationId, assoc->init->implementation_id); + resp->implementationId = nv; + } + if (assoc->init->implementation_name) + { + char *nv = (char *) + odr_malloc (assoc->encode, + strlen(assoc->init->implementation_name) + 10 + + strlen(resp->implementationName)); + sprintf (nv, "%s / %s", + resp->implementationName, assoc->init->implementation_name); + resp->implementationName = nv; + } + if (assoc->init->implementation_version) + { + char *nv = (char *) + odr_malloc (assoc->encode, + strlen(assoc->init->implementation_version) + 10 + + strlen(resp->implementationVersion)); + sprintf (nv, "YAZ %s / %s", + resp->implementationVersion, + assoc->init->implementation_version); + resp->implementationVersion = nv; + } + + if (binitres->errcode) + { + yaz_log(LOG_LOG, "Connection rejected by backend."); + *resp->result = 0; + assoc->state = ASSOC_DEAD; + resp->userInformationField = init_diagnostics(assoc->encode, + binitres->errcode, + binitres->errstring); + } + else + assoc->state = ASSOC_UP; + return apdu; +} + +/* + * Diagnostic in default format, to be returned as either a surrogate + * or non-surrogate diagnostic in the context of an open session, or + * as User-information when an Init is refused. + */ +static Z_DefaultDiagFormat *justdiag(ODR odr, int error, char *addinfo) +{ + int *err = odr_intdup(odr, error); + Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *) + odr_malloc (odr, sizeof(*dr)); + + yaz_log(LOG_LOG, "[%d] %s%s%s", error, diagbib1_str(error), + addinfo ? " -- " : "", addinfo ? addinfo : ""); + + dr->diagnosticSetId = + yaz_oidval_to_z3950oid (odr, CLASS_DIAGSET, VAL_BIB1); + dr->condition = err; + dr->which = Z_DefaultDiagFormat_v2Addinfo; + dr->u.v2Addinfo = odr_strdup (odr, addinfo ? addinfo : ""); + return dr; +} + +/* + * Set the specified `errcode' and `errstring' into a UserInfo-1 + * external to be returned to the client in accordance with Z35.90 + * Implementor Agreement 5 (Returning diagnostics in an InitResponse): + * http://lcweb.loc.gov/z3950/agency/agree/initdiag.html + */ +static Z_External *init_diagnostics(ODR odr, int error, char *addinfo) +{ + Z_External *x, *x2; + oident oid; + Z_OtherInformation *u; + Z_OtherInformationUnit *l; + Z_DiagnosticFormat *d; + Z_DiagnosticFormat_s *e; + + x = (Z_External*) odr_malloc(odr, sizeof *x); + x->descriptor = 0; + x->indirect_reference = 0; + oid.proto = PROTO_Z3950; + oid.oclass = CLASS_USERINFO; + oid.value = VAL_USERINFO1; + x->direct_reference = odr_oiddup(odr, oid_getoidbyent(&oid)); + x->which = Z_External_userInfo1; + + u = odr_malloc(odr, sizeof *u); + x->u.userInfo1 = u; + u->num_elements = 1; + u->list = (Z_OtherInformationUnit**) odr_malloc(odr, sizeof *u->list); + u->list[0] = (Z_OtherInformationUnit*) odr_malloc(odr, sizeof *u->list[0]); + l = u->list[0]; + l->category = 0; + l->which = Z_OtherInfo_externallyDefinedInfo; + + x2 = (Z_External*) odr_malloc(odr, sizeof *x); + l->information.externallyDefinedInfo = x2; + x2->descriptor = 0; + x2->indirect_reference = 0; + oid.oclass = CLASS_DIAGSET; + oid.value = VAL_DIAG1; + x2->direct_reference = odr_oiddup(odr, oid_getoidbyent(&oid)); + x2->which = Z_External_diag1; + + d = (Z_DiagnosticFormat*) odr_malloc(odr, sizeof *d); + x2->u.diag1 = d; + d->num = 1; + d->elements = (Z_DiagnosticFormat_s**) odr_malloc (odr, sizeof *d->elements); + d->elements[0] = (Z_DiagnosticFormat_s*) odr_malloc (odr, sizeof *d->elements[0]); + e = d->elements[0]; + + e->which = Z_DiagnosticFormat_s_defaultDiagRec; + e->u.defaultDiagRec = justdiag(odr, error, addinfo); + return x; +} + +/* + * nonsurrogate diagnostic record. + */ +static Z_Records *diagrec(association *assoc, int error, char *addinfo) +{ + Z_Records *rec = (Z_Records *) + odr_malloc (assoc->encode, sizeof(*rec)); + rec->which = Z_Records_NSD; + rec->u.nonSurrogateDiagnostic = justdiag(assoc->encode, error, addinfo); + return rec; +} + +/* + * surrogate diagnostic. + */ +static Z_NamePlusRecord *surrogatediagrec(association *assoc, char *dbname, + int error, char *addinfo) +{ + Z_NamePlusRecord *rec = (Z_NamePlusRecord *) + odr_malloc (assoc->encode, sizeof(*rec)); + Z_DiagRec *drec = (Z_DiagRec *)odr_malloc (assoc->encode, sizeof(*drec)); + + yaz_log(LOG_DEBUG, "SurrogateDiagnotic: %d -- %s", error, addinfo); + rec->databaseName = dbname; + rec->which = Z_NamePlusRecord_surrogateDiagnostic; + rec->u.surrogateDiagnostic = drec; + drec->which = Z_DiagRec_defaultFormat; + drec->u.defaultFormat = justdiag(assoc->encode, error, addinfo); + + return rec; +} + +/* + * multiple nonsurrogate diagnostics. + */ +static Z_DiagRecs *diagrecs(association *assoc, int error, char *addinfo) +{ + Z_DiagRecs *recs = (Z_DiagRecs *)odr_malloc (assoc->encode, sizeof(*recs)); + int *err = odr_intdup(assoc->encode, error); + Z_DiagRec **recp = (Z_DiagRec **)odr_malloc (assoc->encode, sizeof(*recp)); + Z_DiagRec *drec = (Z_DiagRec *)odr_malloc (assoc->encode, sizeof(*drec)); + Z_DefaultDiagFormat *rec = (Z_DefaultDiagFormat *) + odr_malloc (assoc->encode, sizeof(*rec)); + + yaz_log(LOG_DEBUG, "DiagRecs: %d -- %s", error, addinfo ? addinfo : ""); + + recs->num_diagRecs = 1; + recs->diagRecs = recp; + recp[0] = drec; + drec->which = Z_DiagRec_defaultFormat; + drec->u.defaultFormat = rec; + + rec->diagnosticSetId = + yaz_oidval_to_z3950oid (assoc->encode, CLASS_DIAGSET, VAL_BIB1); + rec->condition = err; + + rec->which = Z_DefaultDiagFormat_v2Addinfo; + rec->u.v2Addinfo = odr_strdup (assoc->encode, addinfo ? addinfo : ""); + return recs; +} + +static Z_Records *pack_records(association *a, char *setname, int start, + int *num, Z_RecordComposition *comp, + int *next, int *pres, oid_value format, + Z_ReferenceId *referenceId, + int *oid) +{ + int recno, total_length = 0, toget = *num, dumped_records = 0; + Z_Records *records = + (Z_Records *) odr_malloc (a->encode, sizeof(*records)); + Z_NamePlusRecordList *reclist = + (Z_NamePlusRecordList *) odr_malloc (a->encode, sizeof(*reclist)); + Z_NamePlusRecord **list = + (Z_NamePlusRecord **) odr_malloc (a->encode, sizeof(*list) * toget); + + records->which = Z_Records_DBOSD; + records->u.databaseOrSurDiagnostics = reclist; + reclist->num_records = 0; + reclist->records = list; + *pres = Z_PRES_SUCCESS; + *num = 0; + *next = 0; + + yaz_log(LOG_LOG, "Request to pack %d+%d+%s", start, toget, setname); + yaz_log(LOG_DEBUG, "pms=%d, mrs=%d", a->preferredMessageSize, + a->maximumRecordSize); + for (recno = start; reclist->num_records < toget; recno++) + { + bend_fetch_rr freq; + Z_NamePlusRecord *thisrec; + int this_length = 0; + /* + * we get the number of bytes allocated on the stream before any + * allocation done by the backend - this should give us a reasonable + * idea of the total size of the data so far. + */ + total_length = odr_total(a->encode) - dumped_records; + freq.errcode = 0; + freq.errstring = 0; + freq.basename = 0; + freq.len = 0; + freq.record = 0; + freq.last_in_set = 0; + freq.setname = setname; + freq.surrogate_flag = 0; + freq.number = recno; + freq.comp = comp; + freq.request_format = format; + freq.request_format_raw = oid; + freq.output_format = format; + freq.output_format_raw = 0; + freq.stream = a->encode; + freq.print = a->print; + freq.referenceId = referenceId; + freq.schema = 0; + (*a->init->bend_fetch)(a->backend, &freq); + /* backend should be able to signal whether error is system-wide + or only pertaining to current record */ + if (freq.errcode) + { + if (!freq.surrogate_flag) + { + char s[20]; + *pres = Z_PRES_FAILURE; + /* for 'present request out of range', + set addinfo to record position if not set */ + if (freq.errcode == 13 && freq.errstring == 0) + { + sprintf (s, "%d", recno); + freq.errstring = s; + } + return diagrec(a, freq.errcode, freq.errstring); + } + reclist->records[reclist->num_records] = + surrogatediagrec(a, freq.basename, freq.errcode, + freq.errstring); + reclist->num_records++; + *next = freq.last_in_set ? 0 : recno + 1; + continue; + } + if (freq.len >= 0) + this_length = freq.len; + else + this_length = odr_total(a->encode) - total_length; + yaz_log(LOG_DEBUG, " fetched record, len=%d, total=%d", + this_length, total_length); + if (this_length + total_length > a->preferredMessageSize) + { + /* record is small enough, really */ + if (this_length <= a->preferredMessageSize) + { + yaz_log(LOG_DEBUG, " Dropped last normal-sized record"); + *pres = Z_PRES_PARTIAL_2; + break; + } + /* record can only be fetched by itself */ + if (this_length < a->maximumRecordSize) + { + yaz_log(LOG_DEBUG, " Record > prefmsgsz"); + if (toget > 1) + { + yaz_log(LOG_DEBUG, " Dropped it"); + reclist->records[reclist->num_records] = + surrogatediagrec(a, freq.basename, 16, 0); + reclist->num_records++; + *next = freq.last_in_set ? 0 : recno + 1; + dumped_records += this_length; + continue; + } + } + else /* too big entirely */ + { + yaz_log(LOG_LOG, "Record > maxrcdsz this=%d max=%d", this_length, a->maximumRecordSize); + reclist->records[reclist->num_records] = + surrogatediagrec(a, freq.basename, 17, 0); + reclist->num_records++; + *next = freq.last_in_set ? 0 : recno + 1; + dumped_records += this_length; + continue; + } + } + + if (!(thisrec = (Z_NamePlusRecord *) + odr_malloc(a->encode, sizeof(*thisrec)))) + return 0; + if (!(thisrec->databaseName = (char *)odr_malloc(a->encode, + strlen(freq.basename) + 1))) + return 0; + strcpy(thisrec->databaseName, freq.basename); + thisrec->which = Z_NamePlusRecord_databaseRecord; + + if (freq.output_format_raw) + { + struct oident *ident = oid_getentbyoid(freq.output_format_raw); + freq.output_format = ident->value; + } + thisrec->u.databaseRecord = z_ext_record(a->encode, freq.output_format, + freq.record, freq.len); + if (!thisrec->u.databaseRecord) + return 0; + reclist->records[reclist->num_records] = thisrec; + reclist->num_records++; + *next = freq.last_in_set ? 0 : recno + 1; + } + *num = reclist->num_records; + return records; +} + +static Z_APDU *process_searchRequest(association *assoc, request *reqb, + int *fd) +{ + Z_SearchRequest *req = reqb->apdu_request->u.searchRequest; + bend_search_rr *bsrr = + (bend_search_rr *)nmem_malloc (reqb->request_mem, sizeof(*bsrr)); + + yaz_log(LOG_LOG, "Got SearchRequest."); + bsrr->fd = fd; + bsrr->request = reqb; + bsrr->association = assoc; + bsrr->referenceId = req->referenceId; + save_referenceId (reqb, bsrr->referenceId); + + yaz_log (LOG_LOG, "ResultSet '%s'", req->resultSetName); + if (req->databaseNames) + { + int i; + for (i = 0; i < req->num_databaseNames; i++) + yaz_log (LOG_LOG, "Database '%s'", req->databaseNames[i]); + } + yaz_log_zquery(req->query); + + if (assoc->init->bend_search) + { + bsrr->setname = req->resultSetName; + bsrr->replace_set = *req->replaceIndicator; + bsrr->num_bases = req->num_databaseNames; + bsrr->basenames = req->databaseNames; + bsrr->query = req->query; + bsrr->stream = assoc->encode; + bsrr->decode = assoc->decode; + bsrr->print = assoc->print; + bsrr->errcode = 0; + bsrr->hits = 0; + bsrr->errstring = NULL; + bsrr->search_info = NULL; + (assoc->init->bend_search)(assoc->backend, bsrr); + if (!bsrr->request) + return 0; + } + return response_searchRequest(assoc, reqb, bsrr, fd); +} + +int bend_searchresponse(void *handle, bend_search_rr *bsrr) {return 0;} + +/* + * Prepare a searchresponse based on the backend results. We probably want + * to look at making the fetching of records nonblocking as well, but + * so far, we'll keep things simple. + * If bsrt is null, that means we're called in response to a communications + * event, and we'll have to get the response for ourselves. + */ +static Z_APDU *response_searchRequest(association *assoc, request *reqb, + bend_search_rr *bsrt, int *fd) +{ + Z_SearchRequest *req = reqb->apdu_request->u.searchRequest; + Z_APDU *apdu = (Z_APDU *)odr_malloc (assoc->encode, sizeof(*apdu)); + Z_SearchResponse *resp = (Z_SearchResponse *) + odr_malloc (assoc->encode, sizeof(*resp)); + int *nulint = odr_intdup (assoc->encode, 0); + bool_t *sr = odr_intdup(assoc->encode, 1); + int *next = odr_intdup(assoc->encode, 0); + int *none = odr_intdup(assoc->encode, Z_RES_NONE); + + apdu->which = Z_APDU_searchResponse; + apdu->u.searchResponse = resp; + resp->referenceId = req->referenceId; + resp->additionalSearchInfo = 0; + resp->otherInfo = 0; + *fd = -1; + if (!bsrt && !bend_searchresponse(assoc->backend, bsrt)) + { + yaz_log(LOG_FATAL, "Bad result from backend"); + return 0; + } + else if (bsrt->errcode) + { + resp->records = diagrec(assoc, bsrt->errcode, bsrt->errstring); + resp->resultCount = nulint; + resp->numberOfRecordsReturned = nulint; + resp->nextResultSetPosition = nulint; + resp->searchStatus = nulint; + resp->resultSetStatus = none; + resp->presentStatus = 0; + } + else + { + int *toget = odr_intdup(assoc->encode, 0); + int *presst = odr_intdup(assoc->encode, 0); + Z_RecordComposition comp, *compp = 0; + + yaz_log (LOG_LOG, "resultCount: %d", bsrt->hits); + + resp->records = 0; + resp->resultCount = &bsrt->hits; + + comp.which = Z_RecordComp_simple; + /* how many records does the user agent want, then? */ + if (bsrt->hits <= *req->smallSetUpperBound) + { + *toget = bsrt->hits; + if ((comp.u.simple = req->smallSetElementSetNames)) + compp = ∁ + } + else if (bsrt->hits < *req->largeSetLowerBound) + { + *toget = *req->mediumSetPresentNumber; + if (*toget > bsrt->hits) + *toget = bsrt->hits; + if ((comp.u.simple = req->mediumSetElementSetNames)) + compp = ∁ + } + else + *toget = 0; + + if (*toget && !resp->records) + { + oident *prefformat; + oid_value form; + + if (!(prefformat = oid_getentbyoid(req->preferredRecordSyntax))) + form = VAL_NONE; + else + form = prefformat->value; + resp->records = pack_records(assoc, req->resultSetName, 1, + toget, compp, next, presst, form, req->referenceId, + req->preferredRecordSyntax); + if (!resp->records) + return 0; + resp->numberOfRecordsReturned = toget; + resp->nextResultSetPosition = next; + resp->searchStatus = sr; + resp->resultSetStatus = 0; + resp->presentStatus = presst; + } + else + { + if (*resp->resultCount) + *next = 1; + resp->numberOfRecordsReturned = nulint; + resp->nextResultSetPosition = next; + resp->searchStatus = sr; + resp->resultSetStatus = 0; + resp->presentStatus = 0; + } + } + resp->additionalSearchInfo = bsrt->search_info; + return apdu; +} + +/* + * Maybe we got a little over-friendly when we designed bend_fetch to + * get only one record at a time. Some backends can optimise multiple-record + * fetches, and at any rate, there is some overhead involved in + * all that selecting and hopping around. Problem is, of course, that the + * frontend can't know ahead of time how many records it'll need to + * fill the negotiated PDU size. Annoying. Segmentation or not, Z/SR + * is downright lousy as a bulk data transfer protocol. + * + * To start with, we'll do the fetching of records from the backend + * in one operation: To save some trips in and out of the event-handler, + * and to simplify the interface to pack_records. At any rate, asynch + * operation is more fun in operations that have an unpredictable execution + * speed - which is normally more true for search than for present. + */ +static Z_APDU *process_presentRequest(association *assoc, request *reqb, + int *fd) +{ + Z_PresentRequest *req = reqb->apdu_request->u.presentRequest; + oident *prefformat; + oid_value form; + Z_APDU *apdu; + Z_PresentResponse *resp; + int *next; + int *num; + + yaz_log(LOG_LOG, "Got PresentRequest."); + + if (!(prefformat = oid_getentbyoid(req->preferredRecordSyntax))) + form = VAL_NONE; + else + form = prefformat->value; + resp = (Z_PresentResponse *)odr_malloc (assoc->encode, sizeof(*resp)); + resp->records = 0; + resp->presentStatus = odr_intdup(assoc->encode, 0); + if (assoc->init->bend_present) + { + bend_present_rr *bprr = (bend_present_rr *) + nmem_malloc (reqb->request_mem, sizeof(*bprr)); + bprr->setname = req->resultSetId; + bprr->start = *req->resultSetStartPoint; + bprr->number = *req->numberOfRecordsRequested; + bprr->format = form; + bprr->comp = req->recordComposition; + bprr->referenceId = req->referenceId; + bprr->stream = assoc->encode; + bprr->print = assoc->print; + bprr->request = reqb; + bprr->association = assoc; + bprr->errcode = 0; + bprr->errstring = NULL; + (*assoc->init->bend_present)(assoc->backend, bprr); + + if (!bprr->request) + return 0; + if (bprr->errcode) + { + resp->records = diagrec(assoc, bprr->errcode, bprr->errstring); + *resp->presentStatus = Z_PRES_FAILURE; + } + } + apdu = (Z_APDU *)odr_malloc (assoc->encode, sizeof(*apdu)); + next = odr_intdup(assoc->encode, 0); + num = odr_intdup(assoc->encode, 0); + + apdu->which = Z_APDU_presentResponse; + apdu->u.presentResponse = resp; + resp->referenceId = req->referenceId; + resp->otherInfo = 0; + + if (!resp->records) + { + *num = *req->numberOfRecordsRequested; + resp->records = + pack_records(assoc, req->resultSetId, *req->resultSetStartPoint, + num, req->recordComposition, next, resp->presentStatus, + form, req->referenceId, req->preferredRecordSyntax); + } + if (!resp->records) + return 0; + resp->numberOfRecordsReturned = num; + resp->nextResultSetPosition = next; + + return apdu; +} + +/* + * Scan was implemented rather in a hurry, and with support for only the basic + * elements of the service in the backend API. Suggestions are welcome. + */ +static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd) +{ + Z_ScanRequest *req = reqb->apdu_request->u.scanRequest; + Z_APDU *apdu = (Z_APDU *)odr_malloc (assoc->encode, sizeof(*apdu)); + Z_ScanResponse *res = (Z_ScanResponse *) + odr_malloc (assoc->encode, sizeof(*res)); + int *scanStatus = odr_intdup(assoc->encode, Z_Scan_failure); + int *numberOfEntriesReturned = odr_intdup(assoc->encode, 0); + Z_ListEntries *ents = (Z_ListEntries *) + odr_malloc (assoc->encode, sizeof(*ents)); + Z_DiagRecs *diagrecs_p = NULL; + oident *attset; + bend_scan_rr *bsrr = (bend_scan_rr *) + odr_malloc (assoc->encode, sizeof(*bsrr)); + struct scan_entry *save_entries; + + yaz_log(LOG_LOG, "Got ScanRequest"); + + apdu->which = Z_APDU_scanResponse; + apdu->u.scanResponse = res; + res->referenceId = req->referenceId; + + /* if step is absent, set it to 0 */ + res->stepSize = odr_intdup(assoc->encode, 0); + if (req->stepSize) + *res->stepSize = *req->stepSize; + + res->scanStatus = scanStatus; + res->numberOfEntriesReturned = numberOfEntriesReturned; + res->positionOfTerm = 0; + res->entries = ents; + ents->num_entries = 0; + ents->entries = NULL; + ents->num_nonsurrogateDiagnostics = 0; + ents->nonsurrogateDiagnostics = NULL; + res->attributeSet = 0; + res->otherInfo = 0; + + if (req->databaseNames) + { + int i; + for (i = 0; i < req->num_databaseNames; i++) + yaz_log (LOG_LOG, "Database '%s'", req->databaseNames[i]); + } + bsrr->num_bases = req->num_databaseNames; + bsrr->basenames = req->databaseNames; + bsrr->num_entries = *req->numberOfTermsRequested; + bsrr->term = req->termListAndStartPoint; + bsrr->referenceId = req->referenceId; + bsrr->stream = assoc->encode; + bsrr->print = assoc->print; + bsrr->step_size = res->stepSize; + bsrr->entries = 0; + /* Note that version 2.0 of YAZ and older did not set entries .. + We do now. And when we do it's easier to extend the scan entry + We know that if the scan handler did set entries, it will + not know of new member display_term. + */ + if (bsrr->num_entries > 0) + { + int i; + bsrr->entries = odr_malloc(assoc->decode, sizeof(*bsrr->entries) * + bsrr->num_entries); + for (i = 0; inum_entries; i++) + { + bsrr->entries[i].term = 0; + bsrr->entries[i].occurrences = 0; + bsrr->entries[i].errcode = 0; + bsrr->entries[i].errstring = 0; + bsrr->entries[i].display_term = 0; + } + } + save_entries = bsrr->entries; /* save it so we can compare later */ + + if (req->attributeSet && + (attset = oid_getentbyoid(req->attributeSet)) && + (attset->oclass == CLASS_ATTSET || attset->oclass == CLASS_GENERAL)) + bsrr->attributeset = attset->value; + else + bsrr->attributeset = VAL_NONE; + log_scan_term (req->termListAndStartPoint, bsrr->attributeset); + bsrr->term_position = req->preferredPositionInResponse ? + *req->preferredPositionInResponse : 1; + ((int (*)(void *, bend_scan_rr *)) + (*assoc->init->bend_scan))(assoc->backend, bsrr); + if (bsrr->errcode) + diagrecs_p = diagrecs(assoc, bsrr->errcode, bsrr->errstring); + else + { + int i; + Z_Entry **tab = (Z_Entry **) + odr_malloc (assoc->encode, sizeof(*tab) * bsrr->num_entries); + + if (bsrr->status == BEND_SCAN_PARTIAL) + *scanStatus = Z_Scan_partial_5; + else + *scanStatus = Z_Scan_success; + ents->entries = tab; + ents->num_entries = bsrr->num_entries; + res->numberOfEntriesReturned = &ents->num_entries; + res->positionOfTerm = &bsrr->term_position; + for (i = 0; i < bsrr->num_entries; i++) + { + Z_Entry *e; + Z_TermInfo *t; + Odr_oct *o; + + tab[i] = e = (Z_Entry *)odr_malloc(assoc->encode, sizeof(*e)); + if (bsrr->entries[i].occurrences >= 0) + { + e->which = Z_Entry_termInfo; + e->u.termInfo = t = (Z_TermInfo *) + odr_malloc(assoc->encode, sizeof(*t)); + t->suggestedAttributes = 0; + t->displayTerm = 0; + if (save_entries == bsrr->entries && + bsrr->entries[i].display_term) + { + /* the entries was NOT set by the handler. So it's + safe to test for new member display_term. It is + NULL'ed by us. + */ + t->displayTerm = odr_strdup(assoc->encode, + bsrr->entries[i].display_term); + } + t->alternativeTerm = 0; + t->byAttributes = 0; + t->otherTermInfo = 0; + t->globalOccurrences = &bsrr->entries[i].occurrences; + t->term = (Z_Term *) + odr_malloc(assoc->encode, sizeof(*t->term)); + t->term->which = Z_Term_general; + t->term->u.general = o = + (Odr_oct *)odr_malloc(assoc->encode, sizeof(Odr_oct)); + o->buf = (unsigned char *) + odr_malloc(assoc->encode, o->len = o->size = + strlen(bsrr->entries[i].term)); + memcpy(o->buf, bsrr->entries[i].term, o->len); + yaz_log(LOG_DEBUG, " term #%d: '%s' (%d)", i, + bsrr->entries[i].term, bsrr->entries[i].occurrences); + } + else + { + Z_DiagRecs *drecs = diagrecs (assoc, + bsrr->entries[i].errcode, + bsrr->entries[i].errstring); + assert (drecs->num_diagRecs == 1); + e->which = Z_Entry_surrogateDiagnostic; + assert (drecs->diagRecs[0]); + e->u.surrogateDiagnostic = drecs->diagRecs[0]; + } + } + } + if (diagrecs_p) + { + ents->num_nonsurrogateDiagnostics = diagrecs_p->num_diagRecs; + ents->nonsurrogateDiagnostics = diagrecs_p->diagRecs; + } + return apdu; +} + +static Z_APDU *process_sortRequest(association *assoc, request *reqb, + int *fd) +{ + Z_SortRequest *req = reqb->apdu_request->u.sortRequest; + Z_SortResponse *res = (Z_SortResponse *) + odr_malloc (assoc->encode, sizeof(*res)); + bend_sort_rr *bsrr = (bend_sort_rr *) + odr_malloc (assoc->encode, sizeof(*bsrr)); + + Z_APDU *apdu = (Z_APDU *)odr_malloc (assoc->encode, sizeof(*apdu)); + + yaz_log(LOG_LOG, "Got SortRequest."); + + bsrr->num_input_setnames = req->num_inputResultSetNames; + bsrr->input_setnames = req->inputResultSetNames; + bsrr->referenceId = req->referenceId; + bsrr->output_setname = req->sortedResultSetName; + bsrr->sort_sequence = req->sortSequence; + bsrr->stream = assoc->encode; + bsrr->print = assoc->print; + + bsrr->sort_status = Z_SortStatus_failure; + bsrr->errcode = 0; + bsrr->errstring = 0; + + (*assoc->init->bend_sort)(assoc->backend, bsrr); + + res->referenceId = bsrr->referenceId; + res->sortStatus = odr_intdup(assoc->encode, bsrr->sort_status); + res->resultSetStatus = 0; + if (bsrr->errcode) + { + Z_DiagRecs *dr = diagrecs (assoc, bsrr->errcode, bsrr->errstring); + res->diagnostics = dr->diagRecs; + res->num_diagnostics = dr->num_diagRecs; + } + else + { + res->num_diagnostics = 0; + res->diagnostics = 0; + } + res->resultCount = 0; + res->otherInfo = 0; + + apdu->which = Z_APDU_sortResponse; + apdu->u.sortResponse = res; + return apdu; +} + +static Z_APDU *process_deleteRequest(association *assoc, request *reqb, + int *fd) +{ + Z_DeleteResultSetRequest *req = + reqb->apdu_request->u.deleteResultSetRequest; + Z_DeleteResultSetResponse *res = (Z_DeleteResultSetResponse *) + odr_malloc (assoc->encode, sizeof(*res)); + bend_delete_rr *bdrr = (bend_delete_rr *) + odr_malloc (assoc->encode, sizeof(*bdrr)); + Z_APDU *apdu = (Z_APDU *)odr_malloc (assoc->encode, sizeof(*apdu)); + + yaz_log(LOG_LOG, "Got DeleteRequest."); + + bdrr->num_setnames = req->num_resultSetList; + bdrr->setnames = req->resultSetList; + bdrr->stream = assoc->encode; + bdrr->print = assoc->print; + bdrr->function = *req->deleteFunction; + bdrr->referenceId = req->referenceId; + bdrr->statuses = 0; + if (bdrr->num_setnames > 0) + { + int i; + bdrr->statuses = (int*) + odr_malloc(assoc->encode, sizeof(*bdrr->statuses) * + bdrr->num_setnames); + for (i = 0; i < bdrr->num_setnames; i++) + bdrr->statuses[i] = 0; + } + (*assoc->init->bend_delete)(assoc->backend, bdrr); + + res->referenceId = req->referenceId; + + res->deleteOperationStatus = odr_intdup(assoc->encode,bdrr->delete_status); + + res->deleteListStatuses = 0; + if (bdrr->num_setnames > 0) + { + int i; + res->deleteListStatuses = (Z_ListStatuses *) + odr_malloc(assoc->encode, sizeof(*res->deleteListStatuses)); + res->deleteListStatuses->num = bdrr->num_setnames; + res->deleteListStatuses->elements = + (Z_ListStatus **) + odr_malloc (assoc->encode, + sizeof(*res->deleteListStatuses->elements) * + bdrr->num_setnames); + for (i = 0; inum_setnames; i++) + { + res->deleteListStatuses->elements[i] = + (Z_ListStatus *) + odr_malloc (assoc->encode, + sizeof(**res->deleteListStatuses->elements)); + res->deleteListStatuses->elements[i]->status = bdrr->statuses+i; + res->deleteListStatuses->elements[i]->id = + odr_strdup (assoc->encode, bdrr->setnames[i]); + + } + } + res->numberNotDeleted = 0; + res->bulkStatuses = 0; + res->deleteMessage = 0; + res->otherInfo = 0; + + apdu->which = Z_APDU_deleteResultSetResponse; + apdu->u.deleteResultSetResponse = res; + return apdu; +} + +static void process_close(association *assoc, request *reqb) +{ + Z_Close *req = reqb->apdu_request->u.close; + static char *reasons[] = + { + "finished", + "shutdown", + "systemProblem", + "costLimit", + "resources", + "securityViolation", + "protocolError", + "lackOfActivity", + "peerAbort", + "unspecified" + }; + + yaz_log(LOG_LOG, "Got Close, reason %s, message %s", + reasons[*req->closeReason], req->diagnosticInformation ? + req->diagnosticInformation : "NULL"); + if (assoc->version < 3) /* to make do_force respond with close */ + assoc->version = 3; + do_close_req(assoc, Z_Close_finished, + "Association terminated by client", reqb); +} + +void save_referenceId (request *reqb, Z_ReferenceId *refid) +{ + if (refid) + { + reqb->len_refid = refid->len; + reqb->refid = (char *)nmem_malloc (reqb->request_mem, refid->len); + memcpy (reqb->refid, refid->buf, refid->len); + } + else + { + reqb->len_refid = 0; + reqb->refid = NULL; + } +} + +void bend_request_send (bend_association a, bend_request req, Z_APDU *res) +{ + process_z_response (a, req, res); +} + +bend_request bend_request_mk (bend_association a) +{ + request *nreq = request_get (&a->outgoing); + nreq->request_mem = nmem_create (); + return nreq; +} + +Z_ReferenceId *bend_request_getid (ODR odr, bend_request req) +{ + Z_ReferenceId *id; + if (!req->refid) + return 0; + id = (Odr_oct *)odr_malloc (odr, sizeof(*odr)); + id->buf = (unsigned char *)odr_malloc (odr, req->len_refid); + id->len = id->size = req->len_refid; + memcpy (id->buf, req->refid, req->len_refid); + return id; +} + +void bend_request_destroy (bend_request *req) +{ + nmem_destroy((*req)->request_mem); + request_release(*req); + *req = NULL; +} + +int bend_backend_respond (bend_association a, bend_request req) +{ + char *msg; + int r; + r = process_z_request (a, req, &msg); + if (r < 0) + yaz_log (LOG_WARN, "%s", msg); + return r; +} + +void bend_request_setdata(bend_request r, void *p) +{ + r->clientData = p; +} + +void *bend_request_getdata(bend_request r) +{ + return r->clientData; +} + +static Z_APDU *process_segmentRequest (association *assoc, request *reqb) +{ + bend_segment_rr req; + + req.segment = reqb->apdu_request->u.segmentRequest; + req.stream = assoc->encode; + req.decode = assoc->decode; + req.print = assoc->print; + req.association = assoc; + + (*assoc->init->bend_segment)(assoc->backend, &req); + + return 0; +} + +static Z_APDU *process_ESRequest(association *assoc, request *reqb, int *fd) +{ + bend_esrequest_rr esrequest; + + Z_ExtendedServicesRequest *req = + reqb->apdu_request->u.extendedServicesRequest; + Z_APDU *apdu = zget_APDU(assoc->encode, Z_APDU_extendedServicesResponse); + + Z_ExtendedServicesResponse *resp = apdu->u.extendedServicesResponse; + + yaz_log(LOG_DEBUG,"inside Process esRequest"); + + esrequest.esr = reqb->apdu_request->u.extendedServicesRequest; + esrequest.stream = assoc->encode; + esrequest.decode = assoc->decode; + esrequest.print = assoc->print; + esrequest.errcode = 0; + esrequest.errstring = NULL; + esrequest.request = reqb; + esrequest.association = assoc; + esrequest.taskPackage = 0; + esrequest.referenceId = req->referenceId; + + (*assoc->init->bend_esrequest)(assoc->backend, &esrequest); + + /* If the response is being delayed, return NULL */ + if (esrequest.request == NULL) + return(NULL); + + resp->referenceId = req->referenceId; + + if (esrequest.errcode == -1) + { + /* Backend service indicates request will be processed */ + yaz_log(LOG_DEBUG,"Request could be processed...Accepted !"); + *resp->operationStatus = Z_ExtendedServicesResponse_accepted; + } + else if (esrequest.errcode == 0) + { + /* Backend service indicates request will be processed */ + yaz_log(LOG_DEBUG,"Request could be processed...Done !"); + *resp->operationStatus = Z_ExtendedServicesResponse_done; + } + else + { + Z_DiagRecs *diagRecs = diagrecs (assoc, esrequest.errcode, + esrequest.errstring); + + /* Backend indicates error, request will not be processed */ + yaz_log(LOG_DEBUG,"Request could not be processed...failure !"); + *resp->operationStatus = Z_ExtendedServicesResponse_failure; + resp->num_diagnostics = diagRecs->num_diagRecs; + resp->diagnostics = diagRecs->diagRecs; + } + /* Do something with the members of bend_extendedservice */ + if (esrequest.taskPackage) + resp->taskPackage = z_ext_record (assoc->encode, VAL_EXTENDED, + (const char *) esrequest.taskPackage, + -1); + yaz_log(LOG_DEBUG,"Send the result apdu"); + return apdu; +} + diff --git a/src/session.h b/src/session.h new file mode 100644 index 0000000..bf196e4 --- /dev/null +++ b/src/session.h @@ -0,0 +1,107 @@ +/* + * Copyright (C) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: session.h,v 1.1 2003-10-27 12:21:35 adam Exp $ + */ + +#ifndef SESSION_H +#define SESSION_H + +#include +#include +#include +#include +#include +#include "eventl.h" + +typedef enum { + REQUEST_IDLE, /* the request is just sitting in the queue */ + REQUEST_PENDING /* operation pending (b'end processing or network I/O*/ + /* this list will have more elements when acc/res control is added */ +} request_state; + +typedef struct request +{ + int len_refid; /* length of referenceid */ + char *refid; /* referenceid */ + request_state state; + + Z_GDU *gdu_request; /* Current request */ + Z_APDU *apdu_request; /* Current Z39.50 request */ + NMEM request_mem; /* memory handle for request */ + + int size_response; /* size of buffer */ + int len_response; /* length of encoded data */ + char *response; /* encoded data waiting for transmission */ + + void *clientData; + struct request *next; + struct request_q *q; +} request; + +typedef struct request_q +{ + request *head; + request *tail; + request *list; + int num; +} request_q; + +/* + * association state. + */ +typedef enum +{ + ASSOC_NEW, /* not initialized yet */ + ASSOC_UP, /* normal operation */ + ASSOC_DEAD /* dead. Close if input arrives */ +} association_state; + +typedef struct association +{ + IOCHAN client_chan; /* event-loop control */ + COMSTACK client_link; /* communication handle */ + ODR decode; /* decoding stream */ + ODR encode; /* encoding stream */ + ODR print; /* printing stream (for -a) */ + char *encode_buffer; /* temporary buffer for encoded data */ + int encoded_len; /* length of encoded data */ + char *input_buffer; /* input buffer (allocated by comstack) */ + int input_buffer_len; /* length (size) of buffer */ + int input_apdu_len; /* length of current incoming APDU */ + oid_proto proto; /* protocol (PROTO_Z3950/PROTO_SR) */ + void *backend; /* backend handle */ + request_q incoming; /* Q of incoming PDUs */ + request_q outgoing; /* Q of outgoing data buffers (enc. PDUs) */ + association_state state; + + /* session parameters */ + int preferredMessageSize; + int maximumRecordSize; + int version; /* highest version-bit set (2 or 3) */ + + unsigned cs_get_mask; + unsigned cs_put_mask; + unsigned cs_accept_mask; + + struct bend_initrequest *init; +} association; + +association *create_association(IOCHAN channel, COMSTACK link); +void destroy_association(association *h); +void ir_session(IOCHAN h, int event); + +void request_enq(request_q *q, request *r); +request *request_head(request_q *q); +request *request_deq(request_q *q); +request *request_deq_x(request_q *q, request *r); +void request_initq(request_q *q); +void request_delq(request_q *q); +request *request_get(request_q *q); +void request_release(request *r); + +int statserv_must_terminate(void); + +#endif diff --git a/src/siconv.c b/src/siconv.c new file mode 100644 index 0000000..36f2c2d --- /dev/null +++ b/src/siconv.c @@ -0,0 +1,541 @@ +/* + * Copyright (c) 1997-2003, Index Data + * See the file LICENSE for details. + * + * $Id: siconv.c,v 1.1 2003-10-27 12:21:35 adam Exp $ + */ + +/* mini iconv and wrapper for system iconv library (if present) */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#if HAVE_WCHAR_H +#include +#endif + +#if HAVE_ICONV_H +#include +#endif + +#include + +unsigned long yaz_marc8_conv (unsigned char *inp, size_t inbytesleft, + size_t *no_read); + +struct yaz_iconv_struct { + int my_errno; + int init_flag; + size_t (*init_handle)(yaz_iconv_t cd, unsigned char *inbuf, + size_t inbytesleft, size_t *no_read); + unsigned long (*read_handle)(yaz_iconv_t cd, unsigned char *inbuf, + size_t inbytesleft, size_t *no_read); + size_t (*write_handle)(yaz_iconv_t cd, unsigned long x, + char **outbuf, size_t *outbytesleft); +#if HAVE_ICONV_H + iconv_t iconv_cd; +#endif +}; + +static unsigned long yaz_read_ISO8859_1 (yaz_iconv_t cd, unsigned char *inp, + size_t inbytesleft, size_t *no_read) +{ + unsigned long x = inp[0]; + *no_read = 1; + return x; +} + +static size_t yaz_init_UTF8 (yaz_iconv_t cd, unsigned char *inp, + size_t inbytesleft, size_t *no_read) +{ + if (inp[0] != 0xef) + { + *no_read = 0; + return 0; + } + if (inbytesleft < 3) + { + cd->my_errno = YAZ_ICONV_EINVAL; + return (size_t) -1; + } + if (inp[1] != 0xbb || inp[2] != 0xbf) + { + cd->my_errno = YAZ_ICONV_EILSEQ; + return (size_t) -1; + } + *no_read = 3; + return 0; +} + +static unsigned long yaz_read_UTF8 (yaz_iconv_t cd, unsigned char *inp, + size_t inbytesleft, size_t *no_read) +{ + unsigned long x = 0; + + if (inp[0] <= 0x7f) + { + x = inp[0]; + *no_read = 1; + } + else if (inp[0] <= 0xbf || inp[0] >= 0xfe) + { + *no_read = 0; + cd->my_errno = YAZ_ICONV_EILSEQ; + } + else if (inp[0] <= 0xdf && inbytesleft >= 2) + { + x = ((inp[0] & 0x1f) << 6) | (inp[1] & 0x3f); + if (x >= 0x80) + *no_read = 2; + else + { + *no_read = 0; + cd->my_errno = YAZ_ICONV_EILSEQ; + } + } + else if (inp[0] <= 0xef && inbytesleft >= 3) + { + x = ((inp[0] & 0x0f) << 12) | ((inp[1] & 0x3f) << 6) | + (inp[1] & 0x3f); + if (x >= 0x800) + *no_read = 3; + else + { + *no_read = 0; + cd->my_errno = YAZ_ICONV_EILSEQ; + } + } + else if (inp[0] <= 0xf7 && inbytesleft >= 4) + { + x = ((inp[0] & 0x07) << 18) | ((inp[1] & 0x3f) << 12) | + ((inp[2] & 0x3f) << 6) | (inp[3] & 0x3f); + if (x >= 0x10000) + *no_read = 4; + else + { + *no_read = 0; + cd->my_errno = YAZ_ICONV_EILSEQ; + } + } + else if (inp[0] <= 0xfb && inbytesleft >= 5) + { + x = ((inp[0] & 0x03) << 24) | ((inp[1] & 0x3f) << 18) | + ((inp[2] & 0x3f) << 12) | ((inp[3] & 0x3f) << 6) | + (inp[4] & 0x3f); + if (x >= 0x200000) + *no_read = 5; + else + { + *no_read = 0; + cd->my_errno = YAZ_ICONV_EILSEQ; + } + } + else if (inp[0] <= 0xfd && inbytesleft >= 6) + { + x = ((inp[0] & 0x01) << 30) | ((inp[1] & 0x3f) << 24) | + ((inp[2] & 0x3f) << 18) | ((inp[3] & 0x3f) << 12) | + ((inp[4] & 0x3f) << 6) | (inp[5] & 0x3f); + if (x >= 0x4000000) + *no_read = 6; + else + { + *no_read = 0; + cd->my_errno = YAZ_ICONV_EILSEQ; + } + } + else + { + *no_read = 0; + cd->my_errno = YAZ_ICONV_EINVAL; + } + return x; +} + +static unsigned long yaz_read_UCS4 (yaz_iconv_t cd, unsigned char *inp, + size_t inbytesleft, size_t *no_read) +{ + unsigned long x = 0; + + if (inbytesleft < 4) + { + cd->my_errno = YAZ_ICONV_EINVAL; /* incomplete input */ + *no_read = 0; + } + else + { + x = (inp[0]<<24) | (inp[1]<<16) | (inp[2]<<8) | inp[3]; + *no_read = 4; + } + return x; +} + +static unsigned long yaz_read_UCS4LE (yaz_iconv_t cd, unsigned char *inp, + size_t inbytesleft, size_t *no_read) +{ + unsigned long x = 0; + + if (inbytesleft < 4) + { + cd->my_errno = YAZ_ICONV_EINVAL; /* incomplete input */ + *no_read = 0; + } + else + { + x = (inp[3]<<24) | (inp[2]<<16) | (inp[1]<<8) | inp[0]; + *no_read = 4; + } + return x; +} + +#if HAVE_WCHAR_H +static unsigned long yaz_read_wchar_t (yaz_iconv_t cd, unsigned char *inp, + size_t inbytesleft, size_t *no_read) +{ + unsigned long x = 0; + + if (inbytesleft < sizeof(wchar_t)) + { + cd->my_errno = YAZ_ICONV_EINVAL; /* incomplete input */ + *no_read = 0; + } + else + { + wchar_t wch; + memcpy (&wch, inp, sizeof(wch)); + x = wch; + *no_read = sizeof(wch); + } + return x; +} +#endif + +static unsigned long yaz_read_marc8 (yaz_iconv_t cd, unsigned char *inp, + size_t inbytesleft, size_t *no_read) +{ + return yaz_marc8_conv(inp, inbytesleft, no_read); +} + +static size_t yaz_write_UTF8 (yaz_iconv_t cd, unsigned long x, + char **outbuf, size_t *outbytesleft) +{ + unsigned char *outp = (unsigned char *) *outbuf; + if (x <= 0x7f && *outbytesleft >= 1) + { + *outp++ = (unsigned char) x; + (*outbytesleft)--; + } + else if (x <= 0x7ff && *outbytesleft >= 2) + { + *outp++ = (unsigned char) ((x >> 6) | 0xc0); + *outp++ = (unsigned char) ((x & 0x3f) | 0x80); + (*outbytesleft) -= 2; + } + else if (x <= 0xffff && *outbytesleft >= 3) + { + *outp++ = (unsigned char) ((x >> 12) | 0xe0); + *outp++ = (unsigned char) (((x >> 6) & 0x3f) | 0x80); + *outp++ = (unsigned char) ((x & 0x3f) | 0x80); + (*outbytesleft) -= 3; + } + else if (x <= 0x1fffff && *outbytesleft >= 4) + { + *outp++ = (unsigned char) ((x >> 18) | 0xf0); + *outp++ = (unsigned char) (((x >> 12) & 0x3f) | 0x80); + *outp++ = (unsigned char) (((x >> 6) & 0x3f) | 0x80); + *outp++ = (unsigned char) ((x & 0x3f) | 0x80); + (*outbytesleft) -= 4; + } + else if (x <= 0x3ffffff && *outbytesleft >= 5) + { + *outp++ = (unsigned char) ((x >> 24) | 0xf8); + *outp++ = (unsigned char) (((x >> 18) & 0x3f) | 0x80); + *outp++ = (unsigned char) (((x >> 12) & 0x3f) | 0x80); + *outp++ = (unsigned char) (((x >> 6) & 0x3f) | 0x80); + *outp++ = (unsigned char) ((x & 0x3f) | 0x80); + (*outbytesleft) -= 5; + } + else if (*outbytesleft >= 6) + { + *outp++ = (unsigned char) ((x >> 30) | 0xfc); + *outp++ = (unsigned char) (((x >> 24) & 0x3f) | 0x80); + *outp++ = (unsigned char) (((x >> 18) & 0x3f) | 0x80); + *outp++ = (unsigned char) (((x >> 12) & 0x3f) | 0x80); + *outp++ = (unsigned char) (((x >> 6) & 0x3f) | 0x80); + *outp++ = (unsigned char) ((x & 0x3f) | 0x80); + (*outbytesleft) -= 6; + } + else + { + cd->my_errno = YAZ_ICONV_E2BIG; /* not room for output */ + return (size_t)(-1); + } + *outbuf = (char *) outp; + return 0; +} + +static size_t yaz_write_ISO8859_1 (yaz_iconv_t cd, unsigned long x, + char **outbuf, size_t *outbytesleft) +{ + unsigned char *outp = (unsigned char *) *outbuf; + if (x > 255 || x < 1) + { + cd->my_errno = YAZ_ICONV_EILSEQ; + return (size_t) -1; + } + else if (*outbytesleft >= 1) + { + *outp++ = (unsigned char) x; + (*outbytesleft)--; + } + else + { + cd->my_errno = YAZ_ICONV_E2BIG; + return (size_t)(-1); + } + *outbuf = (char *) outp; + return 0; +} + + +static size_t yaz_write_UCS4 (yaz_iconv_t cd, unsigned long x, + char **outbuf, size_t *outbytesleft) +{ + unsigned char *outp = (unsigned char *) *outbuf; + if (*outbytesleft >= 4) + { + *outp++ = (unsigned char) (x<<24); + *outp++ = (unsigned char) (x<<16); + *outp++ = (unsigned char) (x<<8); + *outp++ = (unsigned char) x; + (*outbytesleft) -= 4; + } + else + { + cd->my_errno = YAZ_ICONV_E2BIG; + return (size_t)(-1); + } + *outbuf = (char *) outp; + return 0; +} + +static size_t yaz_write_UCS4LE (yaz_iconv_t cd, unsigned long x, + char **outbuf, size_t *outbytesleft) +{ + unsigned char *outp = (unsigned char *) *outbuf; + if (*outbytesleft >= 4) + { + *outp++ = (unsigned char) x; + *outp++ = (unsigned char) (x<<8); + *outp++ = (unsigned char) (x<<16); + *outp++ = (unsigned char) (x<<24); + (*outbytesleft) -= 4; + } + else + { + cd->my_errno = YAZ_ICONV_E2BIG; + return (size_t)(-1); + } + *outbuf = (char *) outp; + return 0; +} + +#if HAVE_WCHAR_H +static size_t yaz_write_wchar_t (yaz_iconv_t cd, unsigned long x, + char **outbuf, size_t *outbytesleft) +{ + unsigned char *outp = (unsigned char *) *outbuf; + + if (*outbytesleft >= sizeof(wchar_t)) + { + wchar_t wch = x; + memcpy(outp, &wch, sizeof(wch)); + outp += sizeof(wch); + (*outbytesleft) -= sizeof(wch); + } + else + { + cd->my_errno = YAZ_ICONV_E2BIG; + return (size_t)(-1); + } + *outbuf = (char *) outp; + return 0; +} +#endif + +int yaz_iconv_isbuiltin(yaz_iconv_t cd) +{ + return cd->read_handle && cd->write_handle; +} + +yaz_iconv_t yaz_iconv_open (const char *tocode, const char *fromcode) +{ + yaz_iconv_t cd = (yaz_iconv_t) xmalloc (sizeof(*cd)); + + cd->write_handle = 0; + cd->read_handle = 0; + cd->init_handle = 0; + cd->my_errno = YAZ_ICONV_UNKNOWN; + + /* a useful hack: if fromcode has leading @, + the library not use YAZ's own conversions .. */ + if (fromcode[0] == '@') + fromcode++; + else + { + if (!yaz_matchstr(fromcode, "UTF8")) + { + cd->read_handle = yaz_read_UTF8; + cd->init_handle = yaz_init_UTF8; + } + else if (!yaz_matchstr(fromcode, "ISO88591")) + cd->read_handle = yaz_read_ISO8859_1; + else if (!yaz_matchstr(fromcode, "UCS4")) + cd->read_handle = yaz_read_UCS4; + else if (!yaz_matchstr(fromcode, "UCS4LE")) + cd->read_handle = yaz_read_UCS4LE; + else if (!yaz_matchstr(fromcode, "MARC8")) + cd->read_handle = yaz_read_marc8; +#if HAVE_WCHAR_H + else if (!yaz_matchstr(fromcode, "WCHAR_T")) + cd->read_handle = yaz_read_wchar_t; +#endif + + if (!yaz_matchstr(tocode, "UTF8")) + cd->write_handle = yaz_write_UTF8; + else if (!yaz_matchstr(tocode, "ISO88591")) + cd->write_handle = yaz_write_ISO8859_1; + else if (!yaz_matchstr (tocode, "UCS4")) + cd->write_handle = yaz_write_UCS4; + else if (!yaz_matchstr(tocode, "UCS4LE")) + cd->write_handle = yaz_write_UCS4LE; +#if HAVE_WCHAR_H + else if (!yaz_matchstr(tocode, "WCHAR_T")) + cd->write_handle = yaz_write_wchar_t; +#endif + } +#if HAVE_ICONV_H + cd->iconv_cd = 0; + if (!cd->read_handle || !cd->write_handle) + { + cd->iconv_cd = iconv_open (tocode, fromcode); + if (cd->iconv_cd == (iconv_t) (-1)) + { + xfree (cd); + return 0; + } + } +#else + if (!cd->read_handle || !cd->write_handle) + { + xfree (cd); + return 0; + } +#endif + cd->init_flag = 1; + return cd; +} + +size_t yaz_iconv (yaz_iconv_t cd, char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft) +{ + char *inbuf0; + size_t r = 0; +#if HAVE_ICONV_H + if (cd->iconv_cd) + { + size_t r = + iconv(cd->iconv_cd, inbuf, inbytesleft, outbuf, outbytesleft); + if (r == (size_t)(-1)) + { + switch (yaz_errno()) + { + case E2BIG: + cd->my_errno = YAZ_ICONV_E2BIG; + break; + case EINVAL: + cd->my_errno = YAZ_ICONV_EINVAL; + break; + case EILSEQ: + cd->my_errno = YAZ_ICONV_EILSEQ; + break; + default: + cd->my_errno = YAZ_ICONV_UNKNOWN; + } + } + return r; + } +#endif + if (inbuf == 0 || *inbuf == 0) + { + cd->init_flag = 1; + cd->my_errno = YAZ_ICONV_UNKNOWN; + return 0; + } + inbuf0 = *inbuf; + + if (cd->init_flag) + { + if (cd->init_handle) + { + size_t no_read; + size_t r = (cd->init_handle)(cd, (unsigned char *) *inbuf, + *inbytesleft, &no_read); + if (r) + { + if (cd->my_errno == YAZ_ICONV_EINVAL) + return r; + cd->init_flag = 0; + return r; + } + *inbytesleft -= no_read; + *inbuf += no_read; + } + cd->init_flag = 0; + } + while (1) + { + unsigned long x; + size_t no_read; + + if (*inbytesleft == 0) + { + r = *inbuf - inbuf0; + break; + } + + x = (cd->read_handle)(cd, (unsigned char *) *inbuf, *inbytesleft, + &no_read); + if (no_read == 0) + { + r = (size_t)(-1); + break; + } + r = (cd->write_handle)(cd, x, outbuf, outbytesleft); + if (r) + break; + *inbytesleft -= no_read; + (*inbuf) += no_read; + } + return r; +} + +int yaz_iconv_error (yaz_iconv_t cd) +{ + return cd->my_errno; +} + +int yaz_iconv_close (yaz_iconv_t cd) +{ +#if HAVE_ICONV_H + if (cd->iconv_cd) + iconv_close (cd->iconv_cd); +#endif + xfree (cd); + return 0; +} + + diff --git a/src/soap.c b/src/soap.c new file mode 100644 index 0000000..ebcf158 --- /dev/null +++ b/src/soap.c @@ -0,0 +1,262 @@ +/* + * Copyright (c) 2002-2003, Index Data. + * See the file LICENSE for details. + * + * $Id: soap.c,v 1.1 2003-10-27 12:21:35 adam Exp $ + */ + +#include + +#if HAVE_XML2 +#include +#include + +static const char *soap_v1_1 = "http://schemas.xmlsoap.org/soap/envelope/"; +static const char *soap_v1_2 = "http://www.w3.org/2001/06/soap-envelope"; + +int z_soap_error(ODR o, Z_SOAP *p, + const char *fault_code, const char *fault_string, + const char *details) +{ + p->which = Z_SOAP_error; + p->u.soap_error = (Z_SOAP_Fault *) + odr_malloc(o, sizeof(*p->u.soap_error)); + p->u.soap_error->fault_code = odr_strdup(o, fault_code); + p->u.soap_error->fault_string = odr_strdup(o, fault_string); + if (details) + p->u.soap_error->details = odr_strdup(o, details); + else + p->u.soap_error->details = 0; + return -1; +} + +int z_soap_codec_enc(ODR o, Z_SOAP **pp, + char **content_buf, int *content_len, + Z_SOAP_Handler *handlers, + const char *encoding) +{ + if (o->direction == ODR_DECODE) + { + Z_SOAP *p; + xmlNodePtr ptr, pptr; + xmlDocPtr doc; + int i, ret; + + if (!content_buf || !*content_buf || !content_len) + return -1; + + *pp = p = (Z_SOAP *) odr_malloc(o, sizeof(*p)); + p->ns = soap_v1_1; + + doc = xmlParseMemory(*content_buf, *content_len); + if (!doc) + return z_soap_error(o, p, "SOAP-ENV:Client", + "Bad XML Document", 0); + /* check that root node is Envelope */ + ptr = xmlDocGetRootElement(doc); + if (!ptr || ptr->type != XML_ELEMENT_NODE || + strcmp(ptr->name, "Envelope") || !ptr->ns) + { + xmlFreeDoc(doc); + return z_soap_error(o, p, "SOAP-ENV:Client", + "No Envelope element", 0); + } + else + { + /* determine SOAP version */ + const char * ns_envelope = ptr->ns->href; + if (!strcmp(ns_envelope, soap_v1_1)) + p->ns = soap_v1_1; + else if (!strcmp(ns_envelope, soap_v1_2)) + p->ns = soap_v1_2; + else + { + xmlFreeDoc(doc); + return z_soap_error(o, p, "SOAP-ENV:Client", + "Bad SOAP version", 0); + } + } + ptr = ptr->children; + while(ptr && ptr->type == XML_TEXT_NODE) + ptr = ptr->next; + if (ptr && ptr->type == XML_ELEMENT_NODE && + !strcmp(ptr->ns->href, p->ns) && + !strcmp(ptr->name, "Header")) + { + ptr = ptr->next; + while(ptr && ptr->type == XML_TEXT_NODE) + ptr = ptr->next; + } + /* check that Body is present */ + if (!ptr || ptr->type != XML_ELEMENT_NODE || + strcmp(ptr->name, "Body")) + { + xmlFreeDoc(doc); + return z_soap_error(o, p, "SOAP-ENV:Client", + "SOAP Body element not found", 0); + } + if (strcmp(ptr->ns->href, p->ns)) + { + xmlFreeDoc(doc); + return z_soap_error(o, p, "SOAP-ENV:Client", + "SOAP bad NS for Body element", 0); + } + pptr = ptr; + ptr = ptr->children; + while (ptr && ptr->type == XML_TEXT_NODE) + ptr = ptr->next; + if (!ptr || ptr->type != XML_ELEMENT_NODE) + { + xmlFreeDoc(doc); + return z_soap_error(o, p, "SOAP-ENV:Client", + "SOAP No content for Body", 0); + } + /* check for fault package */ + if (!strcmp(ptr->ns->href, p->ns) + && !strcmp(ptr->name, "Fault") && ptr->children) + { + ptr = ptr->children; + + p->which = Z_SOAP_fault; + p->u.fault = odr_malloc(o, sizeof(*p->u.fault)); + p->u.fault->fault_code = 0; + p->u.fault->fault_string = 0; + p->u.fault->details = 0; + while (ptr) + { + if (ptr->children && ptr->children->type == XML_TEXT_NODE) + { + if (!strcmp(ptr->name, "faultcode")) + p->u.fault->fault_code = + odr_strdup(o, ptr->children->content); + if (!strcmp(ptr->name, "faultstring")) + p->u.fault->fault_string = + odr_strdup(o, ptr->children->content); + if (!strcmp(ptr->name, "details")) + p->u.fault->details = + odr_strdup(o, ptr->children->content); + } + ptr = ptr->next; + } + ret = 0; + } + else + { + for (i = 0; handlers[i].ns; i++) + if (!strcmp(ptr->ns->href, handlers[i].ns)) + break; + if (handlers[i].ns) + { + void *handler_data = 0; + ret = (*handlers[i].f)(o, pptr, &handler_data, + handlers[i].client_data, + handlers[i].ns); + if (ret || !handler_data) + z_soap_error(o, p, "SOAP-ENV:Client", + "SOAP Handler returned error", 0); + else + { + p->which = Z_SOAP_generic; + p->u.generic = odr_malloc(o, sizeof(*p->u.generic)); + p->u.generic->no = i; + p->u.generic->ns = handlers[i].ns; + p->u.generic->p = handler_data; + } + } + else + { + ret = z_soap_error(o, p, "SOAP-ENV:Client", + "No handler for NS", ptr->ns->href); + } + } + xmlFreeDoc(doc); + return ret; + } + else if (o->direction == ODR_ENCODE) + { + Z_SOAP *p = *pp; + xmlNsPtr ns_env; + xmlNodePtr envelope_ptr, body_ptr; + + xmlDocPtr doc = xmlNewDoc("1.0"); + + envelope_ptr = xmlNewNode(0, "Envelope"); + ns_env = xmlNewNs(envelope_ptr, p->ns, "SOAP-ENV"); + xmlSetNs(envelope_ptr, ns_env); + + body_ptr = xmlNewChild(envelope_ptr, ns_env, "Body", 0); + xmlDocSetRootElement(doc, envelope_ptr); + + if (p->which == Z_SOAP_fault || p->which == Z_SOAP_error) + { + Z_SOAP_Fault *f = p->u.fault; + xmlNodePtr fault_ptr = xmlNewChild(body_ptr, ns_env, "Fault", 0); + xmlNewChild(fault_ptr, ns_env, "faultcode", f->fault_code); + xmlNewChild(fault_ptr, ns_env, "faultstring", f->fault_string); + if (f->details) + xmlNewChild(fault_ptr, ns_env, "details", f->details); + } + else if (p->which == Z_SOAP_generic) + { + int ret, no = p->u.generic->no; + + ret = (*handlers[no].f)(o, body_ptr, &p->u.generic->p, + handlers[no].client_data, + handlers[no].ns); + if (ret) + return ret; + } + if (p->which == Z_SOAP_generic && !strcmp(p->ns, "SRU")) + { + xmlDocSetRootElement(doc, body_ptr->children); + } + if (1) + { + xmlChar *buf_out; + int len_out; + if (encoding) + xmlDocDumpMemoryEnc(doc, &buf_out, &len_out, encoding); + else + xmlDocDumpMemory(doc, &buf_out, &len_out); + *content_buf = (char *) odr_malloc(o, len_out); + *content_len = len_out; + memcpy(*content_buf, buf_out, len_out); + xmlFree(buf_out); + } + xmlFreeDoc(doc); + return 0; + } + return 0; +} +#else +int z_soap_codec_enc(ODR o, Z_SOAP **pp, + char **content_buf, int *content_len, + Z_SOAP_Handler *handlers, const char *encoding) +{ + static char *err_xml = + "\n" + "\n" + "\t\n" + "\t\t\n" + "\t\t\tSOAP-ENV:Server\n" + "\t\t\tHTTP error\n" + "\t\t\tSOAP not supported in this YAZ configuration\n" + "\t\t\n" + "\t\n" + "\n"; + if (o->direction == ODR_ENCODE) + { + *content_buf = err_xml; + *content_len = strlen(err_xml); + } + return -1; +} +#endif +int z_soap_codec(ODR o, Z_SOAP **pp, + char **content_buf, int *content_len, + Z_SOAP_Handler *handlers) +{ + return z_soap_codec_enc(o, pp, content_buf, content_len, handlers, 0); +} + diff --git a/src/sortspec.c b/src/sortspec.c new file mode 100644 index 0000000..22ac90b --- /dev/null +++ b/src/sortspec.c @@ -0,0 +1,114 @@ +/* + * Copyright (c) 1995-2001, Index Data. + * See the file LICENSE for details. + * + * $Id: sortspec.c,v 1.1 2003-10-27 12:21:35 adam Exp $ + */ + +#include +#include +#include + +#include +#include +#include + +Z_SortKeySpecList *yaz_sort_spec (ODR out, const char *arg) +{ + char sort_string_buf[32], sort_flags[32]; + Z_SortKeySpecList *sksl = (Z_SortKeySpecList *) + odr_malloc (out, sizeof(*sksl)); + int off; + + sksl->num_specs = 0; + sksl->specs = (Z_SortKeySpec **)odr_malloc (out, sizeof(sksl->specs) * 20); + + while ((sscanf (arg, "%31s %31s%n", sort_string_buf, + sort_flags, &off)) == 2 && off > 1) + { + int i; + char *sort_string_sep; + char *sort_string = sort_string_buf; + Z_SortKeySpec *sks = (Z_SortKeySpec *)odr_malloc (out, sizeof(*sks)); + Z_SortKey *sk = (Z_SortKey *)odr_malloc (out, sizeof(*sk)); + + arg += off; + sksl->specs[sksl->num_specs++] = sks; + sks->sortElement = (Z_SortElement *) + odr_malloc (out, sizeof(*sks->sortElement)); + sks->sortElement->which = Z_SortElement_generic; + sks->sortElement->u.generic = sk; + + if ((sort_string_sep = strchr (sort_string, '='))) + { + int i = 0; + sk->which = Z_SortKey_sortAttributes; + sk->u.sortAttributes = (Z_SortAttributes *) + odr_malloc (out, sizeof(*sk->u.sortAttributes)); + sk->u.sortAttributes->id = + yaz_oidval_to_z3950oid(out, CLASS_ATTSET, VAL_BIB1); + sk->u.sortAttributes->list = (Z_AttributeList *) + odr_malloc (out, sizeof(*sk->u.sortAttributes->list)); + sk->u.sortAttributes->list->attributes = (Z_AttributeElement **) + odr_malloc (out, 10 * + sizeof(*sk->u.sortAttributes->list->attributes)); + while (i < 10 && sort_string && sort_string_sep) + { + Z_AttributeElement *el = (Z_AttributeElement *) + odr_malloc (out, sizeof(*el)); + sk->u.sortAttributes->list->attributes[i] = el; + el->attributeSet = 0; + el->attributeType = odr_intdup (out, atoi (sort_string)); + el->which = Z_AttributeValue_numeric; + el->value.numeric = + odr_intdup (out, atoi (sort_string_sep + 1)); + i++; + sort_string = strchr(sort_string, ','); + if (sort_string) + { + sort_string++; + sort_string_sep = strchr (sort_string, '='); + } + } + sk->u.sortAttributes->list->num_attributes = i; + } + else + { + sk->which = Z_SortKey_sortField; + sk->u.sortField = odr_strdup (out, sort_string); + } + sks->sortRelation = odr_intdup (out, Z_SortRelation_ascending); + sks->caseSensitivity = odr_intdup (out, Z_SortCase_caseSensitive); + + sks->which = Z_SortKeySpec_null; + sks->u.null = odr_nullval (); + + for (i = 0; sort_flags[i]; i++) + { + switch (sort_flags[i]) + { + case 'd': + case 'D': + case '>': + *sks->sortRelation = Z_SortRelation_descending; + break; + case 'a': + case 'A': + case '<': + *sks->sortRelation = Z_SortRelation_ascending; + break; + case 'i': + case 'I': + *sks->caseSensitivity = Z_SortCase_caseInsensitive; + break; + case 'S': + case 's': + *sks->caseSensitivity = Z_SortCase_caseSensitive; + break; + } + } + } + if (!sksl->num_specs) + return 0; + return sksl; +} diff --git a/src/srw.c b/src/srw.c new file mode 100644 index 0000000..d215714 --- /dev/null +++ b/src/srw.c @@ -0,0 +1,855 @@ +/* + * Copyright (c) 2002-2003, Index Data. + * See the file LICENSE for details. + * + * $Id: srw.c,v 1.1 2003-10-27 12:21:35 adam Exp $ + */ + +#include + +#if HAVE_XML2 +#include +#include + +static void add_XML_n(xmlNodePtr ptr, const char *elem, char *val, int len) +{ + if (val) + { + xmlDocPtr doc = xmlParseMemory(val,len); + if (doc) + { + xmlNodePtr c = xmlNewChild(ptr, 0, elem, 0); + xmlNodePtr t = xmlDocGetRootElement(doc); + xmlAddChild(c, xmlCopyNode(t,1)); + xmlFreeDoc(doc); + } + } +} + +static void add_xsd_string_n(xmlNodePtr ptr, const char *elem, char *val, + int len) +{ + if (val) + { + xmlNodePtr c = xmlNewChild(ptr, 0, elem, 0); + xmlNodePtr t = xmlNewTextLen(val, len); + xmlAddChild(c, t); + } +} + +static void add_xsd_string(xmlNodePtr ptr, const char *elem, char *val) +{ + if (val) + xmlNewChild(ptr, 0, elem, val); +} + +static void add_xsd_integer(xmlNodePtr ptr, const char *elem, int *val) +{ + if (val) + { + char str[30]; + sprintf(str, "%d", *val); + xmlNewChild(ptr, 0, elem, str); + } +} + +static int match_element(xmlNodePtr ptr, const char *elem) +{ + if (ptr->type == XML_ELEMENT_NODE && !strcmp(ptr->name, elem)) + return 1; + return 0; +} + +#define CHECK_TYPE 0 + +static int match_xsd_string_n(xmlNodePtr ptr, const char *elem, ODR o, + char **val, int *len) +{ +#if CHECK_TYPE + struct _xmlAttr *attr; +#endif + if (!match_element(ptr, elem)) + return 0; +#if CHECK_TYPE + for (attr = ptr->properties; attr; attr = attr->next) + if (!strcmp(attr->name, "type") && + attr->children && attr->children->type == XML_TEXT_NODE) + { + const char *t = strchr(attr->children->content, ':'); + if (t) + t = t + 1; + else + t = attr->children->content; + if (!strcmp(t, "string")) + break; + } + if (!attr) + return 0; +#endif + ptr = ptr->children; + if (!ptr || ptr->type != XML_TEXT_NODE) + return 0; + *val = odr_strdup(o, ptr->content); + if (len) + *len = strlen(ptr->content); + return 1; +} + + +static int match_xsd_string(xmlNodePtr ptr, const char *elem, ODR o, + char **val) +{ + return match_xsd_string_n(ptr, elem, o, val, 0); +} + +static int match_xsd_XML_n(xmlNodePtr ptr, const char *elem, ODR o, + char **val, int *len) +{ + xmlBufferPtr buf; + + if (!match_element(ptr, elem)) + return 0; + ptr = ptr->children; + if (!ptr) + return 0; + buf = xmlBufferCreate(); + + xmlNodeDump(buf, ptr->doc, ptr, 0, 0); + + *val = odr_malloc(o, buf->use+1); + memcpy (*val, buf->content, buf->use); + (*val)[buf->use] = '\0'; + + if (len) + *len = buf->use; + + xmlBufferFree(buf); + + return 1; +} + + +static int match_xsd_integer(xmlNodePtr ptr, const char *elem, ODR o, int **val) +{ +#if CHECK_TYPE + struct _xmlAttr *attr; +#endif + if (!match_element(ptr, elem)) + return 0; +#if CHECK_TYPE + for (attr = ptr->properties; attr; attr = attr->next) + if (!strcmp(attr->name, "type") && + attr->children && attr->children->type == XML_TEXT_NODE) + { + const char *t = strchr(attr->children->content, ':'); + if (t) + t = t + 1; + else + t = attr->children->content; + if (!strcmp(t, "integer")) + break; + } + if (!attr) + return 0; +#endif + ptr = ptr->children; + if (!ptr || ptr->type != XML_TEXT_NODE) + return 0; + *val = odr_intdup(o, atoi(ptr->content)); + return 1; +} + +static int yaz_srw_records(ODR o, xmlNodePtr pptr, Z_SRW_record **recs, + int *num, void *client_data, const char *ns) +{ + if (o->direction == ODR_DECODE) + { + int i; + xmlNodePtr ptr; + *num = 0; + for (ptr = pptr->children; ptr; ptr = ptr->next) + { + if (ptr->type == XML_ELEMENT_NODE && + !strcmp(ptr->name, "record")) + (*num)++; + } + if (!*num) + return 1; + *recs = odr_malloc(o, *num * sizeof(**recs)); + for (i = 0, ptr = pptr->children; ptr; ptr = ptr->next, i++) + { + if (ptr->type == XML_ELEMENT_NODE && + !strcmp(ptr->name, "record")) + { + xmlNodePtr rptr; + (*recs)[i].recordSchema = 0; + (*recs)[i].recordPacking = Z_SRW_recordPacking_string; + (*recs)[i].recordData_buf = 0; + (*recs)[i].recordData_len = 0; + (*recs)[i].recordPosition = 0; + for (rptr = ptr->children; rptr; rptr = rptr->next) + { + if (match_xsd_string(rptr, "recordSchema", o, + &(*recs)[i].recordSchema)) + ; + else if (match_xsd_string_n(rptr, "recordData", o, + &(*recs)[i].recordData_buf, + &(*recs)[i].recordData_len)) + ; + else if (match_xsd_XML_n(rptr, "recordXML", o, + &(*recs)[i].recordData_buf, + &(*recs)[i].recordData_len)) + (*recs)[i].recordPacking = Z_SRW_recordPacking_XML; + else if (match_xsd_integer(rptr, "recordPosition", o, + &(*recs)[i].recordPosition)) + ; + } + } + } + } + else if (o->direction == ODR_ENCODE) + { + int i; + for (i = 0; i < *num; i++) + { + xmlNodePtr rptr = xmlNewChild(pptr, 0, "record", 0); + add_xsd_string(rptr, "recordSchema", (*recs)[i].recordSchema); + switch((*recs)[i].recordPacking) + { + case Z_SRW_recordPacking_string: + add_xsd_string_n(rptr, "recordData", (*recs)[i].recordData_buf, + (*recs)[i].recordData_len); + break; + case Z_SRW_recordPacking_XML: + add_XML_n(rptr, "recordXML", (*recs)[i].recordData_buf, + (*recs)[i].recordData_len); + break; + } + add_xsd_integer(rptr, "recordPosition", (*recs)[i].recordPosition); + } + } + return 0; +} + +static int yaz_srw_diagnostics(ODR o, xmlNodePtr pptr, Z_SRW_diagnostic **recs, + int *num, void *client_data, const char *ns) +{ + if (o->direction == ODR_DECODE) + { + int i; + xmlNodePtr ptr; + *num = 0; + for (ptr = pptr->children; ptr; ptr = ptr->next) + { + if (ptr->type == XML_ELEMENT_NODE && + !strcmp(ptr->name, "diagnostic")) + (*num)++; + } + if (!*num) + return 1; + *recs = odr_malloc(o, *num * sizeof(**recs)); + for (i = 0, ptr = pptr->children; ptr; ptr = ptr->next, i++) + { + if (ptr->type == XML_ELEMENT_NODE && + !strcmp(ptr->name, "diagnostic")) + { + xmlNodePtr rptr; + (*recs)[i].code = 0; + (*recs)[i].details = 0; + for (rptr = ptr->children; rptr; rptr = rptr->next) + { + if (match_xsd_integer(rptr, "code", o, + &(*recs)[i].code)) + ; + else if (match_xsd_string(rptr, "details", o, + &(*recs)[i].details)) + ; + } + i++; + } + } + } + else if (o->direction == ODR_ENCODE) + { + int i; + for (i = 0; i < *num; i++) + { + xmlNodePtr rptr = xmlNewChild(pptr, 0, "diagnostic", 0); + add_xsd_integer(rptr, "code", (*recs)[i].code); + add_xsd_string(rptr, "details", (*recs)[i].details); + } + } + return 0; +} + + +int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data, + void *client_data, const char *ns) +{ + xmlNodePtr pptr = vptr; + if (o->direction == ODR_DECODE) + { + xmlNodePtr method = pptr->children; + + while (method && method->type == XML_TEXT_NODE) + method = method->next; + + if (!method || method->type != XML_ELEMENT_NODE) + return -1; + if (!strcmp(method->name, "searchRetrieveRequest")) + { + Z_SRW_PDU **p = handler_data; + xmlNodePtr ptr = method->children; + Z_SRW_searchRetrieveRequest *req; + + *p = odr_malloc(o, sizeof(**p)); + (*p)->which = Z_SRW_searchRetrieve_request; + req = (*p)->u.request = odr_malloc(o, sizeof(*req)); + req->query_type = Z_SRW_query_type_cql; + req->query.cql = 0; + req->sort_type = Z_SRW_sort_type_none; + req->sort.none = 0; + req->startRecord = 0; + req->maximumRecords = 0; + req->recordSchema = 0; + req->recordPacking = 0; + req->database = 0; + + for (; ptr; ptr = ptr->next) + { + if (match_xsd_string(ptr, "query", o, + &req->query.cql)) + req->query_type = Z_SRW_query_type_cql; + else if (match_xsd_string(ptr, "pQuery", o, + &req->query.pqf)) + req->query_type = Z_SRW_query_type_pqf; + else if (match_xsd_string(ptr, "xQuery", o, + &req->query.xcql)) + req->query_type = Z_SRW_query_type_xcql; + else if (match_xsd_string(ptr, "sortKeys", o, + &req->sort.sortKeys)) + req->sort_type = Z_SRW_sort_type_sort; + else if (match_xsd_string(ptr, "recordSchema", o, + &req->recordSchema)) + ; + else if (match_xsd_string(ptr, "recordPacking", o, + &req->recordPacking)) + ; + else if (match_xsd_integer(ptr, "startRecord", o, + &req->startRecord)) + ; + else if (match_xsd_integer(ptr, "maximumRecords", o, + &req->maximumRecords)) + ; + else if (match_xsd_string(ptr, "database", o, + &req->database)) + ; + /* missing is xQuery, xSortKeys .. */ + } + } + else if (!strcmp(method->name, "searchRetrieveResponse")) + { + Z_SRW_PDU **p = handler_data; + xmlNodePtr ptr = method->children; + Z_SRW_searchRetrieveResponse *res; + + *p = odr_malloc(o, sizeof(**p)); + (*p)->which = Z_SRW_searchRetrieve_response; + res = (*p)->u.response = odr_malloc(o, sizeof(*res)); + + res->numberOfRecords = 0; + res->resultSetId = 0; + res->resultSetIdleTime = 0; + res->records = 0; + res->num_records = 0; + res->diagnostics = 0; + res->num_diagnostics = 0; + res->nextRecordPosition = 0; + + for (; ptr; ptr = ptr->next) + { + if (match_xsd_integer(ptr, "numberOfRecords", o, + &res->numberOfRecords)) + ; + else if (match_xsd_string(ptr, "resultSetId", o, + &res->resultSetId)) + ; + else if (match_xsd_integer(ptr, "resultSetIdleTime", o, + &res->resultSetIdleTime)) + ; + else if (match_element(ptr, "records")) + yaz_srw_records(o, ptr, &res->records, + &res->num_records, client_data, + ns); + else if (match_element(ptr, "diagnostics")) + yaz_srw_diagnostics(o, ptr, &res->diagnostics, + &res->num_diagnostics, + client_data, ns); + else if (match_xsd_integer(ptr, "nextRecordPosition", o, + &res->nextRecordPosition)) + ; + } + } + else if (!strcmp(method->name, "explainRequest")) + { + Z_SRW_PDU **p = handler_data; + Z_SRW_explainRequest *req; + + *p = odr_malloc(o, sizeof(**p)); + (*p)->which = Z_SRW_explain_request; + req = (*p)->u.explain_request = odr_malloc(o, sizeof(*req)); + req->dummy = 0; + } + else if (!strcmp(method->name, "explainResponse")) + { + Z_SRW_PDU **p = handler_data; + Z_SRW_explainResponse *res; + xmlNodePtr ptr = method->children; + + *p = odr_malloc(o, sizeof(**p)); + (*p)->which = Z_SRW_explain_response; + res = (*p)->u.explain_response = odr_malloc(o, sizeof(*res)); + res->explainData_buf = 0; + res->explainData_len = 0; + res->explainPacking = Z_SRW_recordPacking_string; + for (; ptr; ptr = ptr->next) + { + match_xsd_string_n(ptr, "Explain", o, + &res->explainData_buf, + &res->explainData_len); + } + } + else + return -1; + + } + else if (o->direction == ODR_ENCODE) + { + Z_SRW_PDU **p = handler_data; + if ((*p)->which == Z_SRW_searchRetrieve_request) + { + Z_SRW_searchRetrieveRequest *req = (*p)->u.request; + xmlNodePtr ptr = xmlNewChild(pptr, 0, + "searchRetrieveRequest", 0); + xmlNsPtr ns_srw = xmlNewNs(ptr, ns, "zs"); + + xmlSetNs(ptr, ns_srw); + + switch(req->query_type) + { + case Z_SRW_query_type_cql: + add_xsd_string(ptr, "query", req->query.cql); + break; + case Z_SRW_query_type_xcql: + add_xsd_string(ptr, "xQuery", req->query.xcql); + break; + case Z_SRW_query_type_pqf: + add_xsd_string(ptr, "pQuery", req->query.pqf); + break; + } + switch(req->sort_type) + { + case Z_SRW_sort_type_none: + break; + case Z_SRW_sort_type_sort: + add_xsd_string(ptr, "sortKeys", req->sort.sortKeys); + break; + case Z_SRW_sort_type_xSort: + add_xsd_string(ptr, "xSortKeys", req->sort.xSortKeys); + break; + } + add_xsd_integer(ptr, "startRecord", req->startRecord); + add_xsd_integer(ptr, "maximumRecords", req->maximumRecords); + add_xsd_string(ptr, "recordSchema", req->recordSchema); + add_xsd_string(ptr, "recordPacking", req->recordPacking); + add_xsd_string(ptr, "database", req->database); + } + else if ((*p)->which == Z_SRW_searchRetrieve_response) + { + Z_SRW_searchRetrieveResponse *res = (*p)->u.response; + xmlNodePtr ptr = xmlNewChild(pptr, 0, + "searchRetrieveResponse", 0); + xmlNsPtr ns_srw = xmlNewNs(ptr, ns, "zs"); + + xmlSetNs(ptr, ns_srw); + add_xsd_integer(ptr, "numberOfRecords", res->numberOfRecords); + add_xsd_string(ptr, "resultSetId", res->resultSetId); + add_xsd_integer(ptr, "resultSetIdleTime", res->resultSetIdleTime); + if (res->num_records) + { + xmlNodePtr rptr = xmlNewChild(ptr, 0, "records", 0); + yaz_srw_records(o, rptr, &res->records, &res->num_records, + client_data, ns); + } + if (res->num_diagnostics) + { + xmlNodePtr rptr = xmlNewChild(ptr, 0, "diagnostics", 0); + yaz_srw_diagnostics(o, rptr, &res->diagnostics, + &res->num_diagnostics, client_data, ns); + } + add_xsd_integer(ptr, "nextRecordPosition", res->nextRecordPosition); + } + else if ((*p)->which == Z_SRW_explain_request) + { + xmlNodePtr ptr = xmlNewChild(pptr, 0, "explainRequest", 0); + xmlNsPtr ns_srw = xmlNewNs(ptr, ns, "zs"); + + xmlSetNs(ptr, ns_srw); + } + else if ((*p)->which == Z_SRW_explain_response) + { + Z_SRW_explainResponse *res = (*p)->u.explain_response; + xmlNodePtr ptr = xmlNewChild(pptr, 0, "explainResponse", 0); + xmlNsPtr ns_srw = xmlNewNs(ptr, ns, "zs"); + + xmlSetNs(ptr, ns_srw); + + add_xsd_string_n(ptr, "Explain", res->explainData_buf, + res->explainData_len); + } + else + return -1; + + } + return 0; +} + +Z_SRW_PDU *yaz_srw_get(ODR o, int which) +{ + Z_SRW_PDU *sr = odr_malloc(o, sizeof(*o)); + sr->which = which; + switch(which) + { + case Z_SRW_searchRetrieve_request: + sr->u.request = (Z_SRW_searchRetrieveRequest *) + odr_malloc(o, sizeof(*sr->u.request)); + sr->u.request->query_type = Z_SRW_query_type_cql; + sr->u.request->query.cql = 0; + sr->u.request->sort_type = Z_SRW_sort_type_none; + sr->u.request->sort.none = 0; + sr->u.request->startRecord = 0; + sr->u.request->maximumRecords = 0; + sr->u.request->recordSchema = 0; + sr->u.request->recordPacking = 0; + sr->u.request->database = 0; + break; + case Z_SRW_searchRetrieve_response: + sr->u.response = (Z_SRW_searchRetrieveResponse *) + odr_malloc(o, sizeof(*sr->u.response)); + sr->u.response->numberOfRecords = 0; + sr->u.response->resultSetId = 0; + sr->u.response->resultSetIdleTime = 0; + sr->u.response->records = 0; + sr->u.response->num_records = 0; + sr->u.response->diagnostics = 0; + sr->u.response->num_diagnostics = 0; + sr->u.response->nextRecordPosition = 0; + break; + case Z_SRW_explain_request: + sr->u.explain_request = (Z_SRW_explainRequest *) + odr_malloc(o, sizeof(*sr->u.explain_request)); + sr->u.explain_request->dummy = 0; + break; + case Z_SRW_explain_response: + sr->u.explain_response = (Z_SRW_explainResponse *) + odr_malloc(o, sizeof(*sr->u.explain_response)); + sr->u.explain_response->explainPacking = 0; + sr->u.explain_response->explainData_buf = 0; + sr->u.explain_response->explainData_len = 0; + } + return sr; +} + +#endif + + +static struct { + int code; + const char *msg; +} yaz_srw_codes [] = { +{1, "Permanent system error"}, +{2, "System temporarily unavailable"}, +{3, "Authentication error"}, +/* Diagnostics Relating to CQL */ +{10, "Illegal query"}, +{11, "Unsupported query type (XCQL vs CQL)"}, +{12, "Too many characters in query"}, +{13, "Unbalanced or illegal use of parentheses"}, +{14, "Unbalanced or illegal use of quotes"}, +{15, "Illegal or unsupported index set"}, +{16, "Illegal or unsupported index"}, +{17, "Illegal or unsupported combination of index and index set"}, +{18, "Illegal or unsupported combination of indexes"}, +{19, "Illegal or unsupported relation"}, +{20, "Illegal or unsupported relation modifier"}, +{21, "Illegal or unsupported combination of relation modifers"}, +{22, "Illegal or unsupported combination of relation and index"}, +{23, "Too many characters in term"}, +{24, "Illegal combination of relation and term"}, +{25, "Special characters not quoted in term"}, +{26, "Non special character escaped in term"}, +{27, "Empty term unsupported"}, +{28, "Masking character not supported"}, +{29, "Masked words too short"}, +{30, "Too many masking characters in term"}, +{31, "Anchoring character not supported"}, +{32, "Anchoring character in illegal or unsupported position"}, +{33, "Combination of proximity/adjacency and masking characters not supported"}, +{34, "Combination of proximity/adjacency and anchoring characters not supported"}, +{35, "Terms only exclusion (stop) words"}, +{36, "Term in invalid format for index or relation"}, +{37, "Illegal or unsupported boolean operator"}, +{38, "Too many boolean operators in query"}, +{39, "Proximity not supported"}, +{40, "Illegal or unsupported proximity relation"}, +{41, "Illegal or unsupported proximity distance"}, +{42, "Illegal or unsupported proximity unit"}, +{43, "Illegal or unsupported proximity ordering"}, +{44, "Illegal or unsupported combination of proximity modifiers"}, +{45, "Index set name (prefix) assigned to multiple identifiers"}, +/* Diagnostics Relating to Result Sets */ +{50, "Result sets not supported"}, +{51, "Result set does not exist"}, +{52, "Result set temporarily unavailable"}, +{53, "Result sets only supported for retrieval"}, +{54, "Retrieval may only occur from an existing result set"}, +{55, "Combination of result sets with search terms not supported"}, +{56, "Only combination of single result set with search terms supported"}, +{57, "Result set created but no records available"}, +{58, "Result set created with unpredictable partial results available"}, +{59, "Result set created with valid partial results available"}, +/* Diagnostics Relating to Records */ +{60, "Too many records retrieved"}, +{61, "First record position out of range"}, +{62, "Negative number of records requested"}, +{63, "System error in retrieving records"}, +{64, "Record temporarily unavailable"}, +{65, "Record does not exist"}, +{66, "Unknown schema for retrieval"}, +{67, "Record not available in this schema"}, +{68, "Not authorised to send record"}, +{69, "Not authorised to send record in this schema"}, +{70, "Record too large to send"}, +/* Diagnostics Relating to Sorting */ +{80, "Sort not supported"}, +{81, "Unsupported sort type (sortKeys vs xSortKeys)"}, +{82, "Illegal or unsupported sort sequence"}, +{83, "Too many records"}, +{84, "Too many sort keys"}, +{85, "Duplicate sort keys"}, +{86, "Incompatible record formats"}, +{87, "Unsupported schema for sort"}, +{88, "Unsupported tag path for sort"}, +{89, "Tag path illegal or unsupported for schema"}, +{90, "Illegal or unsupported direction value"}, +{91, "Illegal or unsupported case value"}, +{92, "Illegal or unsupported missing value action"}, +/* Diagnostics Relating to Explain */ +{100, "Explain not supported"}, +{101, "Explain request type not supported (SOAP vs GET)"}, +{102, "Explain record temporarily unavailable"}, +{0, 0} +}; + +const char *yaz_diag_srw_str (int code) +{ + int i; + for (i = 0; yaz_srw_codes[i].code; i++) + if (yaz_srw_codes[i].code == code) + return yaz_srw_codes[i].msg; + return 0; +} + + +/* bib1:srw */ +static int srw_bib1_map[] = { + 1, 1, + 2, 2, + 3, 11, + 4, 35, + 5, 12, + 6, 38, + 7, 30, + 8, 32, + 9, 29, + 10, 10, + 11, 12, + 11, 23, + 12, 60, + 13, 61, + 13, 62, + 14, 63, + 14, 64, + 14, 65, + 15, 68, + 15, 69, + 16, 70, + 17, 70, + 18, 50, + 19, 55, + 20, 56, + 21, 52, + 22, 50, + 23, 1, /* bad map */ + 24, 63, /* bad map */ + 25, 63, /* bad map */ + 26, 63, /* bad map */ + 27, 51, + 28, 52, + 29, 52, + 30, 51, + 31, 57, + 32, 58, + 33, 59, + 100, 1, /* bad map */ + 101, 3, + 102, 3, + 103, 3, + 104, 3, + 105, 3, + 106, 66, + 107, 11, + 108, 10, + 108, 13, + 108, 14, + 108, 25, + 108, 26, + 108, 27, + 108, 45, + + 109, 1, + 110, 37, + 111, 1, + 112, 58, + 113, 10, + 114, 16, + 115, 16, + 116, 16, + 117, 19, + 118, 22, + 119, 32, + 119, 31, + 120, 28, + 121, 15, + 122, 32, + 123, 22, + 123, 17, + 123, 18, + 124, 24, + 125, 36, + 126, 36, + 127, 36, + 128, 51, + 129, 39, + 130, 43, + 131, 40, + 132, 42, + 201, 44, + 201, 33, + 201, 34, + 202, 41, + 203, 43, + 205, 1, /* bad map */ + 206, 1, /* bad map */ + 207, 89, + 208, 1, /* bad map */ + 209, 80, + 210, 80, + 210, 81, + 211, 84, + 212, 85, + 213, 92, + 214, 90, + 215, 91, + 216, 92, + 217, 63, + 218, 1, /* bad map */ + 219, 1, /* bad map */ + 220, 1, /* bad map */ + 221, 1, /* bad map */ + 222, 1, /* bad map */ + 223, 1, /* bad map */ + 224, 1, /* bad map */ + 225, 1, /* bad map */ + 226, 1, /* bad map */ + 227, 66, + 228, 1, /* bad map */ + 229, 36, + 230, 83, + 231, 89, + 232, 1, + 233, 1, /* bad map */ + 234, 1, /* bad map */ + 235, 2, + 236, 3, + 237, 82, + 238, 67, + 239, 66, + 240, 1, /* bad map */ + 241, 1, /* bad map */ + 242, 70, + 243, 1, /* bad map */ + 244, 66, + 245, 10, + 246, 10, + 247, 10, + 1001, 1, /* bad map */ + 1002, 1, /* bad map */ + 1003, 1, /* bad map */ + 1004, 1, /* bad map */ + 1005, 1, /* bad map */ + 1006, 1, /* bad map */ + 1007, 100, + 1008, 1, + 1009, 1, + 1010, 3, + 1011, 3, + 1012, 3, + 1013, 3, + 1014, 3, + 1015, 3, + 1015, 3, + 1016, 3, + 1017, 3, + 1018, 2, + 1019, 2, + 1020, 2, + 1021, 3, + 1022, 3, + 1023, 3, + 1024, 16, + 1025, 3, + 1026, 64, + 1027, 1, + 1028, 65, + 1029, 1, + 1040, 1, + /* 1041-1065 */ + 1066, 66, + 1066, 67, + 0 +}; + +int yaz_diag_bib1_to_srw (int code) +{ + const int *p = srw_bib1_map; + while (*p) + { + if (code == p[0]) + return p[1]; + p += 2; + } + return 1; +} + +int yaz_diag_srw_to_bib1(int code) +{ + const int *p = srw_bib1_map; + while (*p) + { + if (code == p[1]) + return p[0]; + p += 2; + } + return 1; +} diff --git a/src/statserv.c b/src/statserv.c new file mode 100644 index 0000000..8d2629d --- /dev/null +++ b/src/statserv.c @@ -0,0 +1,961 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * NT threaded server code by + * Chas Woodfield, Fretwell Downing Informatics. + * + * $Id: statserv.c,v 1.1 2003-10-27 12:21:35 adam Exp $ + */ + +#include +#include +#ifdef WIN32 +#include +#include +#include +#include "service.h" +#else +#include +#include +#endif + +#if YAZ_POSIX_THREADS +#include +#elif YAZ_GNU_THREADS +#include +#endif + +#include +#include +#include + +#include +#include +#include +#ifdef USE_XTIMOSI +#include +#endif +#include +#include "eventl.h" +#include "session.h" +#include + +static IOCHAN pListener = NULL; + +static char *me = "statserver"; +/* + * default behavior. + */ +int check_options(int argc, char **argv); +statserv_options_block control_block = { + 1, /* dynamic mode */ + 0, /* threaded mode */ + 0, /* one shot (single session) */ + LOG_DEFAULT_LEVEL, /* log level */ + "", /* no PDUs */ + "", /* diagnostic output to stderr */ + "tcp:@:9999", /* default listener port */ + PROTO_Z3950, /* default application protocol */ + 15, /* idle timeout (minutes) */ + 1024*1024, /* maximum PDU size (approx.) to allow */ + "default-config", /* configuration name to pass to backend */ + "", /* set user id */ + 0, /* bend_start handler */ + 0, /* bend_stop handler */ + check_options, /* Default routine, for checking the run-time arguments */ + check_ip_tcpd, + "", + 0, /* default value for inet deamon */ + 0, /* handle (for service, etc) */ + 0, /* bend_init handle */ + 0, /* bend_close handle */ +#ifdef WIN32 + "Z39.50 Server", /* NT Service Name */ + "Server", /* NT application Name */ + "", /* NT Service Dependencies */ + "Z39.50 Server", /* NT Service Display Name */ +#endif /* WIN32 */ + 0 /* SOAP handlers */ +}; + +static int max_sessions = 0; + +/* + * handle incoming connect requests. + * The dynamic mode is a bit tricky mostly because we want to avoid + * doing all of the listening and accepting in the parent - it's + * safer that way. + */ +#ifdef WIN32 + +typedef struct _ThreadList ThreadList; + +struct _ThreadList +{ + HANDLE hThread; + IOCHAN pIOChannel; + ThreadList *pNext; +}; + +static ThreadList *pFirstThread; +static CRITICAL_SECTION Thread_CritSect; +static BOOL bInitialized = FALSE; + +static void ThreadList_Initialize() +{ + /* Initialize the critical Sections */ + InitializeCriticalSection(&Thread_CritSect); + + /* Set the first thraed */ + pFirstThread = NULL; + + /* we have been initialized */ + bInitialized = TRUE; +} + +static void statserv_add(HANDLE hThread, IOCHAN pIOChannel) +{ + /* Only one thread can go through this section at a time */ + EnterCriticalSection(&Thread_CritSect); + + { + /* Lets create our new object */ + ThreadList *pNewThread = (ThreadList *)malloc(sizeof(ThreadList)); + pNewThread->hThread = hThread; + pNewThread->pIOChannel = pIOChannel; + pNewThread->pNext = pFirstThread; + pFirstThread = pNewThread; + + /* Lets let somebody else create a new object now */ + LeaveCriticalSection(&Thread_CritSect); + } +} + +void statserv_remove(IOCHAN pIOChannel) +{ + /* Only one thread can go through this section at a time */ + EnterCriticalSection(&Thread_CritSect); + + { + ThreadList *pCurrentThread = pFirstThread; + ThreadList *pNextThread; + ThreadList *pPrevThread =NULL; + + /* Step through alll the threads */ + for (; pCurrentThread != NULL; pCurrentThread = pNextThread) + { + /* We only need to compare on the IO Channel */ + if (pCurrentThread->pIOChannel == pIOChannel) + { + /* We have found the thread we want to delete */ + /* First of all reset the next pointers */ + if (pPrevThread == NULL) + pFirstThread = pCurrentThread->pNext; + else + pPrevThread->pNext = pCurrentThread->pNext; + + /* All we need todo now is delete the memory */ + free(pCurrentThread); + + /* No need to look at any more threads */ + pNextThread = NULL; + } + else + { + /* We need to look at another thread */ + pNextThread = pCurrentThread->pNext; + pPrevThread = pCurrentThread; + } + } + + /* Lets let somebody else remove an object now */ + LeaveCriticalSection(&Thread_CritSect); + } +} + +/* WIN32 statserv_closedown */ +void statserv_closedown() +{ + /* Shouldn't do anything if we are not initialized */ + if (bInitialized) + { + int iHandles = 0; + HANDLE *pThreadHandles = NULL; + + /* We need to stop threads adding and removing while we */ + /* start the closedown process */ + EnterCriticalSection(&Thread_CritSect); + + { + /* We have exclusive access to the thread stuff now */ + /* Y didn't i use a semaphore - Oh well never mind */ + ThreadList *pCurrentThread = pFirstThread; + + /* Before we do anything else, we need to shutdown the listener */ + if (pListener != NULL) + iochan_destroy(pListener); + + for (; pCurrentThread != NULL; pCurrentThread = pCurrentThread->pNext) + { + /* Just destroy the IOCHAN, that should do the trick */ + iochan_destroy(pCurrentThread->pIOChannel); + closesocket(pCurrentThread->pIOChannel->fd); + + /* Keep a running count of our handles */ + iHandles++; + } + + if (iHandles > 0) + { + HANDLE *pCurrentHandle ; + + /* Allocate the thread handle array */ + pThreadHandles = (HANDLE *)malloc(sizeof(HANDLE) * iHandles); + pCurrentHandle = pThreadHandles; + + for (pCurrentThread = pFirstThread; + pCurrentThread != NULL; + pCurrentThread = pCurrentThread->pNext, pCurrentHandle++) + { + /* Just the handle */ + *pCurrentHandle = pCurrentThread->hThread; + } + } + + /* We can now leave the critical section */ + LeaveCriticalSection(&Thread_CritSect); + } + + /* Now we can really do something */ + if (iHandles > 0) + { + logf (LOG_LOG, "waiting for %d to die", iHandles); + /* This will now wait, until all the threads close */ + WaitForMultipleObjects(iHandles, pThreadHandles, TRUE, INFINITE); + + /* Free the memory we allocated for the handle array */ + free(pThreadHandles); + } + + if (control_block.bend_stop) + (*control_block.bend_stop)(&control_block); + /* No longer require the critical section, since all threads are dead */ + DeleteCriticalSection(&Thread_CritSect); + } +} + +void __cdecl event_loop_thread (IOCHAN iochan) +{ + event_loop (&iochan); +} + +/* WIN32 listener */ +static void listener(IOCHAN h, int event) +{ + COMSTACK line = (COMSTACK) iochan_getdata(h); + association *newas; + int res; + HANDLE newHandle; + + if (event == EVENT_INPUT) + { + if ((res = cs_listen(line, 0, 0)) < 0) + { + yaz_log(LOG_FATAL, "cs_listen failed"); + return; + } + else if (res == 1) + return; + yaz_log(LOG_DEBUG, "listen ok"); + iochan_setevent(h, EVENT_OUTPUT); + iochan_setflags(h, EVENT_OUTPUT | EVENT_EXCEPT); /* set up for acpt */ + } + else if (event == EVENT_OUTPUT) + { + COMSTACK new_line = cs_accept(line); + IOCHAN new_chan; + char *a = NULL; + + if (!new_line) + { + yaz_log(LOG_FATAL, "Accept failed."); + iochan_setflags(h, EVENT_INPUT | EVENT_EXCEPT); + return; + } + yaz_log(LOG_DEBUG, "Accept ok"); + + if (!(new_chan = iochan_create(cs_fileno(new_line), ir_session, + EVENT_INPUT))) + { + yaz_log(LOG_FATAL, "Failed to create iochan"); + iochan_destroy(h); + return; + } + + yaz_log(LOG_DEBUG, "Creating association"); + if (!(newas = create_association(new_chan, new_line))) + { + yaz_log(LOG_FATAL, "Failed to create new assoc."); + iochan_destroy(h); + return; + } + newas->cs_get_mask = EVENT_INPUT; + newas->cs_put_mask = 0; + newas->cs_accept_mask = 0; + + yaz_log(LOG_DEBUG, "Setting timeout %d", control_block.idle_timeout); + iochan_setdata(new_chan, newas); + iochan_settimeout(new_chan, 60); + + /* Now what we need todo is create a new thread with this iochan as + the parameter */ + newHandle = (HANDLE) _beginthread(event_loop_thread, 0, new_chan); + if (newHandle == (HANDLE) -1) + { + + yaz_log(LOG_FATAL|LOG_ERRNO, "Failed to create new thread."); + iochan_destroy(h); + return; + } + /* We successfully created the thread, so add it to the list */ + statserv_add(newHandle, new_chan); + + yaz_log(LOG_DEBUG, "Created new thread, id = %ld iochan %p",(long) newHandle, new_chan); + iochan_setflags(h, EVENT_INPUT | EVENT_EXCEPT); /* reset listener */ + } + else + { + yaz_log(LOG_FATAL, "Bad event on listener."); + iochan_destroy(h); + return; + } +} + +int statserv_must_terminate(void) +{ + return 0; +} + +#else /* ! WIN32 */ + +static int term_flag = 0; +/* To save having an #ifdef in event_loop we need to + define this empty function +*/ +int statserv_must_terminate(void) +{ + return term_flag; +} + +void statserv_remove(IOCHAN pIOChannel) +{ +} + +void statserv_closedown() +{ + IOCHAN p; + + if (control_block.bend_stop) + (*control_block.bend_stop)(&control_block); + for (p = pListener; p; p = p->next) + { + iochan_destroy(p); + } +} + +void sigterm(int sig) +{ + term_flag = 1; +} + +static void *new_session (void *vp); +static int no_sessions = 0; + +/* UNIX listener */ +static void listener(IOCHAN h, int event) +{ + COMSTACK line = (COMSTACK) iochan_getdata(h); + static int hand[2]; + static int child = 0; + int res; + + if (event == EVENT_INPUT) + { + if (control_block.dynamic && !child) + { + int res; + + ++no_sessions; + if (pipe(hand) < 0) + { + yaz_log(LOG_FATAL|LOG_ERRNO, "pipe"); + iochan_destroy(h); + return; + } + if ((res = fork()) < 0) + { + yaz_log(LOG_FATAL|LOG_ERRNO, "fork"); + iochan_destroy(h); + return; + } + else if (res == 0) /* child */ + { + char nbuf[100]; + IOCHAN pp; + + close(hand[0]); + child = 1; + for (pp = pListener; pp; pp = iochan_getnext(pp)) + { + if (pp != h) + { + COMSTACK l = (COMSTACK)iochan_getdata(pp); + cs_close(l); + iochan_destroy(pp); + } + } + sprintf(nbuf, "%s(%d)", me, getpid()); + yaz_log_init(control_block.loglevel, nbuf, 0); + /* ensure that bend_stop is not called when each child exits - + only for the main process .. + */ + control_block.bend_stop = 0; + } + else /* parent */ + { + close(hand[1]); + /* wait for child to take the call */ + for (;;) + { + char dummy[1]; + int res; + + if ((res = read(hand[0], dummy, 1)) < 0 && + yaz_errno() != EINTR) + { + yaz_log(LOG_FATAL|LOG_ERRNO, "handshake read"); + return; + } + else if (res >= 0) + break; + } + yaz_log(LOG_DEBUG, "P: Child has taken the call"); + close(hand[0]); + return; + } + } + if ((res = cs_listen_check(line, 0, 0, control_block.check_ip, + control_block.daemon_name)) < 0) + { + yaz_log(LOG_WARN|LOG_ERRNO, "cs_listen failed"); + return; + } + else if (res == 1) + return; + yaz_log(LOG_DEBUG, "listen ok"); + iochan_setevent(h, EVENT_OUTPUT); + iochan_setflags(h, EVENT_OUTPUT | EVENT_EXCEPT); /* set up for acpt */ + } + /* in dynamic mode, only the child ever comes down here */ + else if (event == EVENT_OUTPUT) + { + COMSTACK new_line = cs_accept(line); + + if (!new_line) + { + yaz_log(LOG_FATAL, "Accept failed."); + iochan_setflags(h, EVENT_INPUT | EVENT_EXCEPT); /* reset listener */ + return; + } + yaz_log(LOG_DEBUG, "accept ok"); + if (control_block.dynamic) + { + IOCHAN pp; + /* close our half of the listener socket */ + for (pp = pListener; pp; pp = iochan_getnext(pp)) + { + COMSTACK l = (COMSTACK)iochan_getdata(pp); + cs_close(l); + iochan_destroy(pp); + } + /* release dad */ + yaz_log(LOG_DEBUG, "Releasing parent"); + close(hand[1]); + } + else + { + iochan_setflags(h, EVENT_INPUT | EVENT_EXCEPT); /* reset listener */ + ++no_sessions; + } +#if YAZ_POSIX_THREADS + if (control_block.threads) + { + pthread_t child_thread; + pthread_create (&child_thread, 0, new_session, new_line); + pthread_detach (child_thread); + } + else + new_session(new_line); +#elif YAZ_GNU_THREADS + if (control_block.threads) + { + pth_attr_t attr; + pth_t child_thread; + + attr = pth_attr_new (); + pth_attr_set (attr, PTH_ATTR_JOINABLE, FALSE); + pth_attr_set (attr, PTH_ATTR_STACK_SIZE, 32*1024); + pth_attr_set (attr, PTH_ATTR_NAME, "session"); + yaz_log (LOG_LOG, "pth_spawn begin"); + child_thread = pth_spawn (attr, new_session, new_line); + yaz_log (LOG_LOG, "pth_spawn finish"); + pth_attr_destroy (attr); + } + else + new_session(new_line); +#else + new_session(new_line); +#endif + } + else if (event == EVENT_TIMEOUT) + { + yaz_log(LOG_LOG, "Shutting down listener."); + iochan_destroy(h); + } + else + { + yaz_log(LOG_FATAL, "Bad event on listener."); + iochan_destroy(h); + } +} + +static void *new_session (void *vp) +{ + char *a; + association *newas; + IOCHAN new_chan; + COMSTACK new_line = (COMSTACK) vp; + + unsigned cs_get_mask, cs_accept_mask, mask = + ((new_line->io_pending & CS_WANT_WRITE) ? EVENT_OUTPUT : 0) | + ((new_line->io_pending & CS_WANT_READ) ? EVENT_INPUT : 0); + + if (mask) + { + cs_accept_mask = mask; /* accept didn't complete */ + cs_get_mask = 0; + } + else + { + cs_accept_mask = 0; /* accept completed. */ + cs_get_mask = mask = EVENT_INPUT; + } + + if (!(new_chan = iochan_create(cs_fileno(new_line), ir_session, mask))) + { + yaz_log(LOG_FATAL, "Failed to create iochan"); + return 0; + } + if (!(newas = create_association(new_chan, new_line))) + { + yaz_log(LOG_FATAL, "Failed to create new assoc."); + return 0; + } + newas->cs_accept_mask = cs_accept_mask; + newas->cs_get_mask = cs_get_mask; + + iochan_setdata(new_chan, newas); + iochan_settimeout(new_chan, 60); +#if 1 + a = cs_addrstr(new_line); +#else + a = 0; +#endif + yaz_log(LOG_LOG, "Starting session %d from %s", + no_sessions, a ? a : "[Unknown]"); + if (max_sessions && no_sessions == max_sessions) + control_block.one_shot = 1; + if (control_block.threads) + { + event_loop(&new_chan); + } + else + { + new_chan->next = pListener; + pListener = new_chan; + } + return 0; +} + +/* UNIX */ +#endif + +static void inetd_connection(int what) +{ + COMSTACK line; + IOCHAN chan; + association *assoc; + char *addr; + + if ((line = cs_createbysocket(0, tcpip_type, 0, what))) + { + if ((chan = iochan_create(cs_fileno(line), ir_session, EVENT_INPUT))) + { + if ((assoc = create_association(chan, line))) + { + iochan_setdata(chan, assoc); + iochan_settimeout(chan, 60); + addr = cs_addrstr(line); + yaz_log(LOG_LOG, "Inetd association from %s", + addr ? addr : "[UNKNOWN]"); + assoc->cs_get_mask = EVENT_INPUT; + } + else + { + yaz_log(LOG_FATAL, "Failed to create association structure"); + } + chan->next = pListener; + pListener = chan; + } + else + { + yaz_log(LOG_FATAL, "Failed to create iochan"); + } + } + else + { + yaz_log(LOG_ERRNO|LOG_FATAL, "Failed to create comstack on socket 0"); + } +} + +/* + * Set up a listening endpoint, and give it to the event-handler. + */ +static int add_listener(char *where, int what) +{ + COMSTACK l; + void *ap; + IOCHAN lst = NULL; + const char *mode; + + if (control_block.dynamic) + mode = "dynamic"; + else if (control_block.threads) + mode = "threaded"; + else + mode = "static"; + + yaz_log(LOG_LOG, "Adding %s %s listener on %s", mode, + what == PROTO_SR ? "SR" : "Z3950", where); + + l = cs_create_host(where, 0, &ap); + if (!l) + { + yaz_log(LOG_FATAL|LOG_ERRNO, "Failed to listen on %s", where); + return -1; + } + if (cs_bind(l, ap, CS_SERVER) < 0) + { + yaz_log(LOG_FATAL|LOG_ERRNO, "Failed to bind to %s", where); + cs_close (l); + return -1; + } + if (!(lst = iochan_create(cs_fileno(l), listener, EVENT_INPUT | + EVENT_EXCEPT))) + { + yaz_log(LOG_FATAL|LOG_ERRNO, "Failed to create IOCHAN-type"); + cs_close (l); + return -1; + } + iochan_setdata(lst, l); + + /* Ensure our listener chain is setup properly */ + lst->next = pListener; + pListener = lst; + return 0; /* OK */ +} + +#ifndef WIN32 +/* UNIX only (for windows we don't need to catch the signals) */ +static void catchchld(int num) +{ + while (waitpid(-1, 0, WNOHANG) > 0) + ; + signal(SIGCHLD, catchchld); +} +#endif + +statserv_options_block *statserv_getcontrol(void) +{ + static statserv_options_block cb; + + memcpy(&cb, &control_block, sizeof(cb)); + return &cb; +} + +void statserv_setcontrol(statserv_options_block *block) +{ + memcpy(&control_block, block, sizeof(*block)); +} + +static void statserv_reset(void) +{ +} + +int statserv_start(int argc, char **argv) +{ + int ret; + +#ifdef WIN32 + /* We need to initialize the thread list */ + ThreadList_Initialize(); +/* WIN32 */ +#endif + +#ifdef WIN32 + if ((me = strrchr (argv[0], '\\'))) + me++; + else + me = argv[0]; +#else + me = argv[0]; +#endif + if (control_block.options_func(argc, argv)) + return(1); + + if (control_block.bend_start) + (*control_block.bend_start)(&control_block); +#ifdef WIN32 + yaz_log (LOG_LOG, "Starting server %s", me); +#else +/* UNIX */ + if (control_block.inetd) + inetd_connection(control_block.default_proto); + else + { + yaz_log (LOG_LOG, "Starting server %s pid=%d", me, getpid()); +#if 0 + sigset_t sigs_to_block; + + sigemptyset(&sigs_to_block); + sigaddset (&sigs_to_block, SIGTERM); + pthread_sigmask (SIG_BLOCK, &sigs_to_block, 0); + /* missing... */ +#endif + if (control_block.dynamic) + signal(SIGCHLD, catchchld); + } + signal (SIGPIPE, SIG_IGN); + signal (SIGTERM, sigterm); + if (*control_block.setuid) + { + struct passwd *pw; + + if (!(pw = getpwnam(control_block.setuid))) + { + yaz_log(LOG_FATAL, "%s: Unknown user", control_block.setuid); + return(1); + } + if (setuid(pw->pw_uid) < 0) + { + yaz_log(LOG_FATAL|LOG_ERRNO, "setuid"); + exit(1); + } + } +/* UNIX */ +#endif + + + if ((pListener == NULL) && *control_block.default_listen) + add_listener(control_block.default_listen, + control_block.default_proto); + + if (pListener == NULL) + ret = 1; + else + { + yaz_log(LOG_LOG, "Entering event loop."); + ret = event_loop(&pListener); + } + return ret; +} + +int check_options(int argc, char **argv) +{ + int ret = 0, r; + char *arg; + + while ((ret = options("1a:iszSTl:v:u:c:w:t:k:d:D:", argv, argc, &arg)) != -2) + { + switch (ret) + { + case 0: + if (add_listener(arg, control_block.default_proto)) + return 1; /* failed to create listener */ + break; + case '1': + control_block.one_shot = 1; + control_block.dynamic = 0; + break; + case 'z': + control_block.default_proto = PROTO_Z3950; + break; + case 's': + fprintf (stderr, "%s: SR protocol no longer supported\n", me); + exit (1); + break; + case 'S': + control_block.dynamic = 0; + break; + case 'T': +#if YAZ_POSIX_THREADS + control_block.dynamic = 0; + control_block.threads = 1; +#elif YAZ_GNU_THREADS + control_block.dynamic = 0; + control_block.threads = 1; +#else + fprintf(stderr, "%s: Threaded mode not available.\n", me); + return 1; +#endif + break; + case 'l': + strcpy(control_block.logfile, arg ? arg : ""); + yaz_log_init(control_block.loglevel, me, control_block.logfile); + break; + case 'v': + control_block.loglevel = yaz_log_mask_str(arg); + yaz_log_init(control_block.loglevel, me, control_block.logfile); + break; + case 'a': + strcpy(control_block.apdufile, arg ? arg : ""); + break; + case 'u': + strcpy(control_block.setuid, arg ? arg : ""); + break; + case 'c': + strcpy(control_block.configname, arg ? arg : ""); + break; + case 'd': + strcpy(control_block.daemon_name, arg ? arg : ""); + break; + case 't': + if (!arg || !(r = atoi(arg))) + { + fprintf(stderr, "%s: Specify positive timeout for -t.\n", me); + return(1); + } + control_block.idle_timeout = r; + break; + case 'k': + if (!arg || !(r = atoi(arg))) + { + fprintf(stderr, "%s: Specify positive size for -k.\n", me); + return(1); + } + control_block.maxrecordsize = r * 1024; + break; + case 'i': + control_block.inetd = 1; + break; + case 'w': + if (chdir(arg)) + { + perror(arg); + return 1; + } + break; + case 'D': + max_sessions = atoi(arg); + break; + default: + fprintf(stderr, "Usage: %s [ -a -v " + " -l -u -c -t " + " -k -d " + " -ziST1 -w ... ]\n", me); + return 1; + } + } + return 0; +} + +#ifdef WIN32 +typedef struct _Args +{ + char **argv; + int argc; +} Args; + +static Args ArgDetails; + +/* name of the executable */ +#define SZAPPNAME "server" + +/* list of service dependencies - "dep1\0dep2\0\0" */ +#define SZDEPENDENCIES "" + +int statserv_main(int argc, char **argv, + bend_initresult *(*bend_init)(bend_initrequest *r), + void (*bend_close)(void *handle)) +{ + statserv_options_block *cb = statserv_getcontrol(); + + cb->bend_init = bend_init; + cb->bend_close = bend_close; + + statserv_setcontrol(cb); + + /* Lets setup the Arg structure */ + ArgDetails.argc = argc; + ArgDetails.argv = argv; + + /* Now setup the service with the service controller */ + SetupService(argc, argv, &ArgDetails, SZAPPNAME, + cb->service_name, /* internal service name */ + cb->service_display_name, /* displayed name */ + SZDEPENDENCIES); + return 0; +} + +int StartAppService(void *pHandle, int argc, char **argv) +{ + /* Initializes the App */ + return 1; +} + +void RunAppService(void *pHandle) +{ + Args *pArgs = (Args *)pHandle; + + /* Starts the app running */ + statserv_start(pArgs->argc, pArgs->argv); +} + +void StopAppService(void *pHandle) +{ + /* Stops the app */ + statserv_closedown(); + statserv_reset(); +} +/* WIN32 */ +#else +/* UNIX */ +int statserv_main(int argc, char **argv, + bend_initresult *(*bend_init)(bend_initrequest *r), + void (*bend_close)(void *handle)) +{ + int ret; + statserv_options_block *cb = statserv_getcontrol(); + + cb->bend_init = bend_init; + cb->bend_close = bend_close; + + statserv_setcontrol(cb); + ret = statserv_start (argc, argv); + statserv_closedown (); + statserv_reset(); + return ret; +} +#endif diff --git a/src/tcpdchk.c b/src/tcpdchk.c new file mode 100644 index 0000000..5b9d234 --- /dev/null +++ b/src/tcpdchk.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 1995-2000, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Log: tcpdchk.c,v $ + * Revision 1.1 2003-10-27 12:21:35 adam + * Source restructure. yaz-marcdump part of installation + * + * Revision 1.5 2000/02/28 11:20:06 adam + * Using autoconf. New definitions: YAZ_BEGIN_CDECL/YAZ_END_CDECL. + * + * Revision 1.4 1999/11/30 13:47:12 adam + * Improved installation. Moved header files to include/yaz. + * + * Revision 1.3 1999/08/27 09:40:32 adam + * Renamed logf function to yaz_log. Removed VC++ project files. + * + * Revision 1.2 1999/04/20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.1 1999/04/16 14:45:55 adam + * Added interface for tcpd wrapper for access control. + * + */ + +#include +#include + +#include +#include + +#if HAVE_TCPD_H +#include +#include + + +int allow_severity = LOG_INFO; +int deny_severity = LOG_WARNING; + +#ifdef LOG_DEBUG +#undef LOG_DEBUG +#endif +#ifdef LOG_WARN +#undef LOG_WARN +#endif + +#endif + +#include +#include + +int check_ip_tcpd(void *cd, const char *addr, int len, int type) +{ + const char *daemon_name = (const char *) cd; + + if (type == AF_INET) + { + if (daemon_name && *daemon_name) + { +#if HAVE_TCPD_H + struct request_info request_info; + int i; +#endif + char *host_name = 0, *host_addr = 0; + struct hostent *host; + + struct sockaddr_in *addr_in = (struct sockaddr_in *) addr; + + if ((host = gethostbyaddr((char*)&addr_in->sin_addr, + sizeof(addr_in->sin_addr), + AF_INET))) + host_name = (char*) host->h_name; + host_addr = inet_ntoa(addr_in->sin_addr); +#if HAVE_TCPD_H + if (host_addr) + request_init(&request_info, RQ_DAEMON, daemon_name, + RQ_CLIENT_NAME, host_name, + RQ_CLIENT_SIN, addr_in, + RQ_CLIENT_ADDR, host_addr, 0); + else + request_init(&request_info, RQ_DAEMON, daemon_name, + RQ_CLIENT_SIN, addr_in, + RQ_CLIENT_ADDR, host_addr, 0); + i = hosts_access(&request_info); + if (!i) + { + yaz_log (LOG_DEBUG, "access denied from %s", + host_name ? host_name : host_addr); + return 1; + } + yaz_log (LOG_DEBUG, "access granted from %s", + host_name ? host_name : host_addr); +#endif + } + } + return 0; +} + diff --git a/src/tcpip.c b/src/tcpip.c new file mode 100644 index 0000000..4425867 --- /dev/null +++ b/src/tcpip.c @@ -0,0 +1,1100 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * + * $Id: tcpip.c,v 1.1 2003-10-27 12:21:35 adam Exp $ + */ + +#include +#include +#include + +#ifdef WIN32 +#else +#include +#endif + +#include +#include +#include +#if HAVE_OPENSSL_SSL_H +#include +#include +#endif + +#include +#include +#include +#include + +#ifdef WIN32 +#else +#include +#endif + +static int tcpip_close(COMSTACK h); +static int tcpip_put(COMSTACK h, char *buf, int size); +static int tcpip_get(COMSTACK h, char **buf, int *bufsize); +static int tcpip_connect(COMSTACK h, void *address); +static int tcpip_more(COMSTACK h); +static int tcpip_rcvconnect(COMSTACK h); +static int tcpip_bind(COMSTACK h, void *address, int mode); +static int tcpip_listen(COMSTACK h, char *raddr, int *addrlen, + int (*check_ip)(void *cd, const char *a, int len, int type), + void *cd); +static int tcpip_set_blocking(COMSTACK p, int blocking); + +#if HAVE_OPENSSL_SSL_H +static int ssl_get(COMSTACK h, char **buf, int *bufsize); +static int ssl_put(COMSTACK h, char *buf, int size); +#endif + +static COMSTACK tcpip_accept(COMSTACK h); +static char *tcpip_addrstr(COMSTACK h); +static void *tcpip_straddr(COMSTACK h, const char *str); + +#if 0 +#define TRC(x) x +#else +#define TRC(X) +#endif + +#ifndef YAZ_SOCKLEN_T +#define YAZ_SOCKLEN_T int +#endif + +/* this state is used for both SSL and straight TCP/IP */ +typedef struct tcpip_state +{ + char *altbuf; /* alternate buffer for surplus data */ + int altsize; /* size as xmalloced */ + int altlen; /* length of data or 0 if none */ + + int written; /* -1 if we aren't writing */ + int towrite; /* to verify against user input */ + int (*complete)(const unsigned char *buf, int len); /* length/comple. */ + struct sockaddr_in addr; /* returned by cs_straddr */ + char buf[128]; /* returned by cs_addrstr */ +#if HAVE_OPENSSL_SSL_H + SSL_CTX *ctx; + SSL_CTX *ctx_alloc; + SSL *ssl; +#endif +} tcpip_state; + +#ifdef WIN32 +static int tcpip_init (void) +{ + static int initialized = 0; + if (!initialized) + { + WORD requested; + WSADATA wd; + + requested = MAKEWORD(1, 1); + if (WSAStartup(requested, &wd)) + return 0; + initialized = 1; + } + return 1; +} +#else +static int tcpip_init (void) +{ + return 1; +} +#endif + +/* + * This function is always called through the cs_create() macro. + * s >= 0: socket has already been established for us. + */ +COMSTACK tcpip_type(int s, int blocking, int protocol, void *vp) +{ + COMSTACK p; + tcpip_state *state; + int new_socket; +#ifdef WIN32 + unsigned long tru = 1; +#endif + + if (!tcpip_init ()) + return 0; + if (s < 0) + { + if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) + return 0; + new_socket = 1; + } + else + new_socket = 0; + if (!(p = (struct comstack *)xmalloc(sizeof(struct comstack)))) + return 0; + if (!(state = (struct tcpip_state *)(p->cprivate = + xmalloc(sizeof(tcpip_state))))) + return 0; + + if (!((p->blocking = blocking)&1)) + { +#ifdef WIN32 + if (ioctlsocket(s, FIONBIO, &tru) < 0) + return 0; +#else + if (fcntl(s, F_SETFL, O_NONBLOCK) < 0) + return 0; +#ifndef MSG_NOSIGNAL + signal (SIGPIPE, SIG_IGN); +#endif +#endif + } + + p->io_pending = 0; + p->iofile = s; + p->type = tcpip_type; + p->protocol = (enum oid_proto) protocol; + + p->f_connect = tcpip_connect; + p->f_rcvconnect = tcpip_rcvconnect; + p->f_get = tcpip_get; + p->f_put = tcpip_put; + p->f_close = tcpip_close; + p->f_more = tcpip_more; + p->f_bind = tcpip_bind; + p->f_listen = tcpip_listen; + p->f_accept = tcpip_accept; + p->f_addrstr = tcpip_addrstr; + p->f_straddr = tcpip_straddr; + p->f_set_blocking = tcpip_set_blocking; + + p->state = new_socket ? CS_ST_UNBND : CS_ST_IDLE; /* state of line */ + p->event = CS_NONE; + p->cerrno = 0; + p->stackerr = 0; + +#if HAVE_OPENSSL_SSL_H + state->ctx = state->ctx_alloc = 0; + state->ssl = 0; +#endif + + state->altbuf = 0; + state->altsize = state->altlen = 0; + state->towrite = state->written = -1; + if (protocol == PROTO_WAIS) + state->complete = completeWAIS; + else + state->complete = cs_complete_auto; + + p->timeout = COMSTACK_DEFAULT_TIMEOUT; + TRC(fprintf(stderr, "Created new TCPIP comstack\n")); + + return p; +} + +#if HAVE_OPENSSL_SSL_H + +COMSTACK ssl_type(int s, int blocking, int protocol, void *vp) +{ + tcpip_state *state; + COMSTACK p; + yaz_log(LOG_LOG, "ssl_type begin"); + + p = tcpip_type (s, blocking, protocol, 0); + if (!p) + return 0; + p->f_get = ssl_get; + p->f_put = ssl_put; + p->type = ssl_type; + state = (tcpip_state *) p->cprivate; + if (vp) + state->ctx = vp; + else + { + SSL_load_error_strings(); + SSLeay_add_all_algorithms(); + + state->ctx = state->ctx_alloc = SSL_CTX_new (SSLv23_method()); + if (!state->ctx) + { + tcpip_close(p); + return 0; + } + } + /* note: we don't handle already opened socket in SSL mode - yet */ + yaz_log(LOG_LOG, "ssl_type end"); + return p; +} +#endif + +int tcpip_strtoaddr_ex(const char *str, struct sockaddr_in *add, + int default_port) +{ + struct hostent *hp; + char *p, buf[512]; + short int port = default_port; + unsigned tmpadd; + + if (!tcpip_init ()) + return 0; + TRC(fprintf(stderr, "tcpip_strtoaddress: %s\n", str ? str : "NULL")); + add->sin_family = AF_INET; + strncpy(buf, str, 511); + buf[511] = 0; + if ((p = strchr(buf, '/'))) + *p = 0; + if ((p = strchr(buf, ':'))) + { + *p = 0; + port = atoi(p + 1); + } + add->sin_port = htons(port); + if (!strcmp("@", buf)) + add->sin_addr.s_addr = INADDR_ANY; + else if ((hp = gethostbyname(buf))) + memcpy(&add->sin_addr.s_addr, *hp->h_addr_list, + sizeof(struct in_addr)); + else if ((tmpadd = (unsigned) inet_addr(buf)) != 0) + memcpy(&add->sin_addr.s_addr, &tmpadd, sizeof(struct in_addr)); + else + return 0; + return 1; +} + +void *tcpip_straddr(COMSTACK h, const char *str) +{ + tcpip_state *sp = (tcpip_state *)h->cprivate; + int port = 210; + + if (h->protocol == PROTO_HTTP) + port = 80; + + if (!tcpip_strtoaddr_ex (str, &sp->addr, port)) + return 0; + return &sp->addr; +} + +struct sockaddr_in *tcpip_strtoaddr(const char *str) +{ + static struct sockaddr_in add; + + if (!tcpip_strtoaddr_ex (str, &add, 210)) + return 0; + return &add; +} + +int tcpip_more(COMSTACK h) +{ + tcpip_state *sp = (tcpip_state *)h->cprivate; + + return sp->altlen && (*sp->complete)((unsigned char *) sp->altbuf, + sp->altlen); +} + +/* + * connect(2) will block (sometimes) - nothing we can do short of doing + * weird things like spawning subprocesses or threading or some weird junk + * like that. + */ +int tcpip_connect(COMSTACK h, void *address) +{ + struct sockaddr_in *add = (struct sockaddr_in *)address; +#if HAVE_OPENSSL_SSL_H + tcpip_state *sp = (tcpip_state *)h->cprivate; +#endif + int r; +#ifdef __sun__ + int recbuflen; + YAZ_SOCKLEN_T rbufsize = sizeof(recbuflen); +#endif + TRC(fprintf(stderr, "tcpip_connect\n")); + h->io_pending = 0; + if (h->state != CS_ST_UNBND) + { + h->cerrno = CSOUTSTATE; + return -1; + } +#ifdef __sun__ + /* On Suns, you must set a bigger Receive Buffer BEFORE a call to connect + * This gives the connect a chance to negotiate with the other side + * (see 'man tcp') + */ + if ( getsockopt(h->iofile, SOL_SOCKET, SO_RCVBUF, (void *)&recbuflen, &rbufsize ) < 0 ) + { + h->cerrno = CSYSERR; + return -1; + } + TRC(fprintf( stderr, "Current Size of TCP Receive Buffer= %d\n", + recbuflen )); + recbuflen *= 10; /* lets be optimistic */ + if ( setsockopt(h->iofile, SOL_SOCKET, SO_RCVBUF, (void *)&recbuflen, rbufsize ) < 0 ) + { + h->cerrno = CSYSERR; + return -1; + } + if ( getsockopt(h->iofile, SOL_SOCKET, SO_RCVBUF, (void *)&recbuflen, &rbufsize ) ) + { + h->cerrno = CSYSERR; + return -1; + } + TRC(fprintf( stderr, "New Size of TCP Receive Buffer = %d\n", + recbuflen )); +#endif + r = connect(h->iofile, (struct sockaddr *) add, sizeof(*add)); + if (r < 0) + { +#ifdef WIN32 + if (WSAGetLastError() == WSAEWOULDBLOCK) + { + h->event = CS_CONNECT; + h->state = CS_ST_CONNECTING; + h->io_pending = CS_WANT_WRITE; + return 1; + } +#else + if (yaz_errno() == EINPROGRESS) + { + h->event = CS_CONNECT; + h->state = CS_ST_CONNECTING; + h->io_pending = CS_WANT_WRITE|CS_WANT_READ; + return 1; + } +#endif + h->cerrno = CSYSERR; + return -1; + } + h->event = CS_CONNECT; + h->state = CS_ST_CONNECTING; + + return tcpip_rcvconnect (h); +} + +/* + * nop + */ +int tcpip_rcvconnect(COMSTACK h) +{ +#if HAVE_OPENSSL_SSL_H + tcpip_state *sp = (tcpip_state *)h->cprivate; +#endif + TRC(fprintf(stderr, "tcpip_rcvconnect\n")); + + if (h->state == CS_ST_DATAXFER) + return 0; + if (h->state != CS_ST_CONNECTING) + { + h->cerrno = CSOUTSTATE; + return -1; + } +#if HAVE_OPENSSL_SSL_H + if (sp->ctx) + { + int res; + + if (!sp->ssl) + { + sp->ssl = SSL_new (sp->ctx); + SSL_set_fd (sp->ssl, h->iofile); + } + res = SSL_connect (sp->ssl); + if (res <= 0) + { + int err = SSL_get_error(sp->ssl, res); + if (err == SSL_ERROR_WANT_READ) + { + h->io_pending = CS_WANT_READ; + return 1; + } + if (err == SSL_ERROR_WANT_WRITE) + { + h->io_pending = CS_WANT_WRITE; + return 1; + } + h->cerrno = CSERRORSSL; + return -1; + } + } +#endif + h->event = CS_DATA; + h->state = CS_ST_DATAXFER; + return 0; +} + +#define CERTF "ztest.pem" +#define KEYF "ztest.pem" + +static void tcpip_setsockopt (int fd) +{ +#if 0 + int len = 4096; + int set = 1; + + if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int))) + { + yaz_log(LOG_WARN|LOG_ERRNO, "setsockopt TCP_NODELAY"); + } + if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int))) + { + yaz_log(LOG_WARN|LOG_ERRNO, "setsockopt SNDBUF"); + } + if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int))) + { + yaz_log(LOG_WARN|LOG_ERRNO, "setsockopt RCVBUF"); + } +#endif +} + +static int tcpip_bind(COMSTACK h, void *address, int mode) +{ + struct sockaddr *addr = (struct sockaddr *)address; +#ifdef WIN32 + BOOL one = 1; +#else + unsigned long one = 1; +#endif + +#if HAVE_OPENSSL_SSL_H + tcpip_state *sp = (tcpip_state *)h->cprivate; + if (sp->ctx) + { + if (sp->ctx_alloc) + { + int res; + res = SSL_CTX_use_certificate_file (sp->ctx, CERTF, + SSL_FILETYPE_PEM); + if (res <= 0) + { + ERR_print_errors_fp(stderr); + exit (2); + } + res = SSL_CTX_use_PrivateKey_file (sp->ctx, KEYF, + SSL_FILETYPE_PEM); + if (res <= 0) + { + ERR_print_errors_fp(stderr); + exit (3); + } + res = SSL_CTX_check_private_key (sp->ctx); + if (res <= 0) + { + ERR_print_errors_fp(stderr); + exit(5); + } + } + TRC (fprintf (stderr, "ssl_bind\n")); + } + else + { + TRC (fprintf (stderr, "tcpip_bind\n")); + } +#else + TRC (fprintf (stderr, "tcpip_bind\n")); +#endif +#ifndef WIN32 + if (setsockopt(h->iofile, SOL_SOCKET, SO_REUSEADDR, (char*) + &one, sizeof(one)) < 0) + { + h->cerrno = CSYSERR; + return -1; + } +#endif + tcpip_setsockopt(h->iofile); + if (bind(h->iofile, addr, sizeof(struct sockaddr_in))) + { + h->cerrno = CSYSERR; + return -1; + } + if (mode == CS_SERVER && listen(h->iofile, 3) < 0) + { + h->cerrno = CSYSERR; + return -1; + } + h->state = CS_ST_IDLE; + h->event = CS_LISTEN; + return 0; +} + +int tcpip_listen(COMSTACK h, char *raddr, int *addrlen, + int (*check_ip)(void *cd, const char *a, int len, int t), + void *cd) +{ + struct sockaddr_in addr; + YAZ_SOCKLEN_T len = sizeof(addr); + + TRC(fprintf(stderr, "tcpip_listen pid=%d\n", getpid())); + if (h->state != CS_ST_IDLE) + { + h->cerrno = CSOUTSTATE; + return -1; + } + h->newfd = accept(h->iofile, (struct sockaddr*)&addr, &len); + if (h->newfd < 0) + { + if ( +#ifdef WIN32 + WSAGetLastError() == WSAEWOULDBLOCK +#else + yaz_errno() == EWOULDBLOCK +#ifdef EAGAIN +#if EAGAIN != EWOULDBLOCK + || yaz_errno() == EAGAIN +#endif +#endif +#endif + ) + h->cerrno = CSNODATA; + else + h->cerrno = CSYSERR; + return -1; + } + if (addrlen && (size_t) (*addrlen) >= sizeof(struct sockaddr_in)) + memcpy(raddr, &addr, *addrlen = sizeof(struct sockaddr_in)); + else if (addrlen) + *addrlen = 0; + if (check_ip && (*check_ip)(cd, (const char *) &addr, + sizeof(addr), AF_INET)) + { + h->cerrno = CSDENY; +#ifdef WIN32 + closesocket(h->newfd); +#else + close(h->newfd); +#endif + h->newfd = -1; + return -1; + } + h->state = CS_ST_INCON; + tcpip_setsockopt (h->newfd); + return 0; +} + +COMSTACK tcpip_accept(COMSTACK h) +{ + COMSTACK cnew; + tcpip_state *state, *st = (tcpip_state *)h->cprivate; +#ifdef WIN32 + unsigned long tru = 1; +#endif + + TRC(fprintf(stderr, "tcpip_accept\n")); + if (h->state == CS_ST_INCON) + { + if (!(cnew = (COMSTACK)xmalloc(sizeof(*cnew)))) + { + h->cerrno = CSYSERR; +#ifdef WIN32 + closesocket(h->newfd); +#else + close(h->newfd); +#endif + h->newfd = -1; + return 0; + } + memcpy(cnew, h, sizeof(*h)); + cnew->iofile = h->newfd; + cnew->io_pending = 0; + if (!(state = (tcpip_state *) + (cnew->cprivate = xmalloc(sizeof(tcpip_state))))) + { + h->cerrno = CSYSERR; + if (h->newfd != -1) + { +#ifdef WIN32 + closesocket(h->newfd); +#else + close(h->newfd); +#endif + h->newfd = -1; + } + return 0; + } + if (!(cnew->blocking&1) && +#ifdef WIN32 + (ioctlsocket(cnew->iofile, FIONBIO, &tru) < 0) +#else + (fcntl(cnew->iofile, F_SETFL, O_NONBLOCK) < 0) +#endif + ) + { + h->cerrno = CSYSERR; + if (h->newfd != -1) + { +#ifdef WIN32 + closesocket(h->newfd); +#else + close(h->newfd); +#endif + h->newfd = -1; + } + xfree (cnew); + xfree (state); + return 0; + } + h->newfd = -1; + state->altbuf = 0; + state->altsize = state->altlen = 0; + state->towrite = state->written = -1; + state->complete = st->complete; + cnew->state = CS_ST_ACCEPT; + h->state = CS_ST_IDLE; + +#if HAVE_OPENSSL_SSL_H + state->ctx = st->ctx; + state->ctx_alloc = 0; + state->ssl = st->ssl; + if (state->ctx) + { + state->ssl = SSL_new (state->ctx); + SSL_set_fd (state->ssl, cnew->iofile); + } +#endif + h = cnew; + } + if (h->state == CS_ST_ACCEPT) + { +#if HAVE_OPENSSL_SSL_H + tcpip_state *state = (tcpip_state *)h->cprivate; + if (state->ctx) + { + int res = SSL_accept (state->ssl); + TRC(fprintf(stderr, "SSL_accept\n")); + if (res <= 0) + { + int err = SSL_get_error(state->ssl, res); + if (err == SSL_ERROR_WANT_READ) + { + h->io_pending = CS_WANT_READ; + return h; + } + if (err == SSL_ERROR_WANT_WRITE) + { + h->io_pending = CS_WANT_WRITE; + return h; + } + cs_close (h); + return 0; + } + } +#endif + } + else + { + h->cerrno = CSOUTSTATE; + return 0; + } + h->io_pending = 0; + h->state = CS_ST_DATAXFER; + h->event = CS_DATA; + return h; +} + +#define CS_TCPIP_BUFCHUNK 4096 + +/* + * Return: -1 error, >1 good, len of buffer, ==1 incomplete buffer, + * 0=connection closed. + */ +int tcpip_get(COMSTACK h, char **buf, int *bufsize) +{ + tcpip_state *sp = (tcpip_state *)h->cprivate; + char *tmpc; + int tmpi, berlen, rest, req, tomove; + int hasread = 0, res; + + TRC(fprintf(stderr, "tcpip_get: bufsize=%d\n", *bufsize)); + if (sp->altlen) /* switch buffers */ + { + TRC(fprintf(stderr, " %d bytes in altbuf (0x%x)\n", sp->altlen, + (unsigned) sp->altbuf)); + tmpc = *buf; + tmpi = *bufsize; + *buf = sp->altbuf; + *bufsize = sp->altsize; + hasread = sp->altlen; + sp->altlen = 0; + sp->altbuf = tmpc; + sp->altsize = tmpi; + } + h->io_pending = 0; + while (!(berlen = (*sp->complete)((unsigned char *)*buf, hasread))) + { + if (!*bufsize) + { + if (!(*buf = (char *)xmalloc(*bufsize = CS_TCPIP_BUFCHUNK))) + return -1; + } + else if (*bufsize - hasread < CS_TCPIP_BUFCHUNK) + if (!(*buf =(char *)xrealloc(*buf, *bufsize *= 2))) + return -1; +#ifdef __sun__ + yaz_set_errno( 0 ); + /* unfortunatly, sun sometimes forgets to set errno in recv + when EWOULDBLOCK etc. would be required (res = -1) */ +#endif + res = recv(h->iofile, *buf + hasread, CS_TCPIP_BUFCHUNK, 0); + TRC(fprintf(stderr, " recv res=%d, hasread=%d\n", res, hasread)); + if (res < 0) + { + TRC(fprintf(stderr, " recv errno=%d, (%s)\n", yaz_errno(), + strerror(yaz_errno()))); +#ifdef WIN32 + if (WSAGetLastError() == WSAEWOULDBLOCK) + { + h->io_pending = CS_WANT_READ; + break; + } + else + return -1; +#else + if (yaz_errno() == EWOULDBLOCK +#ifdef EAGAIN +#if EAGAIN != EWOULDBLOCK + || yaz_errno() == EAGAIN +#endif +#endif + || yaz_errno() == EINPROGRESS +#ifdef __sun__ + || yaz_errno() == ENOENT /* Sun's sometimes set errno to this */ +#endif + ) + { + h->io_pending = CS_WANT_READ; + break; + } + else if (yaz_errno() == 0) + continue; + else + return -1; +#endif + } + else if (!res) + return 0; + hasread += res; + } + TRC (fprintf (stderr, " Out of read loop with hasread=%d, berlen=%d\n", + hasread, berlen)); + /* move surplus buffer (or everything if we didn't get a BER rec.) */ + if (hasread > berlen) + { + tomove = req = hasread - berlen; + rest = tomove % CS_TCPIP_BUFCHUNK; + if (rest) + req += CS_TCPIP_BUFCHUNK - rest; + if (!sp->altbuf) + { + if (!(sp->altbuf = (char *)xmalloc(sp->altsize = req))) + return -1; + } else if (sp->altsize < req) + if (!(sp->altbuf =(char *)xrealloc(sp->altbuf, sp->altsize = req))) + return -1; + TRC(fprintf(stderr, " Moving %d bytes to altbuf(0x%x)\n", tomove, + (unsigned) sp->altbuf)); + memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove); + } + if (berlen < CS_TCPIP_BUFCHUNK - 1) + *(*buf + berlen) = '\0'; + return berlen ? berlen : 1; +} + + +#if HAVE_OPENSSL_SSL_H +/* + * Return: -1 error, >1 good, len of buffer, ==1 incomplete buffer, + * 0=connection closed. + */ +int ssl_get(COMSTACK h, char **buf, int *bufsize) +{ + tcpip_state *sp = (tcpip_state *)h->cprivate; + char *tmpc; + int tmpi, berlen, rest, req, tomove; + int hasread = 0, res; + + TRC(fprintf(stderr, "ssl_get: bufsize=%d\n", *bufsize)); + if (sp->altlen) /* switch buffers */ + { + TRC(fprintf(stderr, " %d bytes in altbuf (0x%x)\n", sp->altlen, + (unsigned) sp->altbuf)); + tmpc = *buf; + tmpi = *bufsize; + *buf = sp->altbuf; + *bufsize = sp->altsize; + hasread = sp->altlen; + sp->altlen = 0; + sp->altbuf = tmpc; + sp->altsize = tmpi; + } + h->io_pending = 0; + while (!(berlen = (*sp->complete)((unsigned char *)*buf, hasread))) + { + if (!*bufsize) + { + if (!(*buf = (char *)xmalloc(*bufsize = CS_TCPIP_BUFCHUNK))) + return -1; + } + else if (*bufsize - hasread < CS_TCPIP_BUFCHUNK) + if (!(*buf =(char *)xrealloc(*buf, *bufsize *= 2))) + return -1; + res = SSL_read (sp->ssl, *buf + hasread, CS_TCPIP_BUFCHUNK); + TRC(fprintf(stderr, " SSL_read res=%d, hasread=%d\n", res, hasread)); + if (res <= 0) + { + int ssl_err = SSL_get_error(sp->ssl, res); + if (ssl_err == SSL_ERROR_WANT_READ) + { + h->io_pending = CS_WANT_READ; + break; + } + if (ssl_err == SSL_ERROR_WANT_WRITE) + { + h->io_pending = CS_WANT_WRITE; + break; + } + if (res == 0) + return 0; + h->cerrno = CSERRORSSL; + return -1; + } + hasread += res; + } + TRC (fprintf (stderr, " Out of read loop with hasread=%d, berlen=%d\n", + hasread, berlen)); + /* move surplus buffer (or everything if we didn't get a BER rec.) */ + if (hasread > berlen) + { + tomove = req = hasread - berlen; + rest = tomove % CS_TCPIP_BUFCHUNK; + if (rest) + req += CS_TCPIP_BUFCHUNK - rest; + if (!sp->altbuf) + { + if (!(sp->altbuf = (char *)xmalloc(sp->altsize = req))) + return -1; + } else if (sp->altsize < req) + if (!(sp->altbuf =(char *)xrealloc(sp->altbuf, sp->altsize = req))) + return -1; + TRC(fprintf(stderr, " Moving %d bytes to altbuf(0x%x)\n", tomove, + (unsigned) sp->altbuf)); + memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove); + } + if (berlen < CS_TCPIP_BUFCHUNK - 1) + *(*buf + berlen) = '\0'; + return berlen ? berlen : 1; +} +#endif + +/* + * Returns 1, 0 or -1 + * In nonblocking mode, you must call again with same buffer while + * return value is 1. + */ +int tcpip_put(COMSTACK h, char *buf, int size) +{ + int res; + struct tcpip_state *state = (struct tcpip_state *)h->cprivate; + + TRC(fprintf(stderr, "tcpip_put: size=%d\n", size)); + h->io_pending = 0; + h->event = CS_DATA; + if (state->towrite < 0) + { + state->towrite = size; + state->written = 0; + } + else if (state->towrite != size) + { + h->cerrno = CSWRONGBUF; + return -1; + } + while (state->towrite > state->written) + { + if ((res = + send(h->iofile, buf + state->written, size - + state->written, +#ifdef MSG_NOSIGNAL + MSG_NOSIGNAL +#else + 0 +#endif + )) < 0) + { + if ( +#ifdef WIN32 + WSAGetLastError() == WSAEWOULDBLOCK +#else + yaz_errno() == EWOULDBLOCK +#ifdef EAGAIN +#if EAGAIN != EWOULDBLOCK + || yaz_errno() == EAGAIN +#endif +#endif +#ifdef __sun__ + || yaz_errno() == ENOENT /* Sun's sometimes set errno to this value! */ +#endif + || yaz_errno() == EINPROGRESS +#endif + ) + { + TRC(fprintf(stderr, " Flow control stop\n")); + h->io_pending = CS_WANT_WRITE; + return 1; + } + h->cerrno = CSYSERR; + return -1; + } + state->written += res; + TRC(fprintf(stderr, " Wrote %d, written=%d, nbytes=%d\n", + res, state->written, size)); + } + state->towrite = state->written = -1; + TRC(fprintf(stderr, " Ok\n")); + return 0; +} + + +#if HAVE_OPENSSL_SSL_H +/* + * Returns 1, 0 or -1 + * In nonblocking mode, you must call again with same buffer while + * return value is 1. + */ +int ssl_put(COMSTACK h, char *buf, int size) +{ + int res; + struct tcpip_state *state = (struct tcpip_state *)h->cprivate; + + TRC(fprintf(stderr, "ssl_put: size=%d\n", size)); + h->io_pending = 0; + h->event = CS_DATA; + if (state->towrite < 0) + { + state->towrite = size; + state->written = 0; + } + else if (state->towrite != size) + { + h->cerrno = CSWRONGBUF; + return -1; + } + while (state->towrite > state->written) + { + res = SSL_write (state->ssl, buf + state->written, + size - state->written); + if (res <= 0) + { + int ssl_err = SSL_get_error(state->ssl, res); + if (ssl_err == SSL_ERROR_WANT_READ) + { + h->io_pending = CS_WANT_READ; + return 1; + } + if (ssl_err == SSL_ERROR_WANT_WRITE) + { + h->io_pending = CS_WANT_WRITE; + return 1; + } + h->cerrno = CSERRORSSL; + return -1; + } + state->written += res; + TRC(fprintf(stderr, " Wrote %d, written=%d, nbytes=%d\n", + res, state->written, size)); + } + state->towrite = state->written = -1; + TRC(fprintf(stderr, " Ok\n")); + return 0; +} +#endif + +int tcpip_close(COMSTACK h) +{ + tcpip_state *sp = (struct tcpip_state *)h->cprivate; + + TRC(fprintf(stderr, "tcpip_close\n")); + if (h->iofile != -1) + { +#if HAVE_OPENSSL_SSL_H + if (sp->ssl) + { + SSL_shutdown (sp->ssl); + } +#endif +#ifdef WIN32 + closesocket(h->iofile); +#else + close(h->iofile); +#endif + } + if (sp->altbuf) + xfree(sp->altbuf); +#if HAVE_OPENSSL_SSL_H + if (sp->ssl) + { + TRC (fprintf(stderr, "SSL_free\n")); + SSL_free (sp->ssl); + } + sp->ssl = 0; + if (sp->ctx_alloc) + SSL_CTX_free (sp->ctx_alloc); +#endif + xfree(sp); + xfree(h); + return 0; +} + +char *tcpip_addrstr(COMSTACK h) +{ + struct sockaddr_in addr; + tcpip_state *sp = (struct tcpip_state *)h->cprivate; + char *r = 0, *buf = sp->buf; + YAZ_SOCKLEN_T len; + struct hostent *host; + + len = sizeof(addr); + if (getpeername(h->iofile, (struct sockaddr*) &addr, &len) < 0) + { + h->cerrno = CSYSERR; + return 0; + } + if (!(h->blocking&2)) { + if ((host = gethostbyaddr((char*)&addr.sin_addr, sizeof(addr.sin_addr), + AF_INET))) + r = (char*) host->h_name; + } + if (!r) + r = inet_ntoa(addr.sin_addr); + if (h->protocol == PROTO_HTTP) + sprintf(buf, "http:%s", r); + else + sprintf(buf, "tcp:%s", r); +#if HAVE_OPENSSL_SSL_H + if (sp->ctx) + { + if (h->protocol == PROTO_HTTP) + sprintf(buf, "https:%s", r); + else + sprintf(buf, "ssl:%s", r); + } +#endif + return buf; +} + +int static tcpip_set_blocking(COMSTACK p, int blocking) +{ + unsigned long flag; + + if (p->blocking == blocking) + return 1; +#ifdef WIN32 + flag = 1; + if (ioctlsocket(p->iofile, FIONBIO, &flag) < 0) + return 0; +#else + flag = fcntl(p->iofile, F_GETFL, 0); + if(!(blocking&1)) + flag = flag & ~O_NONBLOCK; + else + flag = flag | O_NONBLOCK; + if (fcntl(p->iofile, F_SETFL, flag) < 0) + return 0; +#endif + p->blocking = blocking; + return 1; +} diff --git a/src/tpath.c b/src/tpath.c new file mode 100644 index 0000000..58ac639 --- /dev/null +++ b/src/tpath.c @@ -0,0 +1,91 @@ +/* + * Copyright (c) 1995-2003, Index Data. + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: tpath.c,v 1.1 2003-10-27 12:21:35 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + + +#include +#include +#include +#include +#include + +FILE *yaz_path_fopen(const char *path, const char *name, const char *mode) +{ + return yaz_fopen (path, name, mode, 0); +} + +int yaz_fclose (FILE *f) +{ + return fclose (f); +} + +FILE *yaz_fopen(const char *path, const char *name, const char *mode, + const char *base) +{ + char spath[1024]; + + for(;;) + { + FILE *f; + + const char *path_sep = 0; + size_t len = 0; + size_t slen = 0; + + *spath = '\0'; + if (path) + { + /* somewhat dirty since we have to consider Windows + * drive letters.. + */ + if (strchr ("/\\.", *path)) + { + path_sep = strchr (path+1, ':'); + } + else if (path[0] && path[1]) + path_sep = strchr (path+2, ':'); + if (path_sep) + len = path_sep - path; + else + len = strlen(path); + if (!strchr ("/\\", *path) && base) + { + strcpy (spath, base); + slen = strlen(spath); + spath[slen++] = '/'; + } + memcpy (spath+slen, path, len); + slen += len; + if (!strchr("/\\", spath[slen-1])) + spath[slen++] = '/'; + } + strcpy (spath+slen, name); + if ((f = fopen(spath, mode))) + return f; + + if (!path_sep) + break; + path = path_sep+1; + } + return 0; +} + +int yaz_is_abspath (const char *p) +{ + if (*p == '/') + return 1; +#ifdef WIN32 + if (*p == '\\') + return 1; + if (*p && p[1] == ':' && isalpha(*p)) + return 1; +#endif + return 0; +} diff --git a/src/univres.asn b/src/univres.asn new file mode 100644 index 0000000..f83320d --- /dev/null +++ b/src/univres.asn @@ -0,0 +1,23 @@ +ResourceReport-Format-Universe-1 +{Z39-50-resourceReport universe-1 (1000)} DEFINITIONS ::= +BEGIN +IMPORTS StringOrNumeric FROM Z39-50-APDU-1995; +-- + +UniverseReportHits ::= SEQUENCE { + database StringOrNumeric, + hits StringOrNumeric +} + +UniverseReportDuplicate ::= SEQUENCE { + hitno StringOrNumeric +} + +UniverseReport ::= SEQUENCE { + totalHits INTEGER, + report CHOICE { + databaseHits [0] IMPLICIT UniverseReportHits, + duplicate [1] IMPLICIT UniverseReportDuplicate + } +} +END diff --git a/src/unix.c b/src/unix.c new file mode 100644 index 0000000..2c1c979 --- /dev/null +++ b/src/unix.c @@ -0,0 +1,601 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * + * $Id: unix.c,v 1.1 2003-10-27 12:21:36 adam Exp $ + * UNIX socket COMSTACK. By Morten Bøgeskov. + */ +#ifndef WIN32 + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#ifndef YAZ_SOCKLEN_T +#define YAZ_SOCKLEN_T int +#endif + +static int unix_close(COMSTACK h); +static int unix_put(COMSTACK h, char *buf, int size); +static int unix_get(COMSTACK h, char **buf, int *bufsize); +static int unix_connect(COMSTACK h, void *address); +static int unix_more(COMSTACK h); +static int unix_rcvconnect(COMSTACK h); +static int unix_bind(COMSTACK h, void *address, int mode); +static int unix_listen(COMSTACK h, char *raddr, int *addrlen, + int (*check_ip)(void *cd, const char *a, int len, int type), + void *cd); +static int unix_set_blocking(COMSTACK p, int blocking); + +static COMSTACK unix_accept(COMSTACK h); +static char *unix_addrstr(COMSTACK h); +static void *unix_straddr(COMSTACK h, const char *str); + +#ifndef SUN_LEN +#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ + + strlen ((ptr)->sun_path)) +#endif +#if 0 +#define TRC(x) x +#else +#define TRC(X) +#endif + +/* this state is used for both SSL and straight TCP/IP */ +typedef struct unix_state +{ + char *altbuf; /* alternate buffer for surplus data */ + int altsize; /* size as xmalloced */ + int altlen; /* length of data or 0 if none */ + + int written; /* -1 if we aren't writing */ + int towrite; /* to verify against user input */ + int (*complete)(const unsigned char *buf, int len); /* length/comple. */ + struct sockaddr_un addr; /* returned by cs_straddr */ + char buf[128]; /* returned by cs_addrstr */ +} unix_state; + +static int unix_init (void) +{ + return 1; +} + +/* + * This function is always called through the cs_create() macro. + * s >= 0: socket has already been established for us. + */ +COMSTACK unix_type(int s, int blocking, int protocol, void *vp) +{ + COMSTACK p; + unix_state *state; + int new_socket; + + if (!unix_init ()) + return 0; + if (s < 0) + { + if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) + return 0; + new_socket = 1; + } + else + new_socket = 0; + if (!(p = (struct comstack *)xmalloc(sizeof(struct comstack)))) + return 0; + if (!(state = (struct unix_state *)(p->cprivate = + xmalloc(sizeof(unix_state))))) + return 0; + + if (!((p->blocking = blocking)&1)) + { + if (fcntl(s, F_SETFL, O_NONBLOCK) < 0) + return 0; +#ifndef MSG_NOSIGNAL + signal (SIGPIPE, SIG_IGN); +#endif + } + + p->io_pending = 0; + p->iofile = s; + p->type = unix_type; + p->protocol = (enum oid_proto) protocol; + + p->f_connect = unix_connect; + p->f_rcvconnect = unix_rcvconnect; + p->f_get = unix_get; + p->f_put = unix_put; + p->f_close = unix_close; + p->f_more = unix_more; + p->f_bind = unix_bind; + p->f_listen = unix_listen; + p->f_accept = unix_accept; + p->f_addrstr = unix_addrstr; + p->f_straddr = unix_straddr; + p->f_set_blocking = unix_set_blocking; + + p->state = new_socket ? CS_ST_UNBND : CS_ST_IDLE; /* state of line */ + p->event = CS_NONE; + p->cerrno = 0; + p->stackerr = 0; + + state->altbuf = 0; + state->altsize = state->altlen = 0; + state->towrite = state->written = -1; + if (protocol == PROTO_WAIS) + state->complete = completeWAIS; + else + state->complete = cs_complete_auto; + + p->timeout = COMSTACK_DEFAULT_TIMEOUT; + TRC(fprintf(stderr, "Created new UNIX comstack\n")); + + return p; +} + + +static int unix_strtoaddr_ex(const char *str, struct sockaddr_un *add) +{ + char *cp; + if (!unix_init ()) + return 0; + TRC(fprintf(stderr, "unix_strtoaddress: %s\n", str ? str : "NULL")); + add->sun_family = AF_UNIX; + strncpy(add->sun_path, str, sizeof(add->sun_path)); + cp = strchr (add->sun_path, ':'); + if (cp) + *cp = '\0'; + return 1; +} + +static void *unix_straddr(COMSTACK h, const char *str) +{ + unix_state *sp = (unix_state *)h->cprivate; + + TRC(fprintf(stderr, "unix_straddr: %s\n", str ? str : "NULL")); + + if (!unix_strtoaddr_ex (str, &sp->addr)) + return 0; + return &sp->addr; +} + +struct sockaddr_un *unix_strtoaddr(const char *str) +{ + static struct sockaddr_un add; + + TRC(fprintf(stderr, "unix_strtoaddr: %s\n", str ? str : "NULL")); + + if (!unix_strtoaddr_ex (str, &add)) + return 0; + return &add; +} + +static int unix_more(COMSTACK h) +{ + unix_state *sp = (unix_state *)h->cprivate; + + return sp->altlen && (*sp->complete)((unsigned char *) sp->altbuf, + sp->altlen); +} + +/* + * connect(2) will block (sometimes) - nothing we can do short of doing + * weird things like spawning subprocesses or threading or some weird junk + * like that. + */ +static int unix_connect(COMSTACK h, void *address) +{ + struct sockaddr_un *add = (struct sockaddr_un *)address; + int r; + + TRC(fprintf(stderr, "unix_connect\n")); + h->io_pending = 0; + if (h->state != CS_ST_UNBND) + { + h->cerrno = CSOUTSTATE; + return -1; + } + r = connect(h->iofile, (struct sockaddr *) add, SUN_LEN(add)); + if (r < 0) + { + if (yaz_errno() == EINPROGRESS) + { + h->event = CS_CONNECT; + h->state = CS_ST_CONNECTING; + h->io_pending = CS_WANT_WRITE|CS_WANT_READ; + return 1; + } + h->cerrno = CSYSERR; + return -1; + } + h->event = CS_CONNECT; + h->state = CS_ST_CONNECTING; + + return unix_rcvconnect (h); +} + +/* + * nop + */ +static int unix_rcvconnect(COMSTACK h) +{ + TRC(fprintf(stderr, "unix_rcvconnect\n")); + + if (h->state == CS_ST_DATAXFER) + return 0; + if (h->state != CS_ST_CONNECTING) + { + h->cerrno = CSOUTSTATE; + return -1; + } + h->event = CS_DATA; + h->state = CS_ST_DATAXFER; + return 0; +} + +#define CERTF "ztest.pem" +#define KEYF "ztest.pem" + +static int unix_bind(COMSTACK h, void *address, int mode) +{ + struct sockaddr *addr = (struct sockaddr *)address; + const char * path = ((struct sockaddr_un *)addr)->sun_path; + struct stat stat_buf; + + TRC (fprintf (stderr, "unix_bind\n")); + + if(stat(path, &stat_buf) != -1) { + struct sockaddr_un socket_unix; + int socket_out = -1; + if(! S_ISSOCK(stat_buf.st_mode)) { + h->cerrno = CSYSERR; + yaz_set_errno(EEXIST); /* Not a socket (File exists) */ + return -1; + } + if((socket_out = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { + h->cerrno = CSYSERR; + return -1; + } + socket_unix.sun_family = AF_UNIX; + strncpy(socket_unix.sun_path, path, sizeof(socket_unix.sun_path)); + if(connect(socket_out, (struct sockaddr *) &socket_unix, SUN_LEN(&socket_unix)) < 0) { + if(yaz_errno() == ECONNREFUSED) { + TRC (fprintf (stderr, "Socket exists but nobody is listening\n")); + } else { + h->cerrno = CSYSERR; + return -1; + } + } else { + close(socket_out); + h->cerrno = CSYSERR; + yaz_set_errno(EADDRINUSE); + return -1; + } + unlink(path); + } + + if (bind(h->iofile, (struct sockaddr *) addr, SUN_LEN((struct sockaddr_un *)addr))) + { + h->cerrno = CSYSERR; + return -1; + } + chmod(path, 0777); + if (mode == CS_SERVER && listen(h->iofile, 3) < 0) + { + h->cerrno = CSYSERR; + return -1; + } + h->state = CS_ST_IDLE; + h->event = CS_LISTEN; + return 0; +} + +static int unix_listen(COMSTACK h, char *raddr, int *addrlen, + int (*check_ip)(void *cd, const char *a, int len, int t), + void *cd) +{ + struct sockaddr_un addr; + YAZ_SOCKLEN_T len = sizeof(addr); + + TRC(fprintf(stderr, "unix_listen pid=%d\n", getpid())); + if (h->state != CS_ST_IDLE) + { + h->cerrno = CSOUTSTATE; + return -1; + } + h->newfd = accept(h->iofile, (struct sockaddr*)&addr, &len); + if (h->newfd < 0) + { + if ( + yaz_errno() == EWOULDBLOCK +#ifdef EAGAIN +#if EAGAIN != EWOULDBLOCK + || yaz_errno() == EAGAIN +#endif +#endif + ) + h->cerrno = CSNODATA; + else + h->cerrno = CSYSERR; + return -1; + } + if (addrlen && (size_t) (*addrlen) >= sizeof(struct sockaddr_un)) + memcpy(raddr, &addr, *addrlen = sizeof(struct sockaddr_un)); + else if (addrlen) + *addrlen = 0; + h->state = CS_ST_INCON; + return 0; +} + +static COMSTACK unix_accept(COMSTACK h) +{ + COMSTACK cnew; + unix_state *state, *st = (unix_state *)h->cprivate; + + TRC(fprintf(stderr, "unix_accept\n")); + if (h->state == CS_ST_INCON) + { + if (!(cnew = (COMSTACK)xmalloc(sizeof(*cnew)))) + { + h->cerrno = CSYSERR; + close(h->newfd); + h->newfd = -1; + return 0; + } + memcpy(cnew, h, sizeof(*h)); + cnew->iofile = h->newfd; + cnew->io_pending = 0; + if (!(state = (unix_state *) + (cnew->cprivate = xmalloc(sizeof(unix_state))))) + { + h->cerrno = CSYSERR; + if (h->newfd != -1) + { + close(h->newfd); + h->newfd = -1; + } + return 0; + } + if (!(cnew->blocking&1) && + (fcntl(cnew->iofile, F_SETFL, O_NONBLOCK) < 0) + ) + { + h->cerrno = CSYSERR; + if (h->newfd != -1) + { + close(h->newfd); + h->newfd = -1; + } + xfree (cnew); + xfree (state); + return 0; + } + h->newfd = -1; + state->altbuf = 0; + state->altsize = state->altlen = 0; + state->towrite = state->written = -1; + state->complete = st->complete; + memcpy(&state->addr, &st->addr, sizeof(state->addr)); + cnew->state = CS_ST_ACCEPT; + cnew->event = CS_NONE; + h->state = CS_ST_IDLE; + + h = cnew; + } + if (h->state == CS_ST_ACCEPT) + { + } + else + { + h->cerrno = CSOUTSTATE; + return 0; + } + h->io_pending = 0; + h->state = CS_ST_DATAXFER; + h->event = CS_DATA; + return h; +} + +#define CS_UNIX_BUFCHUNK 4096 + +/* + * Return: -1 error, >1 good, len of buffer, ==1 incomplete buffer, + * 0=connection closed. + */ +static int unix_get(COMSTACK h, char **buf, int *bufsize) +{ + unix_state *sp = (unix_state *)h->cprivate; + char *tmpc; + int tmpi, berlen, rest, req, tomove; + int hasread = 0, res; + + TRC(fprintf(stderr, "unix_get: bufsize=%d\n", *bufsize)); + if (sp->altlen) /* switch buffers */ + { + TRC(fprintf(stderr, " %d bytes in altbuf (0x%x)\n", sp->altlen, + (unsigned) sp->altbuf)); + tmpc = *buf; + tmpi = *bufsize; + *buf = sp->altbuf; + *bufsize = sp->altsize; + hasread = sp->altlen; + sp->altlen = 0; + sp->altbuf = tmpc; + sp->altsize = tmpi; + } + h->io_pending = 0; + while (!(berlen = (*sp->complete)((unsigned char *)*buf, hasread))) + { + if (!*bufsize) + { + if (!(*buf = (char *)xmalloc(*bufsize = CS_UNIX_BUFCHUNK))) + return -1; + } + else if (*bufsize - hasread < CS_UNIX_BUFCHUNK) + if (!(*buf =(char *)xrealloc(*buf, *bufsize *= 2))) + return -1; + res = recv(h->iofile, *buf + hasread, CS_UNIX_BUFCHUNK, 0); + TRC(fprintf(stderr, " recv res=%d, hasread=%d\n", res, hasread)); + if (res < 0) + { + if (yaz_errno() == EWOULDBLOCK +#ifdef EAGAIN +#if EAGAIN != EWOULDBLOCK + || yaz_errno() == EAGAIN +#endif +#endif + || yaz_errno() == EINPROGRESS + ) + { + h->io_pending = CS_WANT_READ; + break; + } + else if (yaz_errno() == 0) + continue; + else + return -1; + } + else if (!res) + return 0; + hasread += res; + } + TRC (fprintf (stderr, " Out of read loop with hasread=%d, berlen=%d\n", + hasread, berlen)); + /* move surplus buffer (or everything if we didn't get a BER rec.) */ + if (hasread > berlen) + { + tomove = req = hasread - berlen; + rest = tomove % CS_UNIX_BUFCHUNK; + if (rest) + req += CS_UNIX_BUFCHUNK - rest; + if (!sp->altbuf) + { + if (!(sp->altbuf = (char *)xmalloc(sp->altsize = req))) + return -1; + } else if (sp->altsize < req) + if (!(sp->altbuf =(char *)xrealloc(sp->altbuf, sp->altsize = req))) + return -1; + TRC(fprintf(stderr, " Moving %d bytes to altbuf(0x%x)\n", tomove, + (unsigned) sp->altbuf)); + memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove); + } + if (berlen < CS_UNIX_BUFCHUNK - 1) + *(*buf + berlen) = '\0'; + return berlen ? berlen : 1; +} + + + +/* + * Returns 1, 0 or -1 + * In nonblocking mode, you must call again with same buffer while + * return value is 1. + */ +static int unix_put(COMSTACK h, char *buf, int size) +{ + int res; + struct unix_state *state = (struct unix_state *)h->cprivate; + + TRC(fprintf(stderr, "unix_put: size=%d\n", size)); + h->io_pending = 0; + h->event = CS_DATA; + if (state->towrite < 0) + { + state->towrite = size; + state->written = 0; + } + else if (state->towrite != size) + { + h->cerrno = CSWRONGBUF; + return -1; + } + while (state->towrite > state->written) + { + if ((res = + send(h->iofile, buf + state->written, size - + state->written, +#ifdef MSG_NOSIGNAL + MSG_NOSIGNAL +#else + 0 +#endif + )) < 0) + { + if ( + yaz_errno() == EWOULDBLOCK +#ifdef EAGAIN +#if EAGAIN != EWOULDBLOCK + || yaz_errno() == EAGAIN +#endif +#endif + ) + { + TRC(fprintf(stderr, " Flow control stop\n")); + h->io_pending = CS_WANT_WRITE; + return 1; + } + h->cerrno = CSYSERR; + return -1; + } + state->written += res; + TRC(fprintf(stderr, " Wrote %d, written=%d, nbytes=%d\n", + res, state->written, size)); + } + state->towrite = state->written = -1; + TRC(fprintf(stderr, " Ok\n")); + return 0; +} + +static int unix_close(COMSTACK h) +{ + unix_state *sp = (struct unix_state *)h->cprivate; + + TRC(fprintf(stderr, "unix_close\n")); + if (h->iofile != -1) + { + close(h->iofile); + } + if (sp->altbuf) + xfree(sp->altbuf); + xfree(sp); + xfree(h); + return 0; +} + +static char *unix_addrstr(COMSTACK h) +{ + unix_state *sp = (struct unix_state *)h->cprivate; + char *buf = sp->buf; + sprintf(buf, "unix:%s", sp->addr.sun_path); + return buf; +} + +static int unix_set_blocking(COMSTACK p, int blocking) +{ + unsigned long flag; + + if (p->blocking == blocking) + return 1; + flag = fcntl(p->iofile, F_GETFL, 0); + if(!blocking) + flag = flag & ~O_NONBLOCK; + else + flag = flag | O_NONBLOCK; + if (fcntl(p->iofile, F_SETFL, flag) < 0) + return 0; + p->blocking = blocking; + return 1; +} +#endif diff --git a/src/version.c b/src/version.c new file mode 100644 index 0000000..a819d2c --- /dev/null +++ b/src/version.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 1995-2003, Index Data. + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: version.c,v 1.1 2003-10-27 12:21:36 adam Exp $ + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include + +unsigned long yaz_version(char *version_str, char *sys_str) +{ + if (version_str) + strcpy(version_str, YAZ_VERSION); + if (sys_str) + strcpy(sys_str, ""); + return YAZ_VERSIONL; +} diff --git a/src/waislen.c b/src/waislen.c new file mode 100644 index 0000000..38ddf0a --- /dev/null +++ b/src/waislen.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 1995-1999, Index Data. + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Log: waislen.c,v $ + * Revision 1.1 2003-10-27 12:21:36 adam + * Source restructure. yaz-marcdump part of installation + * + * Revision 1.5 1999/11/30 13:47:11 adam + * Improved installation. Moved header files to include/yaz. + * + * Revision 1.4 1999/01/08 11:23:15 adam + * Added const modifier to some of the BER/ODR encoding routines. + * + * Revision 1.3 1996/02/29 14:23:13 adam + * Bug fix. + * + * Revision 1.2 1996/02/26 18:34:44 adam + * Bug fix. + * + * Revision 1.1 1996/02/20 13:02:58 quinn + * Wais length. + * + * + */ + +#include +#include +#include +/* + * Return length of WAIS package or 0 + */ +int completeWAIS(const unsigned char *buf, int len) +{ + int i, lval = 0; + + if (len < 25) + return 0; + if (*buf != '0') + return 0; + /* calculate length */ + for (i = 0; i < 10; i++) + lval = lval * 10 + (buf[i] - '0'); + lval += 25; + if (len >= lval) + return lval; + return 0; +} diff --git a/src/wrbuf.c b/src/wrbuf.c new file mode 100644 index 0000000..d4fc08a --- /dev/null +++ b/src/wrbuf.c @@ -0,0 +1,133 @@ +/* + * Copyright (c) 1995-2003, Index Data. + * See the file LICENSE for details. + * + * $Id: wrbuf.c,v 1.1 2003-10-27 12:21:36 adam Exp $ + */ + +/* + * Growing buffer for writing various stuff. + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +#include + +WRBUF wrbuf_alloc(void) +{ + WRBUF n; + + if (!(n = (WRBUF)xmalloc(sizeof(*n)))) + abort(); + n->buf = 0; + n->size = 0; + n->pos = 0; + return n; +} + +void wrbuf_free(WRBUF b, int free_buf) +{ + if (free_buf && b->buf) + xfree(b->buf); + xfree(b); +} + +void wrbuf_rewind(WRBUF b) +{ + b->pos = 0; +} + +int wrbuf_grow(WRBUF b, int minsize) +{ + int togrow; + + if (!b->size) + togrow = 1024; + else + togrow = b->size; + if (togrow < minsize) + togrow = minsize; + if (b->size && !(b->buf =(char *)xrealloc(b->buf, b->size += togrow))) + abort(); + else if (!b->size && !(b->buf = (char *)xmalloc(b->size = togrow))) + abort(); + return 0; +} + +int wrbuf_write(WRBUF b, const char *buf, int size) +{ + if (size <= 0) + return 0; + if (b->pos + size >= b->size) + wrbuf_grow(b, size); + memcpy(b->buf + b->pos, buf, size); + b->pos += size; + return 0; +} + +int wrbuf_puts(WRBUF b, const char *buf) +{ + wrbuf_write(b, buf, strlen(buf)+1); /* '\0'-terminate as well */ + (b->pos)--; /* don't include '\0' in count */ + return 0; +} + +int wrbuf_xmlputs(WRBUF b, const char *cp) +{ + while (*cp) + { + switch(*cp) + { + case '<': + wrbuf_puts(b, "<"); + break; + case '>': + wrbuf_puts(b, ">"); + break; + case '&': + wrbuf_puts(b, "&"); + break; + case '"': + wrbuf_puts(b, """); + break; + case '\'': + wrbuf_puts(b, "'"); + break; + default: + wrbuf_putc(b, *cp); + } + cp++; + } + wrbuf_putc(b, 0); + (b->pos)--; + return 0; +} + +void wrbuf_printf(WRBUF b, const char *fmt, ...) +{ + va_list ap; + char buf[4096]; + + va_start(ap, fmt); +#ifdef WIN32 + _vsnprintf(buf, sizeof(buf)-1, fmt, ap); +#else +/* !WIN32 */ +#if HAVE_VSNPRINTF + vsnprintf(buf, sizeof(buf)-1, fmt, ap); +#else + vsprintf(buf, fmt, ap); +#endif +#endif + wrbuf_puts (b, buf); + + va_end(ap); +} + diff --git a/src/xcqlutil.c b/src/xcqlutil.c new file mode 100644 index 0000000..9c38de1 --- /dev/null +++ b/src/xcqlutil.c @@ -0,0 +1,210 @@ +/* $Id: xcqlutil.c,v 1.1 2003-10-27 12:21:36 adam Exp $ + Copyright (C) 2002-2003 + Index Data Aps + +This file is part of the YAZ toolkit. + +See the file LICENSE. +*/ +#include +#include +#include + +#include + +static void pr_n(const char *buf, + void (*pr)(const char *buf, void *client_data), + void *client_data, int n) +{ + int i; + for (i = 0; i': + (*pr)(">", client_data); + break; + default: + bf[0] = *src; + bf[1] = 0; + (*pr)(bf, client_data); + } + src++; + } +} + +static void prefixes(struct cql_node *cn, + void (*pr)(const char *buf, void *client_data), + void *client_data, int level) +{ + if (cn) + { + pr_n("\n", pr, client_data, level); + for (; cn; cn = cn->u.mod.next) + { + pr_n("\n", pr, client_data, level+2); + if (cn->u.mod.name) + { + pr_n("", pr, client_data, level+4); + pr_cdata(cn->u.mod.name, pr, client_data); + pr_n("\n", pr, client_data, 0); + } + if (cn->u.mod.value) + { + pr_n("", pr, client_data, level+4); + pr_cdata(cn->u.mod.value, pr, client_data); + pr_n("\n", pr, client_data, 0); + } + pr_n("\n", pr, client_data, level+2); + } + pr_n("\n", pr, client_data, level); + } +} + +static void cql_to_xml_r(struct cql_node *cn, + void (*pr)(const char *buf, void *client_data), + void *client_data, int level) +{ + if (!cn) + return; + switch (cn->which) + { + case CQL_NODE_ST: + pr_n("\n", pr, client_data, level); + prefixes(cn->u.st.prefixes, pr, client_data, level+2); + if (cn->u.st.index) + { + pr_n("", pr, client_data, level+2); + pr_cdata(cn->u.st.index, pr, client_data); + pr_n("\n", pr, client_data, 0); + } + if (cn->u.st.relation) + { + struct cql_node *m = cn->u.st.modifiers; + pr_n("\n", pr, client_data, level+2); + pr_n("", pr, client_data, level+4); + pr_cdata(cn->u.st.relation, pr, client_data); + pr_n("\n", pr, client_data, 0); + if (m) + { + pr_n("\n", pr, client_data, level+4); + for (; m; m = m->u.mod.next) + { + pr_n("", pr, client_data, level+6); + pr_cdata(m->u.mod.value, pr, client_data); + pr_n("\n", pr, client_data, 0); + } + pr_n("\n", pr, client_data, level+4); + } + pr_n("\n", pr, client_data, level+2); + } + if (cn->u.st.term) + { + pr_n("", pr, client_data, level+2); + pr_cdata(cn->u.st.term, pr, client_data); + pr_n("\n", pr, client_data, 0); + } + pr_n("\n", pr, client_data, level); + break; + case CQL_NODE_BOOL: + pr_n("\n", pr, client_data, level); + prefixes(cn->u.st.prefixes, pr, client_data, level+2); + if (cn->u.boolean.value) + { + struct cql_node *m = cn->u.boolean.modifiers; + pr_n("\n", pr, client_data, level+2); + + pr_n("", pr, client_data, level+4); + pr_cdata(cn->u.boolean.value, pr, client_data); + pr_n("\n", pr, client_data, 0); + + if (m) + { + pr_n("\n", pr, client_data, level+4); + for (; m; m = m->u.mod.next) + { + pr_n("", pr, client_data, level+6); + pr_cdata(m->u.mod.name, pr, client_data); + pr_n("", pr, client_data, 0); + if (m->u.mod.value) + { + pr_n("", pr, client_data, 0); + pr_cdata(m->u.mod.value, pr, client_data); + pr_n("", pr, client_data, 0); + } + pr_n("\n", pr, client_data, 0); + } + pr_n("\n", pr, client_data, level+4); + } + pr_n("\n", pr, client_data, level+2); + } + if (cn->u.boolean.left) + { + printf ("%*s\n", level+2, ""); + cql_to_xml_r(cn->u.boolean.left, pr, client_data, level+4); + printf ("%*s\n", level+2, ""); + } + if (cn->u.boolean.right) + { + printf ("%*s\n", level+2, ""); + cql_to_xml_r(cn->u.boolean.right, pr, client_data, level+4); + printf ("%*s\n", level+2, ""); + } + pr_n("\n", pr, client_data, level); + } +} + +void cql_to_xml(struct cql_node *cn, + void (*pr)(const char *buf, void *client_data), + void *client_data) +{ + cql_to_xml_r(cn, pr, client_data, 0); +} + +void cql_to_xml_stdio(struct cql_node *cn, FILE *f) +{ + cql_to_xml(cn, cql_fputs, f); +} + +void cql_buf_write_handler (const char *b, void *client_data) +{ + struct cql_buf_write_info *info = (struct cql_buf_write_info *)client_data; + int l = strlen(b); + if (info->off < 0 || (info->off + l >= info->max)) + { + info->off = -1; + return; + } + memcpy (info->buf + info->off, b, l); + info->off += l; +} + +int cql_to_xml_buf(struct cql_node *cn, char *out, int max) +{ + struct cql_buf_write_info info; + info.off = 0; + info.max = max; + info.buf = out; + cql_to_xml(cn, cql_buf_write_handler, &info); + if (info.off >= 0) + info.buf[info.off] = '\0'; + return info.off; +} + diff --git a/src/xmalloc.c b/src/xmalloc.c new file mode 100644 index 0000000..4365eff --- /dev/null +++ b/src/xmalloc.c @@ -0,0 +1,277 @@ +/* + * Copyright (C) 1994-2003, Index Data + * All rights reserved. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: xmalloc.c,v 1.1 2003-10-27 12:21:36 adam Exp $ + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include +#include + +#ifndef TRACE_XMALLOC +#define TRACE_XMALLOC 1 +#endif + +#if TRACE_XMALLOC > 1 + +static const unsigned char head[] = {88, 77, 66, 55, 44, 33, 22, 11}; +static const unsigned char tail[] = {11, 22, 33, 44, 55, 66, 77, 88}; +static const unsigned char freed[] = {11, 22, 33, 44, 55, 66, 77, 88}; + +struct dmalloc_info { + int len; + char file[16]; + int line; + struct dmalloc_info *next; + struct dmalloc_info *prev; +}; + +struct dmalloc_info *dmalloc_list = 0; + +void *xmalloc_d(size_t nbytes, const char *file, int line) +{ + char *res; + struct dmalloc_info *dinfo; + + if (!(res = (char*) malloc(nbytes + sizeof(*dinfo)+16*sizeof(char)))) + return 0; + dinfo = (struct dmalloc_info *) res; + strncpy (dinfo->file, file, sizeof(dinfo->file)-1); + dinfo->file[sizeof(dinfo->file)-1] = '\0'; + dinfo->line = line; + dinfo->len = nbytes; + + dinfo->prev = 0; + dinfo->next = dmalloc_list; + if (dinfo->next) + dinfo->next->prev = dinfo; + dmalloc_list = dinfo; + + memcpy(res + sizeof(*dinfo), head, 8*sizeof(char)); + res += sizeof(*dinfo) + 8*sizeof(char); + memcpy(res + nbytes, tail, 8*sizeof(char)); + return res; +} + +void xfree_d(void *ptr, const char *file, int line) +{ + struct dmalloc_info *dinfo; + + if (!ptr) + return; + dinfo = (struct dmalloc_info *) + ((char*)ptr - 8*sizeof(char) - sizeof(*dinfo)); + if (memcmp(head, (char*) ptr - 8*sizeof(char), 8*sizeof(char))) + { + yaz_log(LOG_FATAL, "xfree_d bad head, %s:%d, %p", file, line, ptr); + abort(); + } + if (memcmp((char*) ptr + dinfo->len, tail, 8*sizeof(char))) + { + yaz_log(LOG_FATAL, "xfree_d bad tail, %s:%d, %p", file, line, ptr); + abort(); + } + if (dinfo->prev) + dinfo->prev->next = dinfo->next; + else + dmalloc_list = dinfo->next; + if (dinfo->next) + dinfo->next->prev = dinfo->prev; + memcpy ((char*) ptr - 8*sizeof(char), freed, 8*sizeof(char)); + free(dinfo); + return; +} + +void *xrealloc_d(void *p, size_t nbytes, const char *file, int line) +{ + struct dmalloc_info *dinfo; + char *ptr = (char*) p; + char *res; + + if (!ptr) + { + if (!nbytes) + return 0; + res = (char *) malloc(nbytes + sizeof(*dinfo) + 16*sizeof(char)); + } + else + { + if (memcmp(head, ptr - 8*sizeof(char), 8*sizeof(char))) + { + yaz_log(LOG_FATAL, "xrealloc_d bad head, %s:%d, %p", + file, line, ptr); + abort(); + } + dinfo = (struct dmalloc_info *) (ptr-8*sizeof(char) - sizeof(*dinfo)); + if (memcmp(ptr + dinfo->len, tail, 8*sizeof(char))) + { + yaz_log(LOG_FATAL, "xrealloc_d bad tail, %s:%d, %p", + file, line, ptr); + abort(); + } + if (dinfo->prev) + dinfo->prev->next = dinfo->next; + else + dmalloc_list = dinfo->next; + if (dinfo->next) + dinfo->next->prev = dinfo->prev; + + if (!nbytes) + { + free (dinfo); + return 0; + } + res = (char *) + realloc(dinfo, nbytes + sizeof(*dinfo) + 16*sizeof(char)); + } + if (!res) + return 0; + dinfo = (struct dmalloc_info *) res; + strncpy (dinfo->file, file, sizeof(dinfo->file)-1); + dinfo->file[sizeof(dinfo->file)-1] = '\0'; + dinfo->line = line; + dinfo->len = nbytes; + + dinfo->prev = 0; + dinfo->next = dmalloc_list; + if (dmalloc_list) + dmalloc_list->prev = dinfo; + dmalloc_list = dinfo; + + memcpy(res + sizeof(*dinfo), head, 8*sizeof(char)); + res += sizeof(*dinfo) + 8*sizeof(char); + memcpy(res + nbytes, tail, 8*sizeof(char)); + return res; +} + +void *xcalloc_d(size_t nmemb, size_t size, const char *file, int line) +{ + char *res; + struct dmalloc_info *dinfo; + size_t nbytes = nmemb * size; + + if (!(res = (char*) calloc(1, nbytes+sizeof(*dinfo)+16*sizeof(char)))) + return 0; + dinfo = (struct dmalloc_info *) res; + strncpy (dinfo->file, file, sizeof(dinfo->file)-1); + dinfo->file[sizeof(dinfo->file)-1] = '\0'; + dinfo->line = line; + dinfo->len = nbytes; + + dinfo->prev = 0; + dinfo->next = dmalloc_list; + if (dinfo->next) + dinfo->next->prev = dinfo; + dmalloc_list = dinfo; + + memcpy(res + sizeof(*dinfo), head, 8*sizeof(char)); + res += sizeof(*dinfo) + 8*sizeof(char); + memcpy(res + nbytes, tail, 8*sizeof(char)); + return res; +} + +void xmalloc_trav_d(const char *file, int line) +{ + size_t size = 0; + struct dmalloc_info *dinfo = dmalloc_list; + + yaz_log (LOG_MALLOC, "malloc_trav %s:%d", file, line); + while (dinfo) + { + yaz_log (LOG_MALLOC, " %20s:%d p=%p size=%d", dinfo->file, dinfo->line, + ((char*) dinfo)+sizeof(*dinfo)+8*sizeof(char), dinfo->len); + size += dinfo->len; + dinfo = dinfo->next; + } + yaz_log (LOG_MALLOC, "total bytes %ld", (long) size); +} + +#else +/* TRACE_XMALLOC <= 1 */ +#define xrealloc_d(o, x, f, l) realloc(o, x) +#define xmalloc_d(x, f, l) malloc(x) +#define xcalloc_d(x,y, f, l) calloc(x,y) +#define xfree_d(x, f, l) free(x) +#define xmalloc_trav_d(f, l) +#endif + +void xmalloc_trav_f(const char *s, const char *file, int line) +{ + xmalloc_trav_d(file, line); +} + +void *xrealloc_f (void *o, size_t size, const char *file, int line) +{ + void *p = xrealloc_d (o, size, file, line); + +#if TRACE_XMALLOC + yaz_log (LOG_MALLOC, + "%s:%d: xrealloc(s=%d) %p -> %p", file, line, size, o, p); +#endif + if (!p) + { + yaz_log (LOG_FATAL|LOG_ERRNO, "Out of memory, realloc (%d bytes)", + size); + exit(1); + } + return p; +} + +void *xmalloc_f (size_t size, const char *file, int line) +{ + void *p = xmalloc_d (size, file, line); + +#if TRACE_XMALLOC + yaz_log (LOG_MALLOC, "%s:%d: xmalloc(s=%d) %p", file, line, size, p); +#endif + if (!p) + { + yaz_log (LOG_FATAL, "Out of memory - malloc (%d bytes)", size); + exit (1); + } + return p; +} + +void *xcalloc_f (size_t nmemb, size_t size, const char *file, int line) +{ + void *p = xcalloc_d (nmemb, size, file, line); +#if TRACE_XMALLOC + yaz_log (LOG_MALLOC, "%s:%d: xcalloc(s=%d) %p", file, line, size, p); +#endif + if (!p) + { + yaz_log (LOG_FATAL, "Out of memory - calloc (%d, %d)", nmemb, size); + exit (1); + } + return p; +} + +char *xstrdup_f (const char *s, const char *file, int line) +{ + char *p = (char *)xmalloc_d (strlen(s)+1, file, line); +#if TRACE_XMALLOC + yaz_log (LOG_MALLOC, "%s:%d: xstrdup(s=%d) %p", file, line, strlen(s)+1, p); +#endif + strcpy (p, s); + return p; +} + +void xfree_f(void *p, const char *file, int line) +{ + if (!p) + return ; +#if TRACE_XMALLOC + if (p) + yaz_log (LOG_MALLOC, "%s:%d: xfree %p", file, line, p); +#endif + xfree_d(p, file, line); +} diff --git a/src/yaz-ccl.c b/src/yaz-ccl.c new file mode 100644 index 0000000..41ab879 --- /dev/null +++ b/src/yaz-ccl.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1996-2003, Index Data. + * See the file LICENSE for details. + * + * $Id: yaz-ccl.c,v 1.1 2003-10-27 12:21:36 adam Exp $ + */ + +#include +#include +#include +#include + +#include +#include + +Z_RPNQuery *ccl_rpn_query (ODR o, struct ccl_rpn_node *p) +{ + YAZ_PQF_Parser parser = yaz_pqf_create(); + WRBUF wr = wrbuf_alloc(); + Z_RPNQuery *q; + + ccl_pquery(wr, p); + + q = yaz_pqf_parse(parser, o, wrbuf_buf(wr)); + + wrbuf_free(wr, 1); + yaz_pqf_destroy(parser); + return q; +} + +Z_AttributesPlusTerm *ccl_scan_query (ODR o, struct ccl_rpn_node *p) +{ + YAZ_PQF_Parser parser = yaz_pqf_create(); + WRBUF wr = wrbuf_alloc(); + Z_AttributesPlusTerm *q; + Odr_oid *setp; + + ccl_pquery(wr, p); + + q = yaz_pqf_scan(parser, o, &setp, wrbuf_buf(wr)); + + wrbuf_free(wr, 1); + yaz_pqf_destroy(parser); + return q; +} + diff --git a/src/z.tcl b/src/z.tcl new file mode 100644 index 0000000..38dee6c --- /dev/null +++ b/src/z.tcl @@ -0,0 +1,351 @@ +# YC Sample Config File for Z39.50 +# $Id: z.tcl,v 1.1 2003-10-27 12:21:36 adam Exp $ +# ---------------------------------------------------------- +# Prefix Specifications +# +# 1: C function prefix +# 2: C type prefix +# 3: C preprocessor prefix + +# Default prefix +set default-prefix {z_ Z_ Z_} + +# Name clash in extended services (TargetPart, OriginPartToKeep, etc) +# You can possibly think of better names :) +set prefix(ESFormat-PersistentResultSet) {z_PR Z_PR Z_PR} +set prefix(ESFormat-PersistentQuery) {z_PQuery Z_PQuery Z_PQuery} +set prefix(ESFormat-PeriodicQuerySchedule) {z_PQS Z_PQS Z_PQS} +set prefix(ESFormat-ItemOrder) {z_IO Z_IO Z_IO} +set prefix(ESFormat-Update0) {z_IU0 Z_IU0 Z_IU0} +set prefix(ESFormat-Update) {z_IU Z_IU Z_IU} +set prefix(ESFormat-ExportSpecification) {z_ES Z_ES Z_ES} +set prefix(ESFormat-ExportInvocation) {z_EI Z_EI Z_EI} + +# ---------------------------------------------------------- +# Settings for core of the protocol +set m Z39-50-APDU-1995 + +# Filename +set filename($m) z-core + +# Public header initialization code +set init($m,h) { +typedef struct Z_External Z_External; +YAZ_EXPORT int z_External(ODR o, Z_External **p, int opt, const char *name); +} + +set body($m,h) " +#ifdef __cplusplus +extern \"C\" \{ +#endif + +int z_ANY_type_0 (ODR o, void **p, int opt); + +#ifdef __cplusplus +\} +#endif +" +set body($m,c) { + +/* the type-0 query ... */ +int z_ANY_type_0 (ODR o, void **p, int opt) +{ + return 0; +} + +} + +# Type Name overrides +set map($m,PDU) APDU +set membermap($m,Operator,and) {Operator_and op_and} +set membermap($m,Operator,or) {Operator_or op_or} +#set membermap($m,Operator,and-not) {Operator_and_not op_and_not} +set map($m,AttributeElement_complex) ComplexAttribute +set map($m,DeleteSetStatus) DeleteStatus +set membermap($m,ProximityOperator,private) {ProximityOperator_private zprivate} +set unionmap($m,AttributeElement,attributeValue) {which value AttributeValue} +set membermap($m,ElementSpec,externalEspec) externalSpec +set membermap($m,RPNStructure,op) simple +set membermap($m,RPNStructure,rpnRpnOp) complex +set map($m,RPNStructure_complex) Complex +set membermap($m,Operand,attrTerm) {Operand_APT attributesPlusTerm} +set membermap($m,Operand,resultSet) {Operand_resultSetId resultSetId} +set membermap($m,Operand,resultAttr) {Operand_resultAttr resultAttr} +set membermap($m,Complex,rpn1) s1 +set membermap($m,Complex,rpn2) s2 +set membermap($m,Complex,op) roperator +set membermap($m,RPNQuery,attributeSet) attributeSetId +set membermap($m,RPNQuery,rpn) RPNStructure +set map($m,KnownProximityUnit) ProxUnit +set membermap($m,ProximityOperator,lessThan) {Prox_lessThan 1} +set membermap($m,ProximityOperator,lessThanOrEqual) {Prox_lessThanOrEqual 1} +set membermap($m,ProximityOperator,equal) {Prox_equal 1} +set membermap($m,ProximityOperator,greaterThanOrEqual) {Prox_greaterThanOrEqual 1} +set membermap($m,ProximityOperator,greaterThan) {Prox_greaterThan 1} +set membermap($m,ProximityOperator,notEqual) {Prox_notEqual 1} +# +set membermap($m,Records,responseRecords) {Records_DBOSD databaseOrSurDiagnostics} +set membermap($m,Records,nonSurrogateDiagnostic) {Records_NSD nonSurrogateDiagnostic} +set membermap($m,Records,multipleNonSurDiagnostics) {Records_multipleNSD multipleNonSurDiagnostics} +set map($m,Records_DBOSD) NamePlusRecordList +set map($m,Records_NSD) DiagRec +set map($m,Records_multipleNSD) DiagRecs +set membermap($m,NamePlusRecord,name) databaseName +set unionmap($m,DiagRecs) {num_diagRecs diagRecs} +set unionmap($m,NamePlusRecordList) {num_records records} +# +set membermap($m,ElementSetNames,genericElementSetName) generic +set map($m,ElementSetNames_databaseSpecific) DatabaseSpecific +# +set map($m,OccurrenceByAttributes_s) OccurrenceByAttributesElem +set map($m,OccurrenceByAttributesElem_byDatabase) byDatabaseList +# +set membermap($m,SortElement,datbaseSpecific) databaseSpecific +set map($m,SortElement_databaseSpecific) SortDbSpecificList +# +set map($m,SortKey_sortAttributes) SortAttributes +set unionmap($m,PresentRequest,recordComposition) {} +set map($m,PresentRequest_0) RecordComposition +set unionmap($m,PresentRequest,additionalRanges) {num_ranges additionalRanges} +set unionmap($m,SortRequest,sortSequence) {} +set map($m,SortRequest_0) SortKeySpecList +set unionmap($m,SortKeySpecList) {num_specs specs} +set map($m,InitializeRequest) InitRequest +set map($m,InitializeResponse) InitResponse +set unionmap($m,CloseReason) Close +set membermap($m,ProtocolVersion,version-1) 1 +set membermap($m,ProtocolVersion,version-2) 2 +set membermap($m,ProtocolVersion,version-3) 3 +set membermap($m,InitRequest,exceptionalRecordSize) maximumRecordSize +set membermap($m,InitResponse,exceptionalRecordSize) maximumRecordSize +set map($m,RecordsMultipleNonSurDiagnostics) DiagRecs +set map($m,RecordsDatabaseOrSurDiagnostics) NamePlusRecordList +set membermap($m,NamePlusRecord,retrievalRecord) databaseRecord +set unionmap($m,RecordComposition) {which u RecordComp} +set unionmap($m,ScanResponse,scanStatus) Scan +set unionmap($m,AttributeList) {num_attributes attributes} +set membermap($m,SortKey,sortfield) sortField +set map($m,CompSpec_0) DbSpecific +set map($m,DatabaseSpecific_s) DatabaseSpecificUnit +set map($m,ListStatuses_s) ListStatus +set map($m,IdAuthenticationIdPass) IdPass +set map($m,OtherInformation_s) OtherInformationUnit +set unionmap($m,OtherInformationUnit,information) {which information OtherInfo} +set unionmap($m,OtherInformation) {num_elements list} +set unionmap($m,Specification,elementSpec) {} +set map($m,Specification_0) ElementSpec +set unionmap($m,Specification,schema) {which schema Schema} + +# ---- +set m DiagnosticFormatDiag1 +set filename($m) z-diag1 +set map($m,DiagFormat_tooMany) TooMany +set map($m,DiagFormat_badSpec) BadSpec +set map($m,DiagFormat_dbUnavail) DbUnavail +set map($m,DiagFormat_attribute) Attribute +set map($m,DiagFormat_attCombo) AttCombo +set map($m,DiagFormat_term) DiagTerm +set map($m,DiagFormat_proximity) Proximity +set map($m,DiagFormat_scan) Scan +set map($m,DiagFormat_sort) Sort +set unionmap($m,Sort) {which u SortD} +set map($m,DiagFormat_segmentation) Segmentation +set map($m,DiagFormat_extServices) ExtServices +set map($m,DiagFormat_accessCtrl) AccessCtrl +set map($m,DiagFormat_recordSyntax) RecordSyntax +# +set map($m,Scan_termList2) AttrListList +set map($m,Sort_inputTooLarge) StringList +# +set map($m,AccessCtrl_oid) OidList +set map($m,AccessCtrl_alternative) AltOidList +# ---- +set m RecordSyntax-explain +set filename($m) z-exp +set map($m,Explain-Record) ExplainRecord +set map($m,ElementDataType_structured) ElementInfoList +set map($m,HumanString_s) HumanStringUnit +set unionmap($m,HumanString) {num_strings strings} +set membermap($m,CommonInfo,humanString-Language) humanStringLanguage +set unionmap($m,AttributeOccurrence,attributeValues) {which attributeValues AttributeOcc} +set unionmap($m,AttributeCombination) {num_occurrences occurrences} +# +set membermap($m,NetworkAddress,internetAddress) {NetworkAddress_iA internetAddress} +set map($m,NetworkAddress_iA) NetworkAddressIA +set membermap($m,NetworkAddress,osiPresentationAddress) {NetworkAddress_oPA osiPresentationAddress} +set map($m,NetworkAddress_oPA) NetworkAddressOPA +set map($m,NetworkAddress_other) NetworkAddressOther +set unionmap($m,DatabaseList) {num_databases databases} +set membermap($m,TargetInfo,recent-news) recentNews +set membermap($m,TargetInfo,usage-restrictions) usageRest +set membermap($m,DatabaseInfo,user-fee) userFee +# +set map($m,ProximitySupport_0) ProxSupportUnit +set map($m,ProxSupportUnitZprivate) ProxSupportPrivate +set membermap($m,ProxSupportUnit,private) {ProxSupportUnit_private zprivate} +# +set map($m,AttributeOccurrence_specific) AttributeValueList +set unionmap($m,AttributeValueList) {num_attributes attributes} + +set unionmap($m,ExplainRecord) {which u Explain} +set map($m,SchemaInfo_0) TagTypeMapping +set map($m,TagSetInfo_0) TagSetElements +set map($m,TermListInfo_0) TermListElement +set map($m,TermListDetails_0) EScanInfo +set map($m,PrivateCapabilities_0) PrivateCapOperator +set map($m,Costs_0) CostsOtherCharge +set map($m,Path_s) PathUnit +set map($m,IconObject_s) IconObjectUnit +set map($m,NetworkAddressInternetAddress) NetworkAddressIA +set map($m,NetworkAddressOsiPresentationAddress) NetworkAddressOPA +set membermap($m,QueryTypeDetails,private) {QueryTypeDetails_private zprivate} +set membermap($m,PrivateCapOperator,operator) roperator +set map($m,AccessRestrictions_s) AccessRestrictionsUnit +# ---- +set m RecordSyntax-SUTRS +set filename($m) z-sutrs +#set map($m,SutrsRecord) SUTRS +set body($m,c) { +int z_SUTRS (ODR o, Odr_oct **p, int opt, const char *name) +{ + return odr_implicit_tag(o, odr_octetstring, p, ODR_UNIVERSAL, + ODR_GENERALSTRING, opt, name); +} +} + +set init($m,h) { +typedef Odr_oct Z_SUTRS; +YAZ_EXPORT int z_SUTRS (ODR o, Odr_oct **p, int opt, const char *name); +} +# ---- +set m RecordSyntax-opac +set filename($m) z-opac +# ---- +set m RecordSyntax-summary +set filename($m) z-sum +# ---- +set m RecordSyntax-generic +set filename($m) z-grs +set map($m,ElementData_subtree) GenericRecord +set map($m,Variant_0) Triple +set membermap($m,Triple,class) zclass +set unionmap($m,Triple,value) {which value Triple} +set unionmap($m,GenericRecord) {num_elements elements} +# ---- +set m RecordSyntax-ESTaskPackage +set filename($m) z-estask +# ---- +set m ResourceReport-Format-Resource-1 +set filename($m) z-rrf1 +set map($m,ResourceReport) ResourceReport1 +set map($m,Estimate) Estimate1 +# ---- +set m ResourceReport-Format-Resource-2 +set filename($m) z-rrf2 +set map($m,ResourceReport) ResourceReport2 +set map($m,Estimate) Estimate2 +# ---- +set m AccessControlFormat-prompt-1 +set filename($m) z-accform1 +set membermap($m,PromptId,enummeratedPrompt) enumeratedPrompt +set map($m,PromptObject) PromptObject1 +set map($m,Challenge) Challenge1 +set map($m,Challenge1_s) ChallengeUnit1 +set map($m,Response) Response1 +set map($m,Response1_s) ResponseUnit1 +set map($m,PromptObject) PromptObject1 +# ---- +set m AccessControlFormat-des-1 +set filename($m) z-accdes1 +# ---- +set m AccessControlFormat-krb-1 +set filename($m) z-acckrb1 +# ---- +set m ESFormat-PersistentResultSet +set filename($m) zes-pset +# ---- +set m ESFormat-PersistentQuery +set filename($m) zes-pquery +# ---- +set m ESFormat-PeriodicQuerySchedule +set filename($m) zes-psched +# ---- +set m ESFormat-ItemOrder +set filename($m) zes-order +set map($m,ItemOrderEsRequest) Request +set map($m,ItemOrderTaskPackage) TaskPackage +set map($m,OriginPartToKeep_0) Contact +set map($m,OriginPartToKeep_1) Billing +set map($m,OriginPartNotToKeep_0) ResultSetItem +# +# ---- (old version) +set m ESFormat-Update0 +set filename($m) zes-update0 +set map($m,SuppliedRecords_s) SuppliedRecords_elem +set map($m,SuppliedRecords_elem_0) SuppliedRecordsId +# +# ---- (new, current version) +set m ESFormat-Update +set filename($m) zes-update +set map($m,SuppliedRecords_s) SuppliedRecords_elem +set map($m,SuppliedRecords_elem_0) SuppliedRecordsId +# ---- +set m ESFormat-ExportSpecification +set filename($m) zes-exps +# ---- +set m ESFormat-ExportInvocation +set filename($m) zes-expi +# ---- +set m UserInfoFormat-searchResult-1 +set filename($m) z-uifr1 +# ---- +set m ElementSpecificationFormat-eSpec-1 +set filename($m) z-espec1 +set map($m,Espec-1) Espec1 +set map($m,TagPath) ETagPath +set map($m,ETagPath_s) ETagUnit +set map($m,ETagUnitSpecificTag) SpecificTag +set membermap($m,SpecificTag,occurrence) occurrences +set unionmap($m,ElementRequest) {which u ERequest} +set unionmap($m,ETagPath) {num_tags tags} +set map($m,OccurrencesValues) OccurValues +# ---- +set m UserInfoFormat-dateTime +set filename($m) z-date +set map($m,Z3950Date) Date +set map($m,Z3950Time) Time +set unionmap($m,Z3950Date,era) {} +set map($m,DateFlags_0) Era +set map($m,Z3950DateMonthAndDay) MonthAndDay +set map($m,Z3950DateQuarter) DateQuater +set map($m,Z3950DateSeason) DateSeason +set map($m,Date_0) DateFlags +set unionmap($m,DateFlags,era) {} +# ---- +set m UserInfoFormat-multipleSearchTerms-2 +set filename($m) z-mterm2 +# ---- +set m ResourceReport-Format-Universe-1 +set filename($m) z-univ +# ---- +set m UserInfoFormat-oclcUserInformation +set filename($m) z-oclcui +# ---- +set m ESFormat-Admin +set filename($m) zes-admin +set map($m,EsRequest) ESAdminRequest +set map($m,TaskPackage) ESAdminTaskPackage +set map($m,OriginPartToKeep) ESAdminOriginPartToKeep +set map($m,OriginPartNotToKeep) ESAdminOriginPartNotToKeep +set map($m,TargetPart) ESAdminTargetPart +# ---- +set m NegotiationRecordDefinition-charSetandLanguageNegotiation-3 +set filename($m) z-charneg +set membermap($m,OriginProposal_0,private) {OriginProposal_0_private zprivate} +set membermap($m,TargetResponse,private) {TargetResponse_private zprivate} +# ---------------------------------------------------------- +# "Constructed" types defined by means of C-types are declared here. +# Each function returns the C-handler and the C-type. +proc asnBasicEXTERNAL {} { + return {z_External Z_External} +} diff --git a/src/z3950oid.c b/src/z3950oid.c new file mode 100644 index 0000000..86f500a --- /dev/null +++ b/src/z3950oid.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * + * $Id: z3950oid.c,v 1.1 2003-10-27 12:21:36 adam Exp $ + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include + +Odr_oid *yaz_oidval_to_z3950oid (ODR o, int oid_class, int oid_value) +{ + oident ident; + int oid[OID_SIZE]; + + ident.proto = PROTO_Z3950; + ident.oclass = (enum oid_class) oid_class; + ident.value = (enum oid_value) oid_value; + + if (ident.value == VAL_NONE) + return 0; + + return odr_oiddup(o, oid_ent_to_oid(&ident, oid)); +} + +Odr_oid *yaz_str_to_z3950oid (ODR o, int oid_class, const char *str) +{ + struct oident ident; + int oid[OID_SIZE]; + + ident.proto = PROTO_Z3950; + ident.oclass = (enum oid_class) oid_class; + ident.value = oid_getvalbyname(str); + + if (ident.value == VAL_NONE) + return 0; + + return odr_oiddup(o, oid_ent_to_oid(&ident, oid)); +} + +const char *yaz_z3950oid_to_str (Odr_oid *oid, int *oid_class) +{ + struct oident *ident = oid_getentbyoid(oid); + + if (!ident || ident->value == VAL_NONE) + return 0; + *oid_class = ident->oclass; + return ident->desc; +} + + +const char* yaz_z3950_oid_value_to_str(oid_value ov, oid_class oc) +{ + struct oident tmpentry; + int tmp_oid[OID_SIZE]; + + tmpentry.proto = PROTO_Z3950; + tmpentry.oclass = oc; + tmpentry.value = ov; + + if( oid_ent_to_oid(&tmpentry,tmp_oid) ) + { + return tmpentry.desc; + } + else + { + return ""; + } +} + + +/* + * Local variables: + * tab-width: 8 + * c-basic-offset: 4 + * End: + * vim600: sw=4 ts=8 fdm=marker + * vim<600: sw=4 ts=8 + */ diff --git a/src/z3950v3.asn b/src/z3950v3.asn new file mode 100644 index 0000000..98cf885 --- /dev/null +++ b/src/z3950v3.asn @@ -0,0 +1,2667 @@ +Z39-50-APDU-1995 -- OID for this definition, assigned in OID.3.1, is {Z39-50 2 1} +DEFINITIONS ::= +BEGIN -- Z39.50 Maintenance Agency Official Text for ANSI/NISO Z39.50-1995 - July 1995 +-- +EXPORTS OtherInformation, Term, AttributeSetId, AttributeList, AttributeElement, ElementSetName, SortElement, DatabaseName, +CompSpec, Specification, Permissions, InternationalString, IntUnit, Unit, StringOrNumeric, Query, Records, ResultSetId, +DefaultDiagFormat, DiagRec, Segment; +-- + +PDU ::= CHOICE{ + initRequest [20] IMPLICIT InitializeRequest, + initResponse [21] IMPLICIT InitializeResponse, + searchRequest [22] IMPLICIT SearchRequest, + searchResponse [23] IMPLICIT SearchResponse, + presentRequest [24] IMPLICIT PresentRequest, + presentResponse [25] IMPLICIT PresentResponse, + deleteResultSetRequest [26] IMPLICIT DeleteResultSetRequest, + deleteResultSetResponse [27] IMPLICIT DeleteResultSetResponse, + accessControlRequest [28] IMPLICIT AccessControlRequest, + accessControlResponse [29] IMPLICIT AccessControlResponse, + resourceControlRequest [30] IMPLICIT ResourceControlRequest, + resourceControlResponse [31] IMPLICIT ResourceControlResponse, + triggerResourceControlRequest [32] IMPLICIT TriggerResourceControlRequest, + resourceReportRequest [33] IMPLICIT ResourceReportRequest, + resourceReportResponse [34] IMPLICIT ResourceReportResponse, + scanRequest [35] IMPLICIT ScanRequest, + scanResponse [36] IMPLICIT ScanResponse, + -- [37] through [42] reserved + sortRequest [43] IMPLICIT SortRequest, + sortResponse [44] IMPLICIT SortResponse, + segmentRequest [45] IMPLICIT Segment, + extendedServicesRequest [46] IMPLICIT ExtendedServicesRequest, + extendedServicesResponse [47] IMPLICIT ExtendedServicesResponse, + close [48] IMPLICIT Close, + duplicateDetectionRequest [49] IMPLICIT DuplicateDetectionRequest, + duplicateDetectionResponse [50] IMPLICIT DuplicateDetectionResponse} + + +-- Initialize APDUs +-- + InitializeRequest ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + protocolVersion ProtocolVersion, + options Options, + preferredMessageSize [5] IMPLICIT INTEGER, + exceptionalRecordSize [6] IMPLICIT INTEGER, + idAuthentication [7] IdAuthentication OPTIONAL, -- see note below + implementationId [110] IMPLICIT InternationalString OPTIONAL, + implementationName [111] IMPLICIT InternationalString OPTIONAL, + implementationVersion [112] IMPLICIT InternationalString OPTIONAL, + userInformationField [11] EXTERNAL OPTIONAL, + otherInfo OtherInformation OPTIONAL} +--Note: +-- For idAuthentication, the type ANY is retained for compatibility with earlier versions. +-- For interoperability, the following is recommended: +IdAuthentication ::= + CHOICE{ + open VisibleString, + idPass SEQUENCE { + groupId [0] IMPLICIT InternationalString OPTIONAL, + userId [1] IMPLICIT InternationalString OPTIONAL, + password [2] IMPLICIT InternationalString OPTIONAL }, + anonymous NULL, + other EXTERNAL + } +-- May use access control formats for 'other'. See Appendix 7 ACC. +-- + InitializeResponse ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + protocolVersion ProtocolVersion, + options Options, + preferredMessageSize [5] IMPLICIT INTEGER, + exceptionalRecordSize [6] IMPLICIT INTEGER, + result [12] IMPLICIT BOOLEAN, -- reject = FALSE; Accept = TRUE + implementationId [110] IMPLICIT InternationalString OPTIONAL, + implementationName [111] IMPLICIT InternationalString OPTIONAL, + implementationVersion [112] IMPLICIT InternationalString OPTIONAL, + userInformationField [11] EXTERNAL OPTIONAL, + otherInfo OtherInformation OPTIONAL} +-- Begin auxiliary definitions for Init PDUs + ProtocolVersion ::= [3] IMPLICIT BIT STRING{ + version-1 (0), -- This bit should always be set, but does not + -- correspond to any Z39.50 version. + version-2 (1), -- "Version 2 supported." + -- This bit should always be set. + version-3 (2) -- "Version 3 supported." +-- Values higher than 'version-3' should be ignored. Both the Initialize request and Initialize Response APDUs +-- include a value string corresponding to the supported versions. The highest common version is selected +-- for use. If there are no versions in common, "Result" in the Init Response should indicate "reject." +-- Note: Versions 1 and 2 are identical. Systems supporting version 2 should indicate support for version +-- 1 as well, for interoperability with systems that indicate support for version 1 only (e.g. ISO 10163-1991 +-- implementations). + } + Options ::= [4] IMPLICIT BIT STRING{ + search (0), + present (1), + delSet (2), + resourceReport (3), + triggerResourceCtrl (4), + resourceCtrl (5), + accessCtrl (6), + scan (7), + sort (8), + -- (not used) (9), + extendedServices (10), + level-1Segmentation (11), + level-2Segmentation (12), + concurrentOperations (13), + namedResultSets (14), + encapsulation (15), + resultCount (16), + negotiationModel (17), + duplicateDetection (18), + queryType104 (19), + pQESCorrection (20), + stringSchema (21) +} +-- end auxiliary definitions for Init PDUs + + +--Search APDUs + SearchRequest ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + smallSetUpperBound [13] IMPLICIT INTEGER, + largeSetLowerBound [14] IMPLICIT INTEGER, + mediumSetPresentNumber [15] IMPLICIT INTEGER, + replaceIndicator [16] IMPLICIT BOOLEAN, + resultSetName [17] IMPLICIT InternationalString, + databaseNames [18] IMPLICIT SEQUENCE OF DatabaseName, + smallSetElementSetNames [100] ElementSetNames OPTIONAL, + mediumSetElementSetNames [101] ElementSetNames OPTIONAL, + preferredRecordSyntax [104] IMPLICIT OBJECT IDENTIFIER OPTIONAL, + query [21] Query, + -- Following two parameters may be used only if version 3 is in force. + additionalSearchInfo [203] IMPLICIT OtherInformation OPTIONAL, + otherInfo OtherInformation OPTIONAL} + + +-- Query Definitions + Query ::= CHOICE{ + type-0 [0] ANY, + type-1 [1] IMPLICIT RPNQuery, + type-2 [2] OCTET STRING, + type-100 [100] OCTET STRING, + type-101 [101] IMPLICIT RPNQuery, + type-102 [102] OCTET STRING, + type-104 [104] IMPLICIT EXTERNAL +} +-- +-- Definitions for RPN query + RPNQuery ::= SEQUENCE{ + attributeSet AttributeSetId, + rpn RPNStructure} +-- + RPNStructure ::= CHOICE{ + op [0] Operand, + rpnRpnOp [1] IMPLICIT SEQUENCE{ + rpn1 RPNStructure, + rpn2 RPNStructure, + op Operator }} + Operand ::= CHOICE{ + attrTerm AttributesPlusTerm, + resultSet ResultSetId, + -- If version 2 is in force: + -- - If query type is 1, one of the above two must be chosen; + -- - resultAttr (below) may be used only if query type is 101. + resultAttr ResultSetPlusAttributes} + + AttributesPlusTerm ::= [102] IMPLICIT SEQUENCE{ + attributes AttributeList, + term Term} + ResultSetPlusAttributes ::= [214] IMPLICIT SEQUENCE{ + resultSet ResultSetId, + attributes AttributeList} + AttributeList ::= [44] IMPLICIT SEQUENCE OF AttributeElement +-- + Term ::= CHOICE{ + general [45] IMPLICIT OCTET STRING, + -- values below may be used only if version 3 is in force + numeric [215] IMPLICIT INTEGER, + characterString [216] IMPLICIT InternationalString, + oid [217] IMPLICIT OBJECT IDENTIFIER, + dateTime [218] IMPLICIT GeneralizedTime, + external [219] IMPLICIT EXTERNAL, + integerAndUnit [220] IMPLICIT IntUnit, + null [221] IMPLICIT NULL} + + Operator ::= [46] CHOICE{ + and [0] IMPLICIT NULL, + or [1] IMPLICIT NULL, + and-not [2] IMPLICIT NULL, + -- If version 2 is in force: + -- - For query type 1, one of the above three must be chosen; + -- - prox (below) may be used only if query type is 101. + prox [3] IMPLICIT ProximityOperator} + AttributeElement ::= SEQUENCE{ + attributeSet [1] IMPLICIT AttributeSetId OPTIONAL, + -- Must be omitted if version 2 is in force. + -- If included, overrides value of attributeSet + -- in RPNQuery above, but only for this attribute. + attributeType [120] IMPLICIT INTEGER, + attributeValue CHOICE{ + numeric [121] IMPLICIT INTEGER, + -- If version 2 is in force, + -- Must select 'numeric' for attributeValue. + + complex [224] IMPLICIT SEQUENCE{ + list [1] IMPLICIT SEQUENCE OF StringOrNumeric, + semanticAction [2] IMPLICIT SEQUENCE OF INTEGER OPTIONAL}}} + + + ProximityOperator ::= SEQUENCE{ + exclusion [1] IMPLICIT BOOLEAN OPTIONAL, + distance [2] IMPLICIT INTEGER, + ordered [3] IMPLICIT BOOLEAN, + relationType [4] IMPLICIT INTEGER{ + lessThan (1), + lessThanOrEqual (2), + equal (3), + greaterThanOrEqual (4), + greaterThan (5), + notEqual (6)}, + proximityUnitCode [5] CHOICE{ + known [1] IMPLICIT KnownProximityUnit, + private [2] IMPLICIT INTEGER}} +-- + KnownProximityUnit ::= INTEGER{ + character (1), + word (2), + sentence (3), + paragraph (4), + section (5), + chapter (6), + document (7), + element (8), + subelement (9), + elementType (10), + byte (11) -- Version 3 only + } +-- End definitions for RPN Query + + +SearchResponse ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + resultCount [23] IMPLICIT INTEGER, + numberOfRecordsReturned [24] IMPLICIT INTEGER, + nextResultSetPosition [25] IMPLICIT INTEGER, + searchStatus [22] IMPLICIT BOOLEAN, + resultSetStatus [26] IMPLICIT INTEGER{ + subset (1), + interim (2), + none (3)} OPTIONAL, + presentStatus PresentStatus OPTIONAL, + records Records OPTIONAL, + -- Following two parameters may be used only if version 3 is in force. + additionalSearchInfo [203] IMPLICIT OtherInformation OPTIONAL, + otherInfo OtherInformation OPTIONAL} +--Retrieval APDUs + PresentRequest ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + resultSetId ResultSetId, + resultSetStartPoint [30] IMPLICIT INTEGER, + numberOfRecordsRequested [29] IMPLICIT INTEGER, + additionalRanges [212] IMPLICIT SEQUENCE OF Range OPTIONAL, + -- additionalRanges may be included only if version 3 is in force. + recordComposition CHOICE{ + simple [19] ElementSetNames, + -- must choose 'simple' if version 2 is in force + complex [209] IMPLICIT CompSpec} OPTIONAL, + preferredRecordSyntax [104] IMPLICIT OBJECT IDENTIFIER OPTIONAL, + maxSegmentCount [204] IMPLICIT INTEGER OPTIONAL, -- level 1 or 2 + maxRecordSize [206] IMPLICIT INTEGER OPTIONAL, -- level 2 only + maxSegmentSize [207] IMPLICIT INTEGER OPTIONAL, -- level 2 only + otherInfo OtherInformation OPTIONAL} +-- + Segment ::= SEQUENCE{ + -- Segment PDU may only be used when version 3 is in force, + -- and only when segmentation is in effect. + referenceId ReferenceId OPTIONAL, + numberOfRecordsReturned [24] IMPLICIT INTEGER, + segmentRecords [0] IMPLICIT SEQUENCE OF NamePlusRecord, + otherInfo OtherInformation OPTIONAL} +-- + PresentResponse ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + numberOfRecordsReturned [24] IMPLICIT INTEGER, + nextResultSetPosition [25] IMPLICIT INTEGER, + presentStatus PresentStatus, + records Records OPTIONAL, + otherInfo OtherInformation OPTIONAL} +-- begin auxiliary definitions for Search and Present APDUs + +-- begin definition of records + Records ::= CHOICE{ + responseRecords [28] IMPLICIT SEQUENCE OF NamePlusRecord, + nonSurrogateDiagnostic [130] IMPLICIT DefaultDiagFormat, + multipleNonSurDiagnostics [205] IMPLICIT SEQUENCE OF DiagRec} +-- + NamePlusRecord ::= SEQUENCE{ + name [0] IMPLICIT DatabaseName OPTIONAL, + record [1] CHOICE{ + retrievalRecord [1] EXTERNAL, + surrogateDiagnostic [2] DiagRec, + -- Must select one of the above two, retrievalRecord or + -- surrogateDiagnostic, unless 'level 2 segmentation' is in effect. + startingFragment [3] FragmentSyntax, + intermediateFragment [4] FragmentSyntax, + finalFragment [5] FragmentSyntax}} + FragmentSyntax ::= CHOICE{ + externallyTagged EXTERNAL, + notExternallyTagged OCTET STRING} + + DiagRec ::= CHOICE{ + defaultFormat DefaultDiagFormat, + -- Must choose defaultFormat if version 2 is in effect. + externallyDefined EXTERNAL} + + DefaultDiagFormat::= SEQUENCE{ + diagnosticSetId OBJECT IDENTIFIER, + condition INTEGER, + addinfo CHOICE{ + v2Addinfo VisibleString, -- version 2 + v3Addinfo InternationalString -- version 3 + }} + -- end definition of records + Range ::= SEQUENCE{ + startingPosition [1] IMPLICIT INTEGER, + numberOfRecords [2] IMPLICIT INTEGER} +-- + ElementSetNames ::= CHOICE { + genericElementSetName [0] IMPLICIT InternationalString, + databaseSpecific [1] IMPLICIT SEQUENCE OF SEQUENCE{ + dbName DatabaseName, + esn ElementSetName}} + + PresentStatus ::= [27] IMPLICIT INTEGER{ + success (0), + partial-1 (1), + partial-2 (2), + partial-3 (3), + partial-4 (4), + failure (5)} + +-- begin definition of composition specification + CompSpec ::= SEQUENCE{ + selectAlternativeSyntax [1] IMPLICIT BOOLEAN, + -- See comment for recordSyntax, below. + generic [2] IMPLICIT Specification OPTIONAL, + dbSpecific [3] IMPLICIT SEQUENCE OF SEQUENCE{ + db [1] DatabaseName, + spec [2] IMPLICIT Specification} OPTIONAL, + -- At least one of generic and dbSpecific must occur, and both may occur. If both, then for + -- any record not in the list of databases within dbSpecific, generic applies. + recordSyntax [4] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL + -- For each record, the target selects the first record syntax + -- in this list that it can support. If the list is exhausted, the + -- target may select an alternative syntax if + -- selectAlternativeSyntax is 'true'. + } + Specification ::= SEQUENCE{ + schema CHOICE { + oid [1] IMPLICIT OBJECT IDENTIFIER, + uri [300] IMPLICIT InternationalString + } OPTIONAL, + elementSpec [2] CHOICE{ + elementSetName [1] IMPLICIT InternationalString, + externalEspec [2] IMPLICIT EXTERNAL} OPTIONAL} +-- end definition of composition specification +-- end auxiliary definitions for search and response APDUs + +-- Delete APDUs + DeleteResultSetRequest ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + deleteFunction [32] IMPLICIT INTEGER{ + list (0), + all (1)}, + resultSetList SEQUENCE OF ResultSetId OPTIONAL, + otherInfo OtherInformation OPTIONAL} +-- + DeleteResultSetResponse ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + deleteOperationStatus [0] IMPLICIT DeleteSetStatus, + deleteListStatuses [1] IMPLICIT ListStatuses OPTIONAL, + numberNotDeleted [34] IMPLICIT INTEGER OPTIONAL, + bulkStatuses [35] IMPLICIT ListStatuses OPTIONAL, + deleteMessage [36] IMPLICIT InternationalString OPTIONAL, + otherInfo OtherInformation OPTIONAL} + ListStatuses ::= SEQUENCE OF SEQUENCE{ + id ResultSetId, + status DeleteSetStatus} + + DeleteSetStatus ::= [33] IMPLICIT INTEGER{ + success (0), + resultSetDidNotExist (1), + previouslyDeletedByTarget (2), + systemProblemAtTarget (3), + accessNotAllowed (4), + resourceControlAtOrigin (5), + resourceControlAtTarget (6), + bulkDeleteNotSupported (7), + notAllRsltSetsDeletedOnBulkDlte (8), + notAllRequestedResultSetsDeleted (9), + resultSetInUse (10)} +-- + +--Access- and Resource-control APDUs +-- + AccessControlRequest ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + securityChallenge CHOICE{ + simpleForm [37] IMPLICIT OCTET STRING, + externallyDefined [0] EXTERNAL}, + otherInfo OtherInformation OPTIONAL} + + AccessControlResponse ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + securityChallengeResponse CHOICE{ + simpleForm [38] IMPLICIT OCTET STRING, + externallyDefined [0] EXTERNAL} OPTIONAL, + -- Optional only in version 3; mandatory in version 2. If + -- omitted (in version 3) then diagnostic must occur. + diagnostic [223] DiagRec OPTIONAL, -- Version 3 only. + otherInfo OtherInformation OPTIONAL} + + + + ResourceControlRequest ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + suspendedFlag [39] IMPLICIT BOOLEAN OPTIONAL, + resourceReport [40] ResourceReport OPTIONAL, + partialResultsAvailable [41] IMPLICIT INTEGER{ + subset (1), + interim (2), + none (3)} OPTIONAL, + responseRequired [42] IMPLICIT BOOLEAN, + triggeredRequestFlag [43] IMPLICIT BOOLEAN OPTIONAL, + otherInfo OtherInformation OPTIONAL} + + + ResourceControlResponse ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + continueFlag [44] IMPLICIT BOOLEAN, + resultSetWanted [45] IMPLICIT BOOLEAN OPTIONAL, + otherInfo OtherInformation OPTIONAL} + + + + TriggerResourceControlRequest ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + requestedAction [46] IMPLICIT INTEGER{ + resourceReport (1), + resourceControl (2), + cancel (3)}, + prefResourceReportFormat [47] IMPLICIT ResourceReportId OPTIONAL, + resultSetWanted [48] IMPLICIT BOOLEAN OPTIONAL, + otherInfo OtherInformation OPTIONAL} + + + + ResourceReportRequest ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + opId [210] IMPLICIT ReferenceId OPTIONAL, + prefResourceReportFormat [49] IMPLICIT ResourceReportId OPTIONAL, + otherInfo OtherInformation OPTIONAL} +-- + ResourceReportResponse ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + resourceReportStatus [50] IMPLICIT INTEGER{ + success (0), + partial (1), + failure-1 (2), + failure-2 (3), + failure-3 (4), + failure-4 (5), + failure-5 (6), + failure-6 (7)}, + resourceReport [51] ResourceReport OPTIONAL, + otherInfo OtherInformation OPTIONAL} +-- + ResourceReport ::= EXTERNAL + ResourceReportId ::= OBJECT IDENTIFIER + +--Scan APDUs + ScanRequest ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + databaseNames [3] IMPLICIT SEQUENCE OF DatabaseName, + attributeSet AttributeSetId OPTIONAL, + termListAndStartPoint AttributesPlusTerm, + stepSize [5] IMPLICIT INTEGER OPTIONAL, + numberOfTermsRequested [6] IMPLICIT INTEGER, + preferredPositionInResponse [7] IMPLICIT INTEGER OPTIONAL, + otherInfo OtherInformation OPTIONAL} + + ScanResponse ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + stepSize [3] IMPLICIT INTEGER OPTIONAL, + scanStatus [4] IMPLICIT INTEGER { + success (0), + partial-1 (1), + partial-2 (2), + partial-3 (3), + partial-4 (4), + partial-5 (5), + failure (6) }, + numberOfEntriesReturned [5] IMPLICIT INTEGER, + positionOfTerm [6] IMPLICIT INTEGER OPTIONAL, + entries [7] IMPLICIT ListEntries OPTIONAL, + attributeSet [8] IMPLICIT AttributeSetId OPTIONAL, + otherInfo OtherInformation OPTIONAL} + +-- begin auxiliary definitions for Scan + ListEntries ::= SEQUENCE{ + entries [1] IMPLICIT SEQUENCE OF Entry OPTIONAL, + nonsurrogateDiagnostics [2] IMPLICIT SEQUENCE OF DiagRec OPTIONAL + -- At least one of entries and nonsurrogateDiagnostics must occur + } + + Entry ::= CHOICE { + termInfo [1] IMPLICIT TermInfo, + surrogateDiagnostic [2] DiagRec} +-- + TermInfo ::= SEQUENCE { + term Term, + displayTerm [0] IMPLICIT InternationalString OPTIONAL, + -- Presence of displayTerm means that term is not considered by + -- the target to be suitable for display, and displayTerm should + -- instead be displayed. 'term' is the actual term in the term list; + -- 'displayTerm' is for display purposes only, and is not an actual + -- term in the term list. + suggestedAttributes AttributeList OPTIONAL, + alternativeTerm [4] IMPLICIT SEQUENCE OF AttributesPlusTerm OPTIONAL, + globalOccurrences [2] IMPLICIT INTEGER OPTIONAL, + byAttributes [3] IMPLICIT OccurrenceByAttributes OPTIONAL, + otherTermInfo OtherInformation OPTIONAL} + + OccurrenceByAttributes ::= SEQUENCE OF SEQUENCE{ + attributes [1] AttributeList, + occurrences CHOICE{ + global [2] INTEGER, + byDatabase [3] IMPLICIT SEQUENCE OF SEQUENCE{ + db DatabaseName, + num [1] IMPLICIT INTEGER OPTIONAL, + otherDbInfo OtherInformation OPTIONAL}} OPTIONAL, + otherOccurInfo OtherInformation OPTIONAL} +-- end auxiliary definitions for Scan + +-- Sort APDUs +SortRequest ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + inputResultSetNames [3] IMPLICIT SEQUENCE OF InternationalString, + sortedResultSetName [4] IMPLICIT InternationalString, + sortSequence [5] IMPLICIT SEQUENCE OF SortKeySpec, + -- order of occurrence is from major to minor + otherInfo OtherInformation OPTIONAL} + +SortResponse ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + sortStatus [3] IMPLICIT INTEGER{ + success (0), + partial-1 (1), + failure (2)}, + resultSetStatus [4] IMPLICIT INTEGER{ + empty (1), + interim (2), + unchanged (3), + none (4)} OPTIONAL, + diagnostics [5] IMPLICIT SEQUENCE OF DiagRec OPTIONAL, + resultCount [6] IMPLICIT INTEGER OPTIONAL, + otherInfo OtherInformation OPTIONAL} + +-- begin auxiliary definitions for Sort + SortKeySpec ::= SEQUENCE{ + sortElement SortElement, + sortRelation [1] IMPLICIT INTEGER{ + ascending (0), + descending (1), + ascendingByFrequency (3), + descendingByfrequency (4)}, + caseSensitivity [2] IMPLICIT INTEGER{ + caseSensitive (0), + caseInsensitive (1)}, + missingValueAction [3] CHOICE{ + abort [1] IMPLICIT NULL, + null [2] IMPLICIT NULL, + --supply a null value for missing value + missingValueData [3] IMPLICIT OCTET STRING} OPTIONAL} + + SortElement ::= CHOICE{ + generic [1] SortKey, + datbaseSpecific [2] IMPLICIT SEQUENCE OF SEQUENCE{ + databaseName DatabaseName, + dbSort SortKey}} + + SortKey ::= CHOICE{ + sortfield [0] IMPLICIT InternationalString, + -- An element, element-group-tag, or alias supported by the target + -- and denoting a set of elements associated with each record. + elementSpec [1] IMPLICIT Specification, + sortAttributes [2] IMPLICIT SEQUENCE{ + id AttributeSetId, + list AttributeList}} +-- end auxiliary definitions for sort + + + +-- Extended Service APDUs + ExtendedServicesRequest ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + function [3] IMPLICIT INTEGER { + create (1), + delete (2), + modify (3)}, + packageType [4] IMPLICIT OBJECT IDENTIFIER, + packageName [5] IMPLICIT InternationalString OPTIONAL, + -- PackageName mandatory for 'modify' or 'delete'; optional for + -- 'create'. Following four parameters mandatory for 'create'; should + -- be included on 'modify' if being modified; not needed on 'delete'. + userId [6] IMPLICIT InternationalString OPTIONAL, + retentionTime [7] IMPLICIT IntUnit OPTIONAL, + permissions [8] IMPLICIT Permissions OPTIONAL, + description [9] IMPLICIT InternationalString OPTIONAL, + +-- (ExtendedServiceRequest APDU continued) + taskSpecificParameters [10] IMPLICIT EXTERNAL OPTIONAL, + -- Mandatory for 'create'; included on 'modify' if specific + -- parameters being modified; not necessary on 'delete'. For the + -- 'EXTERNAL,' use OID of specific ES definition and select + -- CHOICE [1]: 'esRequest'. + waitAction [11] IMPLICIT INTEGER{ + wait (1), + waitIfPossible (2), + dontWait (3), + dontReturnPackage (4)}, + elements ElementSetName OPTIONAL, + otherInfo OtherInformation OPTIONAL} +-- + +ExtendedServicesResponse ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, + operationStatus [3] IMPLICIT INTEGER{ + done (1), + accepted (2), + failure (3)}, + diagnostics [4] IMPLICIT SEQUENCE OF DiagRec OPTIONAL, + taskPackage [5] IMPLICIT EXTERNAL OPTIONAL, + -- Use OID: {Z39-50-recordSyntax (106)} and corresponding + -- syntax. For the EXTERNAL, 'taskSpecific,' within that + -- definition, use OID of the specific es, and choose [2], + -- 'taskPackage'. + otherInfo OtherInformation OPTIONAL} + + Permissions ::= SEQUENCE OF SEQUENCE{ + userId [1] IMPLICIT InternationalString, + allowableFunctions [2] IMPLICIT SEQUENCE OF INTEGER{ + delete (1), + modifyContents (2), + modifyPermissions (3), + present (4), + invoke (5)}} + +Close ::= SEQUENCE{ + referenceId ReferenceId OPTIONAL, -- See 3.2.11.1.5. + closeReason CloseReason, + diagnosticInformation [3] IMPLICIT InternationalString OPTIONAL, + resourceReportFormat [4] IMPLICIT ResourceReportId OPTIONAL, + -- For use by origin only, and only on Close request; + -- origin requests target to include report in response. + resourceReport [5] ResourceReport OPTIONAL, + -- For use by target only, unilaterally on Close request; + -- on Close response may be unilateral or in response + -- to origin request. + otherInfo OtherInformation OPTIONAL} + + CloseReason ::= [211] IMPLICIT INTEGER{ + finished (0), + shutdown (1), + systemProblem (2), + costLimit (3), + resources (4), + securityViolation (5), + protocolError (6), + lackOfActivity (7), + peerAbort (8), + unspecified (9)} + +--Duplicate detection APDUs +DuplicateDetectionRequest ::= SEQUENCE { + referenceId ReferenceId OPTIONAL, + inputResultSetIds [3] IMPLICIT SEQUENCE OF InternationalString, + outputResultSetName [4] IMPLICIT InternationalString, + applicablePortionOfRecord [5] IMPLICIT EXTERNAL OPTIONAL, + duplicateDetectionCriteria [6] IMPLICIT SEQUENCE OF + DuplicateDetectionCriterion OPTIONAL, + clustering [7] IMPLICIT BOOLEAN OPTIONAL, + -- 'true' means "clustered". + -- This parameter may be omitted + -- only if retentionCriteria CHOICE is + -- 'numberOfEntries' and its value is 1. + retentionCriteria [8] IMPLICIT SEQUENCE OF + RetentionCriterion, + sortCriteria [9] IMPLICIT SEQUENCE OF + SortCriterion OPTIONAL, + otherInfo OtherInformation OPTIONAL} + +DuplicateDetectionCriterion ::= CHOICE{ + levelOfMatch [1] IMPLICIT INTEGER, + -- a percentage; 1-100. + caseSensitive [2] IMPLICIT NULL, + punctuationSensitive [3] IMPLICIT NULL, + regularExpression [4] IMPLICIT EXTERNAL, + rsDuplicates [5] IMPLICIT NULL + -- values 6-100 reserved for future assignment. + } + +RetentionCriterion ::= CHOICE{ + numberOfEntries [1] IMPLICIT INTEGER, + -- greater than 0 + percentOfEntries [2] IMPLICIT INTEGER, + -- 1-100, + duplicatesOnly [3] IMPLICIT NULL, + -- should not be chosen + -- if clustering is 'true' + discardRsDuplicates [4] IMPLICIT NULL + -- values 5-100 reserved for future assignment. + } + +SortCriterion ::= CHOICE{ + mostComprehensive [1] IMPLICIT NULL, + leastConmprehensive [2] IMPLICIT NULL, + mostRecent [3] IMPLICIT NULL, + oldest [4] IMPLICIT NULL, + leastCost [5] IMPLICIT NULL, + preferredDatabases [6] IMPLICIT + SEQUENCE OF InternationalString + -- values 7-100 reserved for future assignment. +} + +DuplicateDetectionResponse ::= SEQUENCE { + referenceId ReferenceId OPTIONAL, + status [3] IMPLICIT INTEGER{ + success (0), + failure (1)}, + resultSetCount [4] IMPLICIT INTEGER OPTIONAL, + diagnostics [5] IMPLICIT SEQUENCE OF DiagRec OPTIONAL, + otherInfo OtherInformation OPTIONAL} + +-- Global auxiliary definitions + ReferenceId ::= [2] IMPLICIT OCTET STRING + ResultSetId ::= [31] IMPLICIT InternationalString + ElementSetName ::= [103] IMPLICIT InternationalString + DatabaseName ::= [105] IMPLICIT InternationalString + AttributeSetId ::= OBJECT IDENTIFIER + + +-- OtherInformation + OtherInformation ::= [201] IMPLICIT SEQUENCE OF SEQUENCE{ + category [1] IMPLICIT InfoCategory OPTIONAL, + information CHOICE{ + characterInfo [2] IMPLICIT InternationalString, + binaryInfo [3] IMPLICIT OCTET STRING, + externallyDefinedInfo [4] IMPLICIT EXTERNAL, + oid [5] IMPLICIT OBJECT IDENTIFIER}} +-- + InfoCategory ::= SEQUENCE{ + categoryTypeId [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL, + categoryValue [2] IMPLICIT INTEGER} + + +-- Units + -- IntUnit is used when value and unit are supplied together. Unit, alone, is used when just + -- specifying a unit (without a value). For example, IntUnit is used in Term, in an RPNQuery, or + -- it can be the datatype of an element within a retrieval record. Unit (alone) would be used in an + -- element request, when requesting data be returned according to a particular unit. + + IntUnit ::= SEQUENCE{ + value [1] IMPLICIT INTEGER, + unitUsed [2] IMPLICIT Unit} +-- + Unit ::= SEQUENCE{ + unitSystem [1] InternationalString OPTIONAL, -- e.g. 'SI' + unitType [2] StringOrNumeric OPTIONAL, -- e.g. 'mass' + unit [3] StringOrNumeric OPTIONAL, -- e.g. 'kilograms' + scaleFactor [4] IMPLICIT INTEGER OPTIONAL -- e.g. 9 means 10**9 + } + +--CharacterString + InternationalString ::= GeneralString + -- When version 2 is in force, this collapses to VisibleString. That is, only characters in the + -- visibleString repertoire may be used. (Datatype compatibility with version 2 is not affected, + -- because references are IMPLICIT.) When version 3 is in force, the semantics of the + -- GeneralString content may be altered by negotiation during initialization. If no such + -- negotiation is in effect, then GeneralString semantics are in force. + +StringOrNumeric ::= CHOICE{ + string [1] IMPLICIT InternationalString, + numeric [2] IMPLICIT INTEGER} + +END -- IR DEFINITIONS + + + +DiagnosticFormatDiag1 +{Z39-50-diagnosticFormat diag-1 (2)} DEFINITIONS ::= +BEGIN +IMPORTS Term, Specification, AttributeList, SortElement, DatabaseName, +DefaultDiagFormat, InternationalString FROM Z39-50-APDU-1995; + + +DiagnosticFormat ::= SEQUENCE OF SEQUENCE{ + diagnostic [1] CHOICE{ + defaultDiagRec [1] IMPLICIT DefaultDiagFormat, + explicitDiagnostic [2] DiagFormat} OPTIONAL, + message [2] IMPLICIT InternationalString OPTIONAL} + + +DiagFormat ::= CHOICE{ + +tooMany [1000] IMPLICIT SEQUENCE{ + tooManyWhat [1] IMPLICIT INTEGER{ + argumentWords (1), + truncatedWords (2), + booleanOperators (3), + incompleteSubfields (4), + characters (5), + recordsRetrieved (6), + dataBasesSpecified (7), + resultSetsCreated (8), + indexTermsProcessed (9)}, + max [2] IMPLICIT INTEGER OPTIONAL}, + + + + + + + +badSpec [1001] IMPLICIT SEQUENCE{ -- element set name or specification + spec [1] IMPLICIT Specification, -- esn or element spec not supported + db [2] IMPLICIT DatabaseName OPTIONAL, + -- if db specified, above spec not supported for db; otherwise, + -- spec not supported period. + goodOnes [3] IMPLICIT SEQUENCE OF Specification OPTIONAL + -- target supplies ones that are supported + }, + + +dbUnavail [1002] IMPLICIT SEQUENCE{ -- database unavailable + db [1] IMPLICIT DatabaseName, + why [2] IMPLICIT SEQUENCE{ + reasonCode [1] IMPLICIT INTEGER{ + doesNotExist (0), + existsButUnavail (1), + locked (2), + accessDenied (3)} OPTIONAL, + message [2] IMPLICIT InternationalString OPTIONAL}}, + + +unSupOp [1003] IMPLICIT INTEGER{ -- unsupported operator + and (0), + or (1), + and-not (2), + prox (3)}, + + +attribute [1004] IMPLICIT SEQUENCE{ + -- Applies for unsupported attribute set, attribute type, + -- attribute value, or term (for a given attribute type or value). + + id [1] IMPLICIT OBJECT IDENTIFIER, + -- if only "id" occurs, then attribute set is not supported + type [2] IMPLICIT INTEGER OPTIONAL, + -- must occur if value occurs. + value [3] IMPLICIT INTEGER OPTIONAL, + -- if omitted, and Type occurs, then Type is what is unsupported + term [4] Term OPTIONAL + -- If occurs, term is illegal or not supported, for attribute value, + -- if value occurs; otherwise, for type. + }, + + +attCombo [1005] IMPLICIT SEQUENCE{ -- attribute combination not supported + unsupportedCombination [1] IMPLICIT AttributeList, + recommendedAlternatives [2] IMPLICIT SEQUENCE OF AttributeList OPTIONAL}, + + + + +term [1006] IMPLICIT SEQUENCE{ + problem [1] IMPLICIT INTEGER{ + codedValue (1), + unparsable (2), + tooShort (3), + type (4)} OPTIONAL, + term [2] Term}, + + +proximity [1007] CHOICE{ -- proximity diagnostics: + resultSets [1] IMPLICIT NULL, -- proximity between sets not supported + badSet [2] IMPLICIT InternationalString, -- bad result set specified + relation [3] IMPLICIT INTEGER, -- 1 to 6 ; relation not supported + unit [4] IMPLICIT INTEGER, -- unsupported unit code + distance [5] IMPLICIT INTEGER, -- unsupported distance + attributes [6] AttributeList, -- proximity not supported with specified + -- attribute combination + ordered [7] IMPLICIT NULL, -- ordered flag not supported + exclusion [8] IMPLICIT NULL -- exclusion flag not supported + }, + + + + + +scan [1008] CHOICE{ -- scan diagnostics: + nonZeroStepSize [0] IMPLICIT NULL, -- only zero step size supported + specifiedStepSize [1] IMPLICIT NULL, -- specified step size not supported + termList1 [3] IMPLICIT NULL, -- term list not supported (no alternative supplied) + termList2 [4] IMPLICIT SEQUENCE OF AttributeList, + -- term list not supported (alternatives supplied) + posInResponse [5] IMPLICIT INTEGER{ --value of positionInResponse not supported + mustBeOne (1), + mustBePositive (2), + mustBeNonNegative (3), + other (4)}, + resources [6] IMPLICIT NULL, -- resources exhausted looking for satisfying terms + endOfList [7] IMPLICIT NULL -- beginning or end of term list + }, + + +sort [1009] CHOICE{ + sequence [0] IMPLICIT NULL, -- cannot sort according to sequence + noRsName [1] IMPLICIT NULL, -- no result set name supplied + tooMany [2] IMPLICIT INTEGER, -- Too many input result sets, + -- maximum supplied. + incompatible [3] IMPLICIT NULL, -- records with different formats + -- not compatible for sorting + generic [4] IMPLICIT NULL, -- generic sort not supported + -- (db specific only) + dbSpecific [5] IMPLICIT NULL, -- db specific sort not supported + sortElement [6] SortElement, + key [7] IMPLICIT INTEGER{ + tooMany (1), -- too many sort keys + duplicate (2)}, -- duplicate sort keys + action [8] IMPLICIT NULL, -- unsupported missing data action + illegal [9] IMPLICIT INTEGER{ + relation (1), -- illegal sort relation + case (2), -- illegal case value + action (3), -- illegal missing data action + sort (4)}, -- illegal sort + inputTooLarge [10] IMPLICIT SEQUENCE OF InternationalString, + -- one or more of the input result sets too large to sort + aggregateTooLarge [11] IMPLICIT NULL -- aggregate result set too large + }, + +segmentation [1010] CHOICE{ + segmentCount [0] IMPLICIT NULL, + -- Cannot guarantee record will fit within max segments. Target + -- suggests that origin try again to retrieve record, without + -- including max-segment-count. + segmentSize [1] IMPLICIT INTEGER + -- record cannot be segmented into fragments such that the largest + -- will fit within max segment size specified. Target supplies (in + -- bytes) the smallest acceptable value of Max-segment-size to + -- retrieve the record. + }, + + +extServices [1011] CHOICE{ + req [1] IMPLICIT INTEGER{ -- bad request + nameInUse (1), -- package name already in use + noSuchName (2), -- no such package, on modify/delete + quota (3), -- quota exceeded + type (4)}, -- extended service type not supported + permission [2] IMPLICIT INTEGER{ -- permission denied on ES, because: + id (1), -- id not authorized, or + modifyDelete (2)}, -- cannot modify or delete + immediate [3] IMPLICIT INTEGER{ -- immediate execution: + failed (1), -- failed, + service (2), -- not supported for this service, or + parameters (3) -- for these parameters. + }}, + + +accessCtrl [1012] CHOICE{ + noUser [1] IMPLICIT NULL, -- no user to display challenge to + refused [2] IMPLICIT NULL, -- access control information refused by user + simple [3] IMPLICIT NULL, -- only simple form supported (target used + -- externally defined) + oid [4] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, + -- oid not supported (origin supplies alternative + -- suggested oids) + alternative [5] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, + -- origin insists that target use an alternative + -- challenge for this data (e.g. stronger + + -- authentication or stronger Access control). The + -- origin supplies suggested alternative oids. + pwdInv [6] IMPLICIT NULL, -- password invalid + pwdExp [7] IMPLICIT NULL -- password expired + }, + + +recordSyntax [1013] IMPLICIT SEQUENCE{ -- record cannot be transferred in requested syntax + unsupportedSyntax [1] IMPLICIT OBJECT IDENTIFIER, + suggestedAlternatives [2] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL} +} + +END + + + + + +RecordSyntax-explain +{Z39-50-recordSyntax explain (100)} DEFINITIONS ::= + +BEGIN +IMPORTS AttributeSetId, Term, OtherInformation, DatabaseName, ElementSetName, IntUnit, Unit, + StringOrNumeric, Specification, InternationalString, AttributeList, AttributeElement FROM Z39-50-APDU-1995; +EXPORTS LanguageCode; + +Explain-Record ::= CHOICE{ + -- Each of these may be used as search term when Use attribute is 'explain-category'. + targetInfo [0] IMPLICIT TargetInfo, + databaseInfo [1] IMPLICIT DatabaseInfo, + schemaInfo [2] IMPLICIT SchemaInfo, + tagSetInfo [3] IMPLICIT TagSetInfo, + recordSyntaxInfo [4] IMPLICIT RecordSyntaxInfo, + attributeSetInfo [5] IMPLICIT AttributeSetInfo, + termListInfo [6] IMPLICIT TermListInfo, + extendedServicesInfo [7] IMPLICIT ExtendedServicesInfo, + attributeDetails [8] IMPLICIT AttributeDetails, + termListDetails [9] IMPLICIT TermListDetails, + elementSetDetails [10] IMPLICIT ElementSetDetails, + retrievalRecordDetails [11] IMPLICIT RetrievalRecordDetails, + sortDetails [12] IMPLICIT SortDetails, + processing [13] IMPLICIT ProcessingInformation, + variants [14] IMPLICIT VariantSetInfo, + units [15] IMPLICIT UnitInfo, + categoryList [100] IMPLICIT CategoryList} + +-- Element set name 'B' (brief) retrieves: +-- - 'commonInfo' (except for otherInfo within commonInfo) +-- - key elements +-- - other elements designated as 'non-key brief elements' +-- Esn 'description' retrieves brief elements as well as 'description', and specific additional descriptive +-- elements if designated. +-- Element set name 'F' (full) retrieves all of the above, as well as those designated as "non-brief elements". Some +-- elements designated as OPTIONAL may be mandatory in full records, and are so identified. (Note that all elements +-- that are not part of the brief element set must be designated as OPTIONAL in the ASN.1, otherwise it would be +-- illegal to omit them.) +-- Other esns are defined (below) as needed. + +-- - - - - - - - - - - - - Info Records + -- Info records are mainly for software consumption + -- They describe individual entities within the target system: + -- The target itself + -- Individual databases + -- Schemas + -- Tag sets + -- Record syntaxes + -- Attribute sets + -- Term lists + -- Extended services + -- The information about each Schema, Tag Set, Record Syntax and Attribute Set should + -- match the universal definitions of these items. The only exception is that a target may omit any + -- items it doesn't support, for example the description of the bib-1 attribute set may omit attributes + -- that the target does not support under any circumstances. + -- Databases that may be searched together can be listed in the dbCominations element of the TargetInfo record. +TargetInfo ::= SEQUENCE { + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + name [1] IMPLICIT InternationalString, + -- Non-key brief elements follow: + recent-news [2] IMPLICIT HumanString OPTIONAL, + icon [3] IMPLICIT IconObject OPTIONAL, + namedResultSets [4] IMPLICIT BOOLEAN, + multipleDBsearch [5] IMPLICIT BOOLEAN, + maxResultSets [6] IMPLICIT INTEGER OPTIONAL, + maxResultSize [7] IMPLICIT INTEGER OPTIONAL, + maxTerms [8] IMPLICIT INTEGER OPTIONAL, + timeoutInterval [9] IMPLICIT IntUnit OPTIONAL, + welcomeMessage [10] IMPLICIT HumanString OPTIONAL, + -- non-brief elements follow: + -- 'description' esn retrieves the following two (as well as brief): + contactInfo [11] IMPLICIT ContactInfo OPTIONAL, + description [12] IMPLICIT HumanString OPTIONAL, + nicknames [13] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, + usage-restrictions [14] IMPLICIT HumanString OPTIONAL, + paymentAddr [15] IMPLICIT HumanString OPTIONAL, + hours [16] IMPLICIT HumanString OPTIONAL, + dbCombinations [17] IMPLICIT SEQUENCE OF DatabaseList OPTIONAL, + addresses [18] IMPLICIT SEQUENCE OF NetworkAddress OPTIONAL, + languages [101] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, + -- Languages supported for message strings. Each is a three-character + -- language code from Z39.53-1994. +-- characterSets [102] this tag reserved for "character sets supported for name and message strings". + -- commonAccessInfo elements list objects the target supports. All objects listed in + -- AccessInfo for any individual database should also be listed here. + commonAccessInfo [19] IMPLICIT AccessInfo OPTIONAL} + + +DatabaseInfo ::= SEQUENCE { + -- A target may provide "virtual databases" that are combinations of individual database. These + -- databases are indicated by the presence of subDbs in the combination database's DatabaseDescription. + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + name [1] IMPLICIT DatabaseName, + -- Non-key brief elements follow: + explainDatabase [2] IMPLICIT NULL OPTIONAL, + -- If present, this database is the Explain database, or an Explain database + -- for a different server, possibly on a different host. The means by which + -- that server may be accessed is not addressed by this standard. One + -- suggested possibility is an implementor agreement whereby the + -- database name is a url which may be used to connect to the server. + nicknames [3] IMPLICIT SEQUENCE OF DatabaseName OPTIONAL, + icon [4] IMPLICIT IconObject OPTIONAL, + user-fee [5] IMPLICIT BOOLEAN, + available [6] IMPLICIT BOOLEAN, + titleString [7] IMPLICIT HumanString OPTIONAL, + -- Non-brief elements follow: + keywords [8] IMPLICIT SEQUENCE OF HumanString OPTIONAL, + description [9] IMPLICIT HumanString OPTIONAL, + associatedDbs [10] IMPLICIT DatabaseList OPTIONAL, + -- databases that may be searched in combination with this one + + subDbs [11] IMPLICIT DatabaseList OPTIONAL, + -- When present, this database is a composite representing the combined + -- databases 'subDbs'. The individual subDbs are also available. + disclaimers [12] IMPLICIT HumanString OPTIONAL, + news [13] IMPLICIT HumanString OPTIONAL, + recordCount [14] CHOICE { + actualNumber [0] IMPLICIT INTEGER, + approxNumber [1] IMPLICIT INTEGER} OPTIONAL, + defaultOrder [15] IMPLICIT HumanString OPTIONAL, + avRecordSize [16] IMPLICIT INTEGER OPTIONAL, + maxRecordSize [17] IMPLICIT INTEGER OPTIONAL, + hours [18] IMPLICIT HumanString OPTIONAL, + bestTime [19] IMPLICIT HumanString OPTIONAL, + lastUpdate [20] IMPLICIT GeneralizedTime OPTIONAL, + updateInterval [21] IMPLICIT IntUnit OPTIONAL, + coverage [22] IMPLICIT HumanString OPTIONAL, + proprietary [23] IMPLICIT BOOLEAN OPTIONAL, -- mandatory in full record + copyrightText [24] IMPLICIT HumanString OPTIONAL, + copyrightNotice [25] IMPLICIT HumanString OPTIONAL, + producerContactInfo [26] IMPLICIT ContactInfo OPTIONAL, + supplierContactInfo [27] IMPLICIT ContactInfo OPTIONAL, + submissionContactInfo [28] IMPLICIT ContactInfo OPTIONAL, + -- accessInfo lists items connected with the database. All listed items should be in the target's AccessInfo. + accessInfo [29] IMPLICIT AccessInfo OPTIONAL} + + +SchemaInfo ::= SEQUENCE { + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + schema [1] IMPLICIT OBJECT IDENTIFIER, + -- Non-key brief elements follow: + name [2] IMPLICIT InternationalString, + -- Non-brief elements follow: + description [3] IMPLICIT HumanString OPTIONAL, + tagTypeMapping [4] IMPLICIT SEQUENCE OF SEQUENCE { + tagType [0] IMPLICIT INTEGER, + tagSet [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL, + -- If tagSet is omitted, then this tagType is for a tagSet locally defined + -- within the schema that cannot be referenced by another schema. + defaultTagType [2] IMPLICIT NULL OPTIONAL + } OPTIONAL, + recordStructure [5] IMPLICIT SEQUENCE OF ElementInfo OPTIONAL} + + + -- ElementInfo referenced in SchemaInfo and RecordSyntaxInfo + ElementInfo ::= SEQUENCE { + elementName [1] IMPLICIT InternationalString, + elementTagPath [2] IMPLICIT Path, + dataType [3] ElementDataType OPTIONAL, -- If omitted, not specified. + required [4] IMPLICIT BOOLEAN, + repeatable [5] IMPLICIT BOOLEAN, + description [6] IMPLICIT HumanString OPTIONAL} + + + -- Path is referenced by ElementInfo as well as PerElementDetails + Path ::= SEQUENCE OF SEQUENCE{ + tagType [1] IMPLICIT INTEGER, + tagValue [2] StringOrNumeric} + ElementDataType ::= CHOICE{ + primitive [0] IMPLICIT PrimitiveDataType, + structured [1] IMPLICIT SEQUENCE OF ElementInfo} + PrimitiveDataType ::= INTEGER{ + octetString (0), + numeric (1), + date (2), + external (3), + string (4), + trueOrFalse (5), + oid (6), + intUnit (7), + empty (8), + noneOfTheAbove (100) -- see 'description' + } + + +TagSetInfo ::= SEQUENCE { + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + tagSet [1] IMPLICIT OBJECT IDENTIFIER, + -- non-key brief elements follow: + name [2] IMPLICIT InternationalString, + -- non-brief elements follow: + description [3] IMPLICIT HumanString OPTIONAL, + elements [4] IMPLICIT SEQUENCE OF SEQUENCE { + elementname [1] IMPLICIT InternationalString, + nicknames [2] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, + elementTag [3] StringOrNumeric, + description [4] IMPLICIT HumanString OPTIONAL, + dataType [5] PrimitiveDataType OPTIONAL, + -- If the data type is expected to be structured, that is described in the schema info, + -- and datatype is omitted here. + otherTagInfo OtherInformation OPTIONAL} OPTIONAL} + +RecordSyntaxInfo ::= SEQUENCE { + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + recordSyntax [1] IMPLICIT OBJECT IDENTIFIER, + -- Non-key brief elements follow: + name [2] IMPLICIT InternationalString, + -- non-brief elements follow: + transferSyntaxes [3] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + description [4] IMPLICIT HumanString OPTIONAL, + asn1Module [5] IMPLICIT InternationalString OPTIONAL, + abstractStructure [6] IMPLICIT SEQUENCE OF ElementInfo OPTIONAL + -- Omitting abstractStructure only means target isn't using + -- Explain to describe the structure, not that there is no structure. + } + +AttributeSetInfo ::= SEQUENCE { + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + attributeSet [1] IMPLICIT AttributeSetId, + -- non-key brief elements follow: + name [2] IMPLICIT InternationalString, + -- non-brief elements follow: + attributes [3] IMPLICIT SEQUENCE OF AttributeType OPTIONAL, + -- mandatory in full record + description [4] IMPLICIT HumanString OPTIONAL} +-- AttributeType referenced in AttributeSetInfo + AttributeType ::= SEQUENCE { + name [0] IMPLICIT InternationalString OPTIONAL, + description [1] IMPLICIT HumanString OPTIONAL, + attributeType [2] IMPLICIT INTEGER, + attributeValues [3] IMPLICIT SEQUENCE OF AttributeDescription} + AttributeDescription ::= SEQUENCE { + name [0] IMPLICIT InternationalString OPTIONAL, + description [1] IMPLICIT HumanString OPTIONAL, + attributeValue [2] StringOrNumeric, + equivalentAttributes [3] IMPLICIT SEQUENCE OF StringOrNumeric OPTIONAL + -- each is an occurrence of 'attributeValue' from AttributeDescription for a + -- different attribute. Equivalences listed here should be derived from the + -- attribute set definition, not from a particular server's behavior. + } + + +TermListInfo ::= SEQUENCE{ + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + databaseName [1] IMPLICIT DatabaseName, + -- Non-key brief elements follow: + termLists [2] IMPLICIT SEQUENCE OF SEQUENCE{ + name [1] IMPLICIT InternationalString, + title [2] IMPLICIT HumanString OPTIONAL, + -- Title is for users to see and can differ by language. Name, on the + -- other hand is typically a short string not necessarily meant to be + -- human-readable, and not variable by language. + searchCost [3] IMPLICIT INTEGER { + optimized (0), -- The attribute (or combination) associated + -- with this list will do fast searches. + normal (1), -- The attribute (combination) will work as + -- expected. So there's probably an index for the + -- attribute (combination) or some similar + -- mechanism. + expensive (2), -- Can use the attribute (combination), but it + -- might not provide satisfactory results. + -- Probably there is no index, or post- + -- processing of records is required. + filter (3) -- can't search with this attribute (combination) alone. + } OPTIONAL, + scanable [4] IMPLICIT BOOLEAN, -- 'true' means this list can be scanned. + broader [5] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, + narrower [6] IMPLICIT SEQUENCE OF InternationalString OPTIONAL + -- broader and narrower list alternative term lists related to this one. + -- The term lists so listed should also be in this termLists structure. + } + -- no non-brief elements + } + + +ExtendedServicesInfo ::= SEQUENCE { + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + type [1] IMPLICIT OBJECT IDENTIFIER, + -- Non-key brief elements follow: + name [2] IMPLICIT InternationalString OPTIONAL, + -- should be supplied if privateType is 'true' + privateType [3] IMPLICIT BOOLEAN, + restrictionsApply [5] IMPLICIT BOOLEAN, -- if 'true' see 'description' + feeApply [6] IMPLICIT BOOLEAN, -- if 'true' see 'description' + available [7] IMPLICIT BOOLEAN, + retentionSupported [8] IMPLICIT BOOLEAN, + waitAction [9] IMPLICIT INTEGER{ + waitSupported (1), + waitAlways (2), + waitNotSupported (3), + depends (4), + notSaying (5)}, + -- non-brief elements follow: + -- To get brief plus 'description' use esn 'description' + description [10] IMPLICIT HumanString OPTIONAL, + -- to get above elements and 'specificExplain' use esn 'specificExplain' + specificExplain [11] IMPLICIT EXTERNAL OPTIONAL, + -- Use oid of specific ES, and select choice [3] 'explain'. Format + -- to be developed in conjunction with the specific ES definition. + -- to get all elements except 'specificExplain', use esn 'asn' + esASN [12] IMPLICIT InternationalString OPTIONAL -- the ASN.1 for this ES + } + +-- - - - - - - - - - - - - Detail records + -- The detail records describe relationships among entities supported by the target. RetrievalRecordDetails describes + -- the way that schema elements are mapped into record elements. This mapping may be different for each + -- combination of database, schema, record syntax. The per-element details describe the default mapping. + -- Origin-request re-tagging can change that mapping. When multiple databases are listed in a databaseNames + -- element, the record applies equally to all of the listed databases. This is unrelated to searching the databases + -- together. AttributeDetails describes how databases can be searched. Each supported attribute is listed, and the + -- allowable combinations can be described. + + +AttributeDetails ::= SEQUENCE { + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + databaseName [1] IMPLICIT DatabaseName, + -- Non-brief elements follow: + attributesBySet [2] IMPLICIT SEQUENCE OF AttributeSetDetails OPTIONAL, + -- mandatory in full record + attributeCombinations [3] IMPLICIT AttributeCombinations OPTIONAL} + + + + +-- AttributeSetDetails referenced by AttributeDetails + AttributeSetDetails ::= SEQUENCE { + attributeSet [0] IMPLICIT AttributeSetId, + attributesByType [1] IMPLICIT SEQUENCE OF AttributeTypeDetails } + AttributeTypeDetails ::= SEQUENCE { + attributeType [0] IMPLICIT INTEGER, + defaultIfOmitted [1] IMPLICIT OmittedAttributeInterpretation OPTIONAL, + attributeValues [2] IMPLICIT SEQUENCE OF AttributeValue OPTIONAL } + -- If no attributeValues are supplied, all values of this type are fully + -- supported, and the descriptions in AttributeSetInfo are adequate. + + OmittedAttributeInterpretation ::= SEQUENCE { + defaultValue [0] StringOrNumeric OPTIONAL, + -- A default value is listed if that's how the server works + defaultDescription [1] IMPLICIT HumanString OPTIONAL } + -- The human-readable description should generally be provided. + -- It is legal for both default elements to be missing, which + -- means that the target will allow the attribute type to be + -- omitted, but isn't saying what it will do. + + AttributeValue ::= SEQUENCE { + value [0] StringOrNumeric, + description [1] IMPLICIT HumanString OPTIONAL, + subAttributes [2] IMPLICIT SEQUENCE OF StringOrNumeric OPTIONAL, + superAttributes [3] IMPLICIT SEQUENCE OF StringOrNumeric OPTIONAL, + partialSupport [4] IMPLICIT NULL OPTIONAL } + -- partialSupport indicates that an attributeValue is accepted, but may not be processed in the + -- "expected" way. One important reason for this is composite databases: in this case partialSupport + -- may indicate that only some of the subDbs support the attribute, and others ignore it. + + + +TermListDetails ::= SEQUENCE{ -- one for each termList in TermListInfo + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + termListName [1] IMPLICIT InternationalString, + -- Non-key elements (all non-brief) follow: + description [2] IMPLICIT HumanString OPTIONAL, + attributes [3] IMPLICIT AttributeCombinations OPTIONAL, + -- Pattern for attributes that hit this list. Mandatory in full record + scanInfo [4] IMPLICIT SEQUENCE { + maxStepSize [0] IMPLICIT INTEGER OPTIONAL, + collatingSequence [1] IMPLICIT HumanString OPTIONAL, + increasing [2] IMPLICIT BOOLEAN OPTIONAL} OPTIONAL, + -- Occurs only if list is scanable. If list is scanable and if scanInfo is omitted, + -- target doesn't consider these important. + estNumberTerms [5] IMPLICIT INTEGER OPTIONAL, + sampleTerms [6] IMPLICIT SEQUENCE OF Term OPTIONAL} + + + +ElementSetDetails ::= SEQUENCE { + -- ElementSetDetails describes the way that database records are mapped to record elements. This + -- mapping may be different for each combination of database name and element set. The database record + -- description is a schema, which may be private to the target. The schema's abstract record structure + -- and tag sets provide the vocabulary for discussing record content; their presence in the Explain + -- database does not imply support for complex retrieval specification. + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + databaseName [1] IMPLICIT DatabaseName, + elementSetName [2] IMPLICIT ElementSetName, + recordSyntax [3] IMPLICIT OBJECT IDENTIFIER, + -- Non-key Brief elements follow: + schema [4] IMPLICIT OBJECT IDENTIFIER, + -- Non-brief elements follow: + description [5] IMPLICIT HumanString OPTIONAL, + detailsPerElement [6] IMPLICIT SEQUENCE OF PerElementDetails OPTIONAL -- mandatory in full record + } + + +RetrievalRecordDetails ::= SEQUENCE { + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + databaseName [1] IMPLICIT DatabaseName, + schema [2] IMPLICIT OBJECT IDENTIFIER, + recordSyntax [3] IMPLICIT OBJECT IDENTIFIER, + -- Non-brief elements follow: + description [4] IMPLICIT HumanString OPTIONAL, + detailsPerElement [5] IMPLICIT SEQUENCE OF PerElementDetails OPTIONAL + -- mandatory in full record + } + +-- PerElementDetails is referenced in RetrievalRecordDetails and ElementSetDetails. + PerElementDetails ::= SEQUENCE { + name [0] IMPLICIT InternationalString OPTIONAL, + -- If the name is omitted, the record syntax's name for this element + -- is appropriate. + recordTag [1] IMPLICIT RecordTag OPTIONAL, + -- The record tag may be omitted if tags are inappropriate for the record + -- syntax, or if the origin can be expected to know it for some other reason. + schemaTags [2] IMPLICIT SEQUENCE OF Path OPTIONAL, + -- The information from the listed schema elements is combined + -- in some way to produce the data sent in the listed record tag. The + -- 'contents' element below may describe the logic used. + maxSize [3] IMPLICIT INTEGER OPTIONAL, + minSize [4] IMPLICIT INTEGER OPTIONAL, + avgSize [5] IMPLICIT INTEGER OPTIONAL, + fixedSize [6] IMPLICIT INTEGER OPTIONAL, + repeatable [8] IMPLICIT BOOLEAN, + required [9] IMPLICIT BOOLEAN, + -- 'required' really means that target will always supply the element. + description [12] IMPLICIT HumanString OPTIONAL, + contents [13] IMPLICIT HumanString OPTIONAL, + billingInfo [14] IMPLICIT HumanString OPTIONAL, + restrictions [15] IMPLICIT HumanString OPTIONAL, + alternateNames [16] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, + genericNames [17] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, + searchAccess [18] IMPLICIT AttributeCombinations OPTIONAL } + -- RecordTag referenced in PerElementDetails above + RecordTag ::= SEQUENCE { + qualifier [0] StringOrNumeric OPTIONAL, + -- E.g. tag set for GRS-1 + tagValue [1] StringOrNumeric} + +SortDetails ::= SEQUENCE { + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + databaseName [1] IMPLICIT DatabaseName, + -- No non-key brief elements + -- Non-brief elements follow: + sortKeys [2] IMPLICIT SEQUENCE OF SortKeyDetails OPTIONAL + -- mandatory in full record + } + SortKeyDetails ::= SEQUENCE { + description [0] IMPLICIT HumanString OPTIONAL, + elementSpecifications [1] IMPLICIT SEQUENCE OF Specification OPTIONAL, + -- each specification is a way of specifying this same sort key + attributeSpecifications [2] IMPLICIT AttributeCombinations OPTIONAL, + -- each combination is a way of specifying this same sort key + sortType [3] CHOICE { + character [0] IMPLICIT NULL, + numeric [1] IMPLICIT NULL, + structured [2] IMPLICIT HumanString} OPTIONAL, + caseSensitivity [4] IMPLICIT INTEGER { + always (0), -- always case-sensitive + never (1), -- never case-sensitive + default-yes (2), -- case-sensitivity is as specified on request, and if not + -- specified, case-sensitive. + default-no (3)} -- case-sensitivity is as specified on request, and if not + -- specified, not case-sensitive. + OPTIONAL} + +ProcessingInformation ::= SEQUENCE{ + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + databaseName [1] IMPLICIT DatabaseName, + processingContext [2] IMPLICIT INTEGER { + access (0), -- e.g. choosing databases + search (1), -- e.g. "search strategies" or search forms + retrieval (2), -- e.g. recommended element combinations + record-presentation (3), -- display of retrieved records + record-handling (4) -- handling (e.g. saving) of retrieved records + }, + name [3] IMPLICIT InternationalString, + oid [4] IMPLICIT OBJECT IDENTIFIER, + -- No non-key brief elements + -- Non-brief elements follow: + description [5] IMPLICIT HumanString OPTIONAL, + -- use element set name 'description' to retrieve all except instructions. + instructions [6] IMPLICIT EXTERNAL OPTIONAL -- mandatory in full record + } + + +VariantSetInfo ::= SEQUENCE { + -- A record in this category describes a variant set definition, i.e., classes, types, and values, for a specific + -- variant set definition supported by the target. Support by the target of a particular variant set definition + -- does not imply that the definition is supported for any specific database or element. + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + variantSet [1] IMPLICIT OBJECT IDENTIFIER, + -- Non-key brief elements follow: + name [2] IMPLICIT InternationalString, + -- Non-brief elements follow: + variants [3] IMPLICIT SEQUENCE OF VariantClass OPTIONAL + -- mandatory in full record + } + + -- Subsidiary structures for VariantSetInfo + VariantClass ::= SEQUENCE { + name [0] IMPLICIT InternationalString OPTIONAL, + description [1] IMPLICIT HumanString OPTIONAL, + variantClass [2] IMPLICIT INTEGER, + variantTypes [3] IMPLICIT SEQUENCE OF VariantType} + VariantType ::= SEQUENCE { + name [0] IMPLICIT InternationalString OPTIONAL, + description [1] IMPLICIT HumanString OPTIONAL, + variantType [2] IMPLICIT INTEGER, + variantValue [3] IMPLICIT VariantValue OPTIONAL} + VariantValue ::= SEQUENCE { + dataType [0] PrimitiveDataType, + values [1] ValueSet OPTIONAL } + ValueSet ::= CHOICE { + range [0] IMPLICIT ValueRange, + enumerated [1] IMPLICIT SEQUENCE OF ValueDescription } + ValueRange ::= SEQUENCE { + -- At last one the following must be supplied, both may be supplied. + lower [0] ValueDescription OPTIONAL, + upper [1] ValueDescription OPTIONAL } + ValueDescription ::= CHOICE{ + integer INTEGER, + string InternationalString, + octets OCTET STRING, + oid OBJECT IDENTIFIER, + unit [1] IMPLICIT Unit, + valueAndUnit [2] IMPLICIT IntUnit + -- oid and unit can't be used in a ValueRange + } + + + +UnitInfo ::= SEQUENCE { + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Key elements follow: + unitSystem [1] IMPLICIT InternationalString, + -- No non-key brief elements + -- Non-brief elements follow: + description [2] IMPLICIT HumanString OPTIONAL, + units [3] IMPLICIT SEQUENCE OF UnitType OPTIONAL + -- mandatory in full record + } + + -- Subsidiary structures for UnitInfo + UnitType ::= SEQUENCE { + name [0] IMPLICIT InternationalString OPTIONAL, + description [1] IMPLICIT HumanString OPTIONAL, + unitType [2] StringOrNumeric, + units [3] IMPLICIT SEQUENCE OF Units} + + Units ::= SEQUENCE { + name [0] IMPLICIT InternationalString OPTIONAL, + description [1] IMPLICIT HumanString OPTIONAL, + unit [2] StringOrNumeric} + +CategoryList ::= SEQUENCE { + commonInfo [0] IMPLICIT CommonInfo OPTIONAL, + -- Only one record expected per Explain database. All elements appear in brief presentation. + categories [1] IMPLICIT SEQUENCE OF CategoryInfo } + CategoryInfo ::= SEQUENCE { + category [1] IMPLICIT InternationalString, + originalCategory [2] IMPLICIT InternationalString OPTIONAL, + description [3] IMPLICIT HumanString OPTIONAL, + asn1Module [4] IMPLICIT InternationalString OPTIONAL} + + +-- - - - - - - - - - - - - - Subsidiary definitions + +CommonInfo ::= SEQUENCE { + dateAdded [0] IMPLICIT GeneralizedTime OPTIONAL, + dateChanged [1] IMPLICIT GeneralizedTime OPTIONAL, + expiry [2] IMPLICIT GeneralizedTime OPTIONAL, + humanString-Language [3] IMPLICIT LanguageCode OPTIONAL, + -- following not to occur for brief: + otherInfo OtherInformation OPTIONAL} + + +HumanString ::= SEQUENCE OF SEQUENCE { + language [0] IMPLICIT LanguageCode OPTIONAL, + text [1] IMPLICIT InternationalString} + +IconObject ::= SEQUENCE OF SEQUENCE{ + -- Note that the "SEQUENCE OF" is to allow alternative representations of the same Icon; it is not + -- intended to allow multiple icons. + bodyType [1] CHOICE{ + ianaType [1] IMPLICIT InternationalString, + z3950type [2] IMPLICIT InternationalString, + otherType [3] IMPLICIT InternationalString}, + content [2] IMPLICIT OCTET STRING} + + +LanguageCode ::= InternationalString -- from ANSI/NISO Z39.53-1994 + +ContactInfo ::= SEQUENCE { + name [0] IMPLICIT InternationalString OPTIONAL, + description [1] IMPLICIT HumanString OPTIONAL, + address [2] IMPLICIT HumanString OPTIONAL, + email [3] IMPLICIT InternationalString OPTIONAL, + phone [4] IMPLICIT InternationalString OPTIONAL} + +NetworkAddress ::= CHOICE { + internetAddress [0] IMPLICIT SEQUENCE { + hostAddress [0] IMPLICIT InternationalString, + port [1] IMPLICIT INTEGER}, + osiPresentationAddress [1] IMPLICIT SEQUENCE { + pSel [0] IMPLICIT InternationalString, + sSel [1] IMPLICIT InternationalString OPTIONAL, + tSel [2] IMPLICIT InternationalString OPTIONAL, + nSap [3] IMPLICIT InternationalString}, + other [2] IMPLICIT SEQUENCE { + type [0] IMPLICIT InternationalString, + address [1] IMPLICIT InternationalString}} + +AccessInfo ::= SEQUENCE { + -- AccessInfo contains the fundamental information about what facilities are required to use this target + -- or server. For example, if an origin can handle none of the record syntaxes a database can provide, + -- it might choose not to access the database. + queryTypesSupported [0] IMPLICIT SEQUENCE OF QueryTypeDetails OPTIONAL, + diagnosticsSets [1] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + attributeSetIds [2] IMPLICIT SEQUENCE OF AttributeSetId OPTIONAL, + schemas [3] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + recordSyntaxes [4] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + resourceChallenges [5] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + restrictedAccess [6] IMPLICIT AccessRestrictions OPTIONAL, + costInfo [8] IMPLICIT Costs OPTIONAL, + variantSets [9] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + elementSetNames [10] IMPLICIT SEQUENCE OF ElementSetName OPTIONAL, + unitSystems [11] IMPLICIT SEQUENCE OF InternationalString} + +-- begin auxiliary definitions for AccessInfo +-- Begin Query Details +QueryTypeDetails ::= CHOICE { + private [0] IMPLICIT PrivateCapabilities, + rpn [1] IMPLICIT RpnCapabilities, + iso8777 [2] IMPLICIT Iso8777Capabilities, + z39-58 [100] IMPLICIT HumanString, + erpn [101] IMPLICIT RpnCapabilities, + rankedList [102] IMPLICIT HumanString} + +PrivateCapabilities ::= SEQUENCE { + operators [0] IMPLICIT SEQUENCE OF SEQUENCE { + operator [0] IMPLICIT InternationalString, + description [1] IMPLICIT HumanString OPTIONAL } OPTIONAL, + searchKeys [1] IMPLICIT SEQUENCE OF SearchKey OPTIONAL, -- field names that can be searched + description [2] IMPLICIT SEQUENCE OF HumanString OPTIONAL } + +RpnCapabilities ::= SEQUENCE { + operators [0] IMPLICIT SEQUENCE OF INTEGER OPTIONAL, + -- Omitted means all operators are supported. + resultSetAsOperandSupported [1] IMPLICIT BOOLEAN, + restrictionOperandSupported [2] IMPLICIT BOOLEAN, + proximity [3] IMPLICIT ProximitySupport OPTIONAL} + +Iso8777Capabilities ::= SEQUENCE { + searchKeys [0] IMPLICIT SEQUENCE OF SearchKey, -- field names that may be searched + restrictions [1] IMPLICIT HumanString OPTIONAL + -- Omitted means supported, not specifying units. + } + +ProximitySupport ::= SEQUENCE { + anySupport [0] IMPLICIT BOOLEAN, + -- 'false' means no proximity support, in which case unitsSupported not supplied. + unitsSupported [1] IMPLICIT SEQUENCE OF CHOICE{ + known [1] IMPLICIT INTEGER, -- values from KnownProximityUnit + private [2] IMPLICIT SEQUENCE{ + unit [0] IMPLICIT INTEGER, + description [1] HumanString OPTIONAL}} OPTIONAL} + +SearchKey ::= SEQUENCE { + searchKey [0] IMPLICIT InternationalString, + description [1] IMPLICIT HumanString OPTIONAL } +-- End Query details +AccessRestrictions ::= SEQUENCE OF SEQUENCE { + accessType [0] INTEGER { + any (0), + search (1), + present (2), + specific-elements (3), + extended-services (4), + by-database (5)}, + accessText [1] IMPLICIT HumanString OPTIONAL, + accessChallenges [2] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL} + +Costs ::= SEQUENCE { + connectCharge [0] IMPLICIT Charge OPTIONAL, -- Per-connection charge + connectTime [1] IMPLICIT Charge OPTIONAL, -- Time-based charge + displayCharge [2] IMPLICIT Charge OPTIONAL, -- Per-record charge + searchCharge [3] IMPLICIT Charge OPTIONAL, -- Per-search charge + subscriptCharge [4] IMPLICIT Charge OPTIONAL, -- Subscription charges + otherCharges [5] IMPLICIT SEQUENCE OF SEQUENCE{ -- Other charges + forWhat [1] IMPLICIT HumanString, + charge [2] IMPLICIT Charge} OPTIONAL} + Charge ::= SEQUENCE{ + cost [1] IMPLICIT IntUnit, + perWhat [2] IMPLICIT Unit OPTIONAL, + -- e.g. "second," "minute," "line," "record"... + text [3] IMPLICIT HumanString OPTIONAL} +-- End Auxiliary definitions for AccessInfo + +DatabaseList ::= SEQUENCE OF DatabaseName + +AttributeCombinations ::= SEQUENCE { + defaultAttributeSet [0] IMPLICIT AttributeSetId, + -- Default for the combinations. Also probably a good choice for the default + -- in searches, but that isn't required. + legalCombinations [1] IMPLICIT SEQUENCE OF AttributeCombination } + + +AttributeCombination ::= SEQUENCE OF AttributeOccurrence + -- An AttributeCombination is a pattern for legal combination of attributes + + +AttributeOccurrence ::= SEQUENCE { + -- An AttributeOccurrence lists the legal values for a specific attribute type in a combination. + attributeSet [0] IMPLICIT AttributeSetId OPTIONAL, + attributeType [1] IMPLICIT INTEGER, + mustBeSupplied [2] IMPLICIT NULL OPTIONAL, + attributeValues CHOICE { + any-or-none [3] IMPLICIT NULL, -- All supported values are OK + specific [4] IMPLICIT SEQUENCE OF StringOrNumeric}} + -- Only these values allowed +END + + + + + + + + + +RecordSyntax-SUTRS +{Z39-50-recordSyntax SUTRS (101)} DEFINITIONS ::= +BEGIN +IMPORTS InternationalString FROM Z39-50-APDU-1995; + SutrsRecord ::= InternationalString +-- Line terminator is ASCII LF (X'0A'). +-- Recommended maximum line length is 72 characters. +END + + + + + +RecordSyntax-opac +{Z39-50-recordSyntax opac (102)} DEFINITIONS ::= +BEGIN +IMPORTS InternationalString FROM Z39-50-APDU-1995; +OPACRecord ::= SEQUENCE { + bibliographicRecord [1] IMPLICIT EXTERNAL OPTIONAL, + holdingsData [2] IMPLICIT SEQUENCE OF HoldingsRecord OPTIONAL} +HoldingsRecord ::= CHOICE { + marcHoldingsRecord [1] IMPLICIT EXTERNAL, + holdingsAndCirc [2] IMPLICIT HoldingsAndCircData} +HoldingsAndCircData ::= SEQUENCE { +-- the following elements are required to display holdings in conformance with NISO standards. + typeOfRecord [1] IMPLICIT InternationalString OPTIONAL, -- LDR 06 + encodingLevel [2] IMPLICIT InternationalString OPTIONAL, -- LDR 017 + format [3] IMPLICIT InternationalString OPTIONAL, -- 007 00-01 + receiptAcqStatus [4] IMPLICIT InternationalString OPTIONAL, -- 008 06 + generalRetention [5] IMPLICIT InternationalString OPTIONAL, -- 008 12 + completeness [6] IMPLICIT InternationalString OPTIONAL, -- 008 16 + dateOfReport [7] IMPLICIT InternationalString OPTIONAL, -- 008 26-31 + nucCode [8] IMPLICIT InternationalString OPTIONAL, -- 852 $a + localLocation [9] IMPLICIT InternationalString OPTIONAL, -- 852 $b + shelvingLocation [10] IMPLICIT InternationalString OPTIONAL, -- 852 $c + callNumber [11] IMPLICIT InternationalString OPTIONAL, -- 852 $h and $i + shelvingData [12] IMPLICIT InternationalString OPTIONAL, -- 852 $j thru $m + copyNumber [13] IMPLICIT InternationalString OPTIONAL, -- 852 $t + publicNote [14] IMPLICIT InternationalString OPTIONAL, -- 852 $z + reproductionNote [15] IMPLICIT InternationalString OPTIONAL, -- 843 + termsUseRepro [16] IMPLICIT InternationalString OPTIONAL, -- 845 + enumAndChron [17] IMPLICIT InternationalString OPTIONAL, -- all 85x, 86x + volumes [18] IMPLICIT SEQUENCE OF Volume OPTIONAL, + -- repeats for each volume held + circulationData [19] IMPLICIT SEQUENCE OF CircRecord OPTIONAL + -- repeats for each circulating item. + } +Volume ::= SEQUENCE { + enumeration [1] IMPLICIT InternationalString OPTIONAL, + chronology [2] IMPLICIT InternationalString OPTIONAL, + enumAndChron [3] IMPLICIT InternationalString OPTIONAL } +CircRecord ::= SEQUENCE { + availableNow [1] IMPLICIT BOOLEAN, + availablityDate [2] IMPLICIT InternationalString OPTIONAL, + availableThru [3] IMPLICIT InternationalString OPTIONAL, + restrictions [4] IMPLICIT InternationalString OPTIONAL, + itemId [5] IMPLICIT InternationalString OPTIONAL, + renewable [6] IMPLICIT BOOLEAN, + onHold [7] IMPLICIT BOOLEAN, + enumAndChron [8] IMPLICIT InternationalString OPTIONAL, + midspine [9] IMPLICIT InternationalString OPTIONAL, + temporaryLocation [10] IMPLICIT InternationalString OPTIONAL} +END + + + +RecordSyntax-summary + +{Z39-50-recordSyntax summary (103)} DEFINITIONS ::= +BEGIN +IMPORTS OtherInformation, InternationalString FROM Z39-50-APDU-1995; +BriefBib ::= SEQUENCE { + title [1] IMPLICIT InternationalString, + author [2] IMPLICIT InternationalString OPTIONAL, + callNumber [3] IMPLICIT InternationalString OPTIONAL, + recordType [4] IMPLICIT InternationalString OPTIONAL, + bibliographicLevel [5] IMPLICIT InternationalString OPTIONAL, + format [6] IMPLICIT SEQUENCE OF FormatSpec OPTIONAL, + publicationPlace [7] IMPLICIT InternationalString OPTIONAL, + publicationDate [8] IMPLICIT InternationalString OPTIONAL, + targetSystemKey [9] IMPLICIT InternationalString OPTIONAL, + satisfyingElement [10] IMPLICIT InternationalString OPTIONAL, + rank [11] IMPLICIT INTEGER OPTIONAL, + documentId [12] IMPLICIT InternationalString OPTIONAL, + abstract [13] IMPLICIT InternationalString OPTIONAL, + otherInfo OtherInformation OPTIONAL} + +FormatSpec ::= SEQUENCE { + type [1] IMPLICIT InternationalString, + size [2] IMPLICIT INTEGER OPTIONAL, + bestPosn [3] IMPLICIT INTEGER OPTIONAL} +END + + + + + + + + + + +RecordSyntax-generic -- For detailed semantics, see Appendix RET. +{Z39-50-recordSyntax GRS-1 (105)} DEFINITIONS ::= +BEGIN +EXPORTS Variant; +IMPORTS IntUnit, Unit, InternationalString, StringOrNumeric, Term FROM Z39-50-APDU-1995; + +GenericRecord ::= SEQUENCE OF TaggedElement +TaggedElement ::= SEQUENCE { + tagType [1] IMPLICIT INTEGER OPTIONAL, + -- If omitted, default should be supplied dynamically by tagSet-M; + -- otherwise it should be statically specified by the schema. + tagValue [2] StringOrNumeric, + tagOccurrence [3] IMPLICIT INTEGER OPTIONAL, + -- Occurrence within the database record, and relative to the parent. No + -- default; if omitted, target not telling or it is irrelevant. + content [4] ElementData, + metaData [5] IMPLICIT ElementMetaData OPTIONAL, + appliedVariant [6] IMPLICIT Variant OPTIONAL} + +ElementData ::= CHOICE{ + octets OCTET STRING, + numeric INTEGER, + date GeneralizedTime, + ext EXTERNAL, + string InternationalString, + trueOrFalse BOOLEAN, + oid OBJECT IDENTIFIER, + intUnit [1] IMPLICIT IntUnit, + elementNotThere [2] IMPLICIT NULL, -- element requested but not there + elementEmpty [3] IMPLICIT NULL, -- element there, but empty + noDataRequested [4] IMPLICIT NULL, -- variant request said 'no data' + diagnostic [5] IMPLICIT EXTERNAL, + subtree [6] SEQUENCE OF TaggedElement -- recursive, for nested tags + } + + +ElementMetaData ::= SEQUENCE{ + seriesOrder [1] IMPLICIT Order OPTIONAL, -- only for a non-leaf node + usageRight [2] IMPLICIT Usage OPTIONAL, + hits [3] IMPLICIT SEQUENCE OF HitVector OPTIONAL, + displayName [4] IMPLICIT InternationalString OPTIONAL, + -- name for element that origin can use for display + supportedVariants [5] IMPLICIT SEQUENCE OF Variant OPTIONAL, + message [6] IMPLICIT InternationalString OPTIONAL, + elementDescriptor [7] IMPLICIT OCTET STRING OPTIONAL, + surrogateFor [8] IMPLICIT TagPath OPTIONAL, + -- the retrieved element is a surrogate for the element given by this path + surrogateElement [9] IMPLICIT TagPath OPTIONAL, + -- the element given by this path is a surrogate for the retrieved element + other [99] IMPLICIT EXTERNAL OPTIONAL} + + TagPath ::= SEQUENCE OF SEQUENCE{ + tagType [1] IMPLICIT INTEGER OPTIONAL, + tagValue [2] StringOrNumeric, + tagOccurrence [3] IMPLICIT INTEGER OPTIONAL} + + + +Order ::= SEQUENCE{ + ascending [1] IMPLICIT BOOLEAN, + -- "true" means monotonically increasing (i.e. non-decreasing); + -- "false" means monotonically decreasing (i.e. non-increasing). + order [2] IMPLICIT INTEGER + -- Same as defined by 'elementOrdering' in tagSet-M, though this may be + -- overridden by schema. + } + + + +Usage ::= SEQUENCE { + type [1] IMPLICIT INTEGER{ + redistributable (1), -- Element is freely redistributable. + restricted (2), -- Restriction contains statement. + licensePointer (3) -- Restriction contains license pointer. + }, + restriction [2] IMPLICIT InternationalString OPTIONAL} + + + +HitVector ::= SEQUENCE{ + -- Each hit vector points to a fragment within the element, via location and/or token. + satisfier Term OPTIONAL, -- sourceword, etc. + offsetIntoElement [1] IMPLICIT IntUnit OPTIONAL, + length [2] IMPLICIT IntUnit OPTIONAL, + hitRank [3] IMPLICIT INTEGER OPTIONAL, + targetToken [4] IMPLICIT OCTET STRING OPTIONAL + -- Origin may use token subsequently within a variantRequest (in + -- an elementRequest) to retrieve (or to refer to) the fragment. + } + + + + +Variant ::= SEQUENCE{ + globalVariantSetId [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL, + -- Applies to the triples below, when variantSetId omitted. If + -- globalVariantSetId omitted, default applies. Default may be provided by + -- the tagSet-M element defaultVariantSetId. + + + + + triples [2] IMPLICIT SEQUENCE OF SEQUENCE{ + variantSetId [0] IMPLICIT OBJECT IDENTIFIER OPTIONAL, + -- If omitted, globalVariantSetId (above) + -- applies, unless that too is omitted, in + -- which case, default used. + class [1] IMPLICIT INTEGER, + type [2] IMPLICIT INTEGER, + value [3] CHOICE{ + integer INTEGER, + internationalString InternationalString, + octetString OCTET STRING, + objectIdentifier OBJECT IDENTIFIER, + boolean BOOLEAN, + null NULL, + -- Following need context tags: + unit [1] IMPLICIT Unit, + valueAndUnit [2] IMPLICIT IntUnit}}} +END + + + +RecordSyntax-ESTaskPackage +{Z39-50-recordSyntax ESTaskPackage (106)} DEFINITIONS ::= +BEGIN +IMPORTS Permissions, InternationalString, IntUnit, DiagRec FROM Z39-50-APDU-1995; + +TaskPackage ::= SEQUENCE{ + packageType [1] IMPLICIT OBJECT IDENTIFIER, + -- oid of specific ES definition + packageName [2] IMPLICIT InternationalString OPTIONAL, + userId [3] IMPLICIT InternationalString OPTIONAL, + retentionTime [4] IMPLICIT IntUnit OPTIONAL, + permissions [5] IMPLICIT Permissions OPTIONAL, + description [6] IMPLICIT InternationalString OPTIONAL, + targetReference [7] IMPLICIT OCTET STRING OPTIONAL, + creationDateTime [8] IMPLICIT GeneralizedTime OPTIONAL, + taskStatus [9] IMPLICIT INTEGER{ + pending (0), + active (1), + complete (2), + aborted (3)}, + packageDiagnostics [10] IMPLICIT SEQUENCE OF DiagRec OPTIONAL, + taskSpecificParameters [11] IMPLICIT EXTERNAL + -- Use oid for specific ES definition + -- (same oid as packageType above) + -- and select [2] "taskPackage." + } +END + + + + +ResourceReport-Format-Resource-1 +{Z39-50-resourceReport resource-1 (1)} DEFINITIONS ::= +BEGIN +IMPORTS InternationalString FROM Z39-50-APDU-1995; +-- +ResourceReport ::= SEQUENCE{ +estimates [1] IMPLICIT SEQUENCE OF Estimate, +message [2] IMPLICIT InternationalString} +-- +Estimate ::= SEQUENCE{ +type [1] IMPLICIT EstimateType, +value [2] IMPLICIT INTEGER, -- the actual estimate +currency-code [3] IMPLICIT INTEGER OPTIONAL + -- code for representation of currencies defined in ISO 4217-1990. + -- Applicable only to monetary estimates. + } +EstimateType ::= INTEGER{ +currentSearchRecords (1), -- estimated no. records in current (incomplete) result set for search +finalSearchRecords (2), -- estimated no. records that will be in result set if search completes +currentPresentRecords (3), -- estimated number of records in current (incomplete) set of + -- records to be returned on Present +finalPresentRecords (4), -- estimated number of records that will be in the set of records + -- to be returned by Present if Present completes +currentOpTimeProcessing (5), -- processing time (in .001 CPU seconds) used by operation so far +finalOpTimeProcessing (6), -- estimated total processing time (in .001 CPU seconds) that will + -- be used by this operation if it completes +currentAssocTime (7), -- estimated processing time used by association (in .001 CPU sec.) +currentOperationCost (8), -- estimated cost for this operation so far +finalOperationCost (9), -- estimated cost for this operation if it completes +currentAssocCost (10), -- estimated cost for this association so far +finalOpTimeElapsed (11), -- estimated elapsed time for operation if it completes (in .001 sec.) +percentComplete (12), -- estimated percent complete +currentSearchAssocCost (13), -- estimated search cost for association so far +currentPresentAssocCost (14), -- estimated present cost for this association so far +currentConnectAssocCost (15), -- estimated connect time cost for association so far +currentOtherAssocCost (16) -- estimated other cost (not included in 13-15) for association so far + } +END + + + + + + + + + + + + + +ResourceReport-Format-Resource-2 +{Z39-50-resourceReport resource-2 (2)} DEFINITIONS ::= +BEGIN +IMPORTS InternationalString, StringOrNumeric, IntUnit FROM Z39-50-APDU-1995; +-- +ResourceReport ::= SEQUENCE{ +estimates [1] IMPLICIT SEQUENCE OF Estimate OPTIONAL, +message [2] IMPLICIT InternationalString OPTIONAL} +-- +Estimate ::= SEQUENCE{ +type [1] StringOrNumeric, + -- Numeric values of 1-16 are the same as used in Resource-1. +value [2] IMPLICIT IntUnit + -- When expressing currency: + -- unitSystem (of Unit) is 'z3950' (case insensitive) + -- unitType is 'iso4217-1990' (case insensitive) + -- unit is currency code from ISO 4217-1990. +} +END + + + + + +AccessControlFormat-prompt-1 +{Z39-50-accessControl prompt-1 (1)} DEFINITIONS ::= +BEGIN +IMPORTS InternationalString, DiagRec FROM Z39-50-APDU-1995; +-- +PromptObject ::= CHOICE{ + challenge [1] IMPLICIT Challenge, + response [2] IMPLICIT Response} + + Challenge ::= SEQUENCE OF SEQUENCE { + promptId [1] PromptId, + -- Target supplies a number (for an enumerated prompt) or string (for a non + -- -enumerated prompt), for each prompt, and the origin returns it in response, for + -- this prompt, so target may correlate the prompt response with the prompt. + defaultResponse [2] IMPLICIT InternationalString OPTIONAL, + promptInfo [3] CHOICE{ + character [1] IMPLICIT InternationalString, + encrypted [2] IMPLICIT Encryption} OPTIONAL, + -- Information corresponding to an enumerated prompt. For example if 'type', within + -- PromptId, is 'copyright', then promptInfo may contain a copyright statement. + regExpr [4] IMPLICIT InternationalString OPTIONAL, + -- A regular expression that promptResponse should match. See IEEE 1003.2 + -- Volume 1, Section 2.8 "Regular Expression Notation." For example if promptId + -- is "Year of publication," regExpr might be "19[89][0-9]|20[0-9][0-9]". + responseRequired [5] IMPLICIT NULL OPTIONAL, + allowedValues [6] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, + -- e.g. promptId="Desired color"; allowed = 'red', 'blue','Green'. + shouldSave [7] IMPLICIT NULL OPTIONAL, + -- Target recommends that origin save the data that it prompts from the + -- user corresponding to this prompt, because it is likely to be requested again (so + -- origin might not have to prompt the user next time). + dataType [8] IMPLICIT INTEGER{ + integer (1), + date (2), + float (3), + alphaNumeric (4), + url-urn (5), + boolean (6)} OPTIONAL, + -- Target telling origin type of data it wants. E.g., if "date" is specified, + -- presumably the origin will try to prompt something "date-like" from the user. + diagnostic [9] IMPLICIT EXTERNAL OPTIONAL + -- Intended for repeat requests when there is an error the origin + -- should report to the user from previous attempt. + } + + + Response ::= SEQUENCE OF SEQUENCE { + promptId [1] PromptId, + -- Corresponds to a prompt in the challenge, or may be unprompted, for + -- example "newPassword." If unprompted, should be "enumerated." + -- If this responds to a non-enumerated prompt, then nonEnumeratedPrompt + -- should contain the prompt string from the challenge. + promptResponse [2] CHOICE{ + string [1] IMPLICIT InternationalString, + accept [2] IMPLICIT BOOLEAN, + acknowledge [3] IMPLICIT NULL, + diagnostic [4] DiagRec, + encrypted [5] IMPLICIT Encryption}} + + + PromptId ::= CHOICE{ + enummeratedPrompt [1] IMPLICIT SEQUENCE{ + type [1] IMPLICIT INTEGER{ + groupId (0), + userId (1), + password (2), + newPassword (3), + copyright (4), + -- When type on Challenge is 'copyright', promptInfo has text of + -- copyright message to be displayed verbatim to the user. If + -- promptResponse indicates 'acceptance', this indicates the user has been + -- shown, and accepted, the terms of the copyright. This is not intended + -- to be legally binding, but provides a good-faith attempt on + -- the part of the target to inform the user of the copyright. + sessionId (5)}, + suggestedString [2] IMPLICIT InternationalString OPTIONAL}, + nonEnumeratedPrompt [2] IMPLICIT InternationalString} + + + Encryption ::= SEQUENCE{ + cryptType [1] IMPLICIT OCTET STRING OPTIONAL, + credential [2] IMPLICIT OCTET STRING OPTIONAL, + --random number, SALT, or other factor + data [3] IMPLICIT OCTET STRING} + +END + + + + +AccessControlFormat-des-1 +{Z39-50-accessControlFormat des-1 (2)} DEFINITIONS ::= +BEGIN + DES-RN-Object ::= CHOICE { + challenge [1] IMPLICIT DRNType, + response [2] IMPLICIT DRNType} + DRNType ::= SEQUENCE{ + userId [1] IMPLICIT OCTET STRING OPTIONAL, + salt [2] IMPLICIT OCTET STRING OPTIONAL, + randomNumber [3] IMPLICIT OCTET STRING} +END + + +AccessControlFormat-krb-1 +{Z39-50-accessControlFormat krb-1 (3)} DEFINITIONS ::= +BEGIN +IMPORTS InternationalString FROM Z39-50-APDU-1995; + + KRBObject ::= CHOICE { + challenge [1] IMPLICIT KRBRequest, + response [2] IMPLICIT KRBResponse} + KRBRequest ::= SEQUENCE{ + service [1] IMPLICIT InternationalString, + instance [2] IMPLICIT InternationalString OPTIONAL, + realm [3] IMPLICIT InternationalString OPTIONAL} + -- target requests a ticket for the given service, instance, and realm + KRBResponse ::= SEQUENCE{ + userid [1] IMPLICIT InternationalString OPTIONAL, + ticket [2] IMPLICIT OCTET STRING} + -- origin responds with a ticket for the requested service +END + + + + + + + + + +ESFormat-PersistentResultSet +{Z39-50-extendedService PersistentResultSet (1)} DEFINITIONS ::= +BEGIN +IMPORTS InternationalString FROM Z39-50-APDU-1995; +PersistentResultSet ::= CHOICE{ + esRequest [1] IMPLICIT SEQUENCE{ + toKeep [1] IMPLICIT NULL, + notToKeep [2] OriginPartNotToKeep OPTIONAL}, + taskPackage [2] IMPLICIT SEQUENCE{ + originPart [1] IMPLICIT NULL, + targetPart [2] TargetPart OPTIONAL}} +OriginPartNotToKeep ::= SEQUENCE{ + originSuppliedResultSet [1] IMPLICIT InternationalString OPTIONAL, + -- name of transient result set, supplied on request, mandatory unless function is 'delete' + replaceOrAppend [2] IMPLICIT INTEGER{ -- only if function is "modify" + replace (1), + append (2)} OPTIONAL} +TargetPart ::= SEQUENCE{ + targetSuppliedResultSet [1] IMPLICIT InternationalString OPTIONAL, + -- Name of transient result set, supplied by target, representing the persistent result set to which + -- package pertains. Meaningful only when package is presented. (i.e. not on ES response). + numberOfRecords [2] IMPLICIT INTEGER OPTIONAL} +END + + +ESFormat-PersistentQuery +{Z39-50-extendedService PersistentQuery (2)} DEFINITIONS ::= +BEGIN +IMPORTS Query, InternationalString, OtherInformation FROM Z39-50-APDU-1995; +PersistentQuery ::= CHOICE{ + esRequest [1] IMPLICIT SEQUENCE{ + toKeep [1] OriginPartToKeep OPTIONAL, + notToKeep [2] OriginPartNotToKeep}, + taskPackage [2] IMPLICIT SEQUENCE{ + originPart [1] OriginPartToKeep OPTIONAL, + targetPart [2] TargetPart}} +OriginPartToKeep ::= SEQUENCE{ + dbNames [2] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, + additionalSearchInfo [3] OtherInformation OPTIONAL} +OriginPartNotToKeep ::= CHOICE{ + package [1] IMPLICIT InternationalString, + query [2] Query} +TargetPart ::= Query +END + +ESFormat-PeriodicQuerySchedule +{Z39-50-extendedService PeriodicQuerySchedule (3)} DEFINITIONS ::= +BEGIN +IMPORTS Query, InternationalString, IntUnit FROM Z39-50-APDU-1995 +ExportSpecification, Destination FROM ESFormat-ExportSpecification; + +PeriodicQuerySchedule ::= CHOICE{ + esRequest [1] IMPLICIT SEQUENCE{ + toKeep [1] OriginPartToKeep, + notToKeep [2] OriginPartNotToKeep}, + taskPackage [2] IMPLICIT SEQUENCE{ + originPart [1] OriginPartToKeep, + targetPart [2] TargetPart}} + +OriginPartToKeep ::=SEQUENCE{ + activeFlag [1] IMPLICIT BOOLEAN, + databaseNames [2] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, + resultSetDisposition [3] IMPLICIT INTEGER{ + replace (1), + append (2), + createNew (3) -- Only if origin and target have agreement about + -- naming convention for the resulting package, + -- and only if no result set is specified. + } OPTIONAL, -- Mandatory on 'create' if result set is specified, in + -- which case it must be 'replace' or 'append. + alertDestination [4] Destination OPTIONAL, + exportParameters [5] CHOICE{ + packageName [1] IMPLICIT InternationalString, + exportPackage [2] ExportSpecification} OPTIONAL} + +OriginPartNotToKeep ::= SEQUENCE{ + querySpec [1] CHOICE{ + actualQuery [1] Query, + packageName [2] IMPLICIT InternationalString} OPTIONAL, + -- mandatory for 'create' + originSuggestedPeriod [2] Period OPTIONAL, -- mandatory for 'create' + expiration [3] IMPLICIT GeneralizedTime OPTIONAL, + resultSetPackage [4] IMPLICIT InternationalString OPTIONAL} + +TargetPart ::= SEQUENCE{ + actualQuery [1] Query, + targetStatedPeriod [2] Period, + -- Target supplies the period, which may be same as origin proposed. + expiration [3] IMPLICIT GeneralizedTime OPTIONAL, + -- Target supplies value for task package. It may be the same as origin + -- proposed or different from (and overrides) origin proposal, but if + -- omitted, there is no expiration. + resultSetPackage [4] IMPLICIT InternationalString OPTIONAL, + -- May be omitted only if exportParameters was supplied. Target + -- supplies same name as origin supplied, if origin did supply a name. + lastQueryTime [5] IMPLICIT GeneralizedTime, + lastResultNumber [6] IMPLICIT INTEGER, + numberSinceModify [7] IMPLICIT INTEGER OPTIONAL} + + + + + Period ::= CHOICE{ + unit [1] IMPLICIT IntUnit, + businessDaily [2] IMPLICIT NULL, + continuous [3] IMPLICIT NULL, + other [4] IMPLICIT InternationalString} +END + + +ESFormat-ItemOrder +{Z39-50-extendedService ItemOrder (4)} DEFINITIONS ::= +BEGIN +IMPORTS InternationalString FROM Z39-50-APDU-1995; +ItemOrder ::= CHOICE{ + esRequest [1] IMPLICIT SEQUENCE{ + toKeep [1] OriginPartToKeep OPTIONAL, + notToKeep [2] OriginPartNotToKeep}, + taskPackage [2] IMPLICIT SEQUENCE{ + originPart [1] OriginPartToKeep OPTIONAL, + targetPart [2] TargetPart}} +OriginPartToKeep ::= SEQUENCE{ + supplDescription [1] IMPLICIT EXTERNAL OPTIONAL, + contact [2] IMPLICIT SEQUENCE{ + name [1] IMPLICIT InternationalString OPTIONAL, + phone [2] IMPLICIT InternationalString OPTIONAL, + email [3] IMPLICIT InternationalString OPTIONAL} OPTIONAL, + addlBilling [3] IMPLICIT SEQUENCE{ + paymentMethod [1] CHOICE{ + billInvoice [0] IMPLICIT NULL, + prepay [1] IMPLICIT NULL, + depositAccount [2] IMPLICIT NULL, + creditCard [3] IMPLICIT CreditCardInfo, + cardInfoPreviouslySupplied [4] IMPLICIT NULL, + privateKnown [5] IMPLICIT NULL, + privateNotKnown [6] IMPLICIT EXTERNAL}, + customerReference [2] IMPLICIT InternationalString OPTIONAL, + customerPONumber [3] IMPLICIT InternationalString OPTIONAL} + OPTIONAL} +CreditCardInfo ::= SEQUENCE{ + nameOnCard [1] IMPLICIT InternationalString, + expirationDate [2] IMPLICIT InternationalString, + cardNumber [3] IMPLICIT InternationalString} + +OriginPartNotToKeep ::= SEQUENCE{ -- Corresponds to 'requestedItem' in service definition. + -- Must supply at least one, and may supply both. + resultSetItem [1] IMPLICIT SEQUENCE{ + resultSetId [1] IMPLICIT InternationalString, + item [2] IMPLICIT INTEGER} OPTIONAL, + itemRequest [2] IMPLICIT EXTERNAL OPTIONAL + -- When itemRequest is an ILL-Request APDU, + -- use OID {iso standard 10161 abstract-syntax (2) ill-apdus (1)} + } + +TargetPart ::= SEQUENCE{ + itemRequest [1] IMPLICIT EXTERNAL OPTIONAL, + -- When itemRequest is an ILL-Request APDU, use OID 1.0.10161.2.1 (as above) + statusOrErrorReport [2] IMPLICIT EXTERNAL OPTIONAL, + -- When statusOrErrorReport is an ILL Status-Or-Error-Report APDU, use OID 1.0.10161.2.1 (as above) + auxiliaryStatus [3] IMPLICIT INTEGER{ + notReceived (1), + loanQueue (2), + forwarded (3), + unfilledCopyright (4), + filledCopyright (5)} OPTIONAL} +END + + + + +ESFormat-Update0 +{Z39-50-extendedService Update (5)} DEFINITIONS ::= +BEGIN +IMPORTS DiagRec, InternationalString FROM Z39-50-APDU-1995; +Update ::= CHOICE{ + esRequest [1] IMPLICIT SEQUENCE{ + toKeep [1] OriginPartToKeep, + notToKeep [2] OriginPartNotToKeep}, + taskPackage [2] IMPLICIT SEQUENCE{ + originPart [1] OriginPartToKeep, + targetPart [2] TargetPart}} + + +OriginPartToKeep ::= SEQUENCE{ + action [1] IMPLICIT INTEGER{ + recordInsert (1), + recordReplace (2), + recordDelete (3), + elementUpdate (4)}, + databaseName [2] IMPLICIT InternationalString, + schema [3] IMPLICIT OBJECT IDENTIFIER OPTIONAL, + elementSetName [4] IMPLICIT InternationalString OPTIONAL} + + +OriginPartNotToKeep ::= SuppliedRecords + + +TargetPart ::= SEQUENCE{ + updateStatus [1] IMPLICIT INTEGER{ + success (1), + partial (2), + failure (3)}, + globalDiagnostics [2] IMPLICIT SEQUENCE OF DiagRec OPTIONAL, + -- These are non-surrogate diagnostics relating to the task, + -- not to individual records. + taskPackageRecords [3] IMPLICIT SEQUENCE OF TaskPackageRecordStructure + -- There should be a TaskPackageRecordStructure for every record + -- supplied. The target should create such a structure for every + -- record immediately upon creating the task package to include + -- correlation information and status. The record itself would not + -- be included until processing for that record is complete. + } + +-- Auxiliary definitions for Update +SuppliedRecords ::= SEQUENCE OF SEQUENCE{ + recordId [1] CHOICE{ + number [1] IMPLICIT INTEGER, + string [2] IMPLICIT InternationalString, + opaque [3] IMPLICIT OCTET STRING} OPTIONAL, + supplementalId [2] CHOICE{ + timeStamp [1] IMPLICIT GeneralizedTime, + versionNumber [2] IMPLICIT InternationalString, + previousVersion [3] IMPLICIT EXTERNAL} OPTIONAL, + correlationInfo [3] IMPLICIT CorrelationInfo OPTIONAL, + record [4] IMPLICIT EXTERNAL} + +CorrelationInfo ::= SEQUENCE{ + -- origin may supply one or both for any record: + note [1] IMPLICIT InternationalString OPTIONAL, + id [2] IMPLICIT INTEGER OPTIONAL} + +TaskPackageRecordStructure ::= SEQUENCE{ + recordOrSurDiag [1] CHOICE { + record [1] IMPLICIT EXTERNAL, + -- Choose 'record' if recordStatus is 'success', and + -- elementSetName was supplied. + diagnostic [2] DiagRec + -- Choose 'diagnostic', if RecordStatus is failure. + } OPTIONAL, + -- The parameter recordOrSurDiag will thus be omitted only if + -- 'elementSetName' was omitted and recordStatus is + -- 'success'; or if record status is 'queued' or in 'process'. + correlationInfo [2] IMPLICIT CorrelationInfo OPTIONAL, + -- This should be included if it was supplied by the origin. + recordStatus [3] IMPLICIT INTEGER{ + success (1), + queued (2), + inProcess (3), + failure (4)}} +END + + +ESFormat-ExportSpecification +{Z39-50-extendedService ExportSpecification (6)} DEFINITIONS ::= +BEGIN +EXPORTS ExportSpecification, Destination; IMPORTS CompSpec, InternationalString FROM Z39-50-APDU-1995; +ExportSpecification ::= CHOICE{ + esRequest [1] IMPLICIT SEQUENCE{ + toKeep [1] OriginPartToKeep, + notToKeep [2] IMPLICIT NULL}, + taskPackage [2] IMPLICIT SEQUENCE{ + originPart [1] OriginPartToKeep, + targetPart [2] IMPLICIT NULL}} +OriginPartToKeep ::= SEQUENCE{ + composition [1] IMPLICIT CompSpec, + exportDestination [2] Destination} + + Destination ::= CHOICE{ + phoneNumber [1] IMPLICIT InternationalString, + faxNumber [2] IMPLICIT InternationalString, + x400address [3] IMPLICIT InternationalString, + emailAddress [4] IMPLICIT InternationalString, + pagerNumber [5] IMPLICIT InternationalString, + ftpAddress [6] IMPLICIT InternationalString, + ftamAddress [7] IMPLICIT InternationalString, + printerAddress [8] IMPLICIT InternationalString, + other [100] IMPLICIT SEQUENCE{ + vehicle [1] IMPLICIT InternationalString OPTIONAL, + destination [2] IMPLICIT InternationalString}} +END + + + + +ESFormat-ExportInvocation +{Z39-50-extendedService ExportInvocation (7)} DEFINITIONS ::= +BEGIN +IMPORTS InternationalString, IntUnit FROM Z39-50-APDU-1995 +ExportSpecification FROM ESFormat-ExportSpecification; +ExportInvocation ::= CHOICE{ + esRequest [1] IMPLICIT SEQUENCE{ + toKeep [1] OriginPartToKeep, + notToKeep [2] OriginPartNotToKeep}, + taskPackage [2] IMPLICIT SEQUENCE{ + originPart [1] OriginPartToKeep, + targetPart [2] TargetPart OPTIONAL}} + +OriginPartToKeep ::= SEQUENCE{ + exportSpec [1] CHOICE{ + packageName [1] IMPLICIT InternationalString, + packageSpec [2] ExportSpecification}, + numberOfCopies [2] IMPLICIT INTEGER} + + + + + +OriginPartNotToKeep ::= SEQUENCE{ + resultSetId [1] IMPLICIT InternationalString, + records [2] CHOICE{ + all [1] IMPLICIT NULL, + ranges [2] IMPLICIT SEQUENCE OF SEQUENCE{ + start [1] IMPLICIT INTEGER, + count [2] IMPLICIT INTEGER OPTIONAL + -- Count may be omitted only on last range, to indicate + -- "all remaining records beginning with 'start'." + }}} + +TargetPart ::= SEQUENCE{ + estimatedQuantity [1] IMPLICIT IntUnit OPTIONAL, + quantitySoFar [2] IMPLICIT IntUnit OPTIONAL, + estimatedCost [3] IMPLICIT IntUnit OPTIONAL, + costSoFar [4] IMPLICIT IntUnit OPTIONAL} +END + + + +UserInfoFormat-searchResult-1 +{Z39-50-userInfoFormat searchResult-1 (1)} DEFINITIONS ::= +BEGIN +IMPORTS DatabaseName, Term, Query, IntUnit, InternationalString FROM Z39-50-APDU-1995; +SearchInfoReport ::= SEQUENCE OF SEQUENCE{ + subqueryId [1] IMPLICIT InternationalString OPTIONAL, + -- shorthand identifier of subquery + fullQuery [2] IMPLICIT BOOLEAN, -- 'true' means this is the full query; 'false', + -- a sub-query + subqueryExpression [3] QueryExpression OPTIONAL, -- A subquery of the query as + -- submitted. May be whole query; + -- if so, "fullQuery" should be 'true'. + subqueryInterpretation [4] QueryExpression OPTIONAL, -- how target interpreted subquery + subqueryRecommendation [5] QueryExpression OPTIONAL, -- target-recommended alternative + subqueryCount [6] IMPLICIT INTEGER OPTIONAL, -- Number of records for this + -- subQuery, across all of the specified + -- databases. (If during search, via resource + -- control, number of records so far). + subqueryWeight [7] IMPLICIT IntUnit OPTIONAL, -- relative weight of this subquery + resultsByDB [8] IMPLICIT ResultsByDB OPTIONAL} + +ResultsByDB ::= SEQUENCE OF SEQUENCE{ + databases [1] CHOICE{ + all [1] IMPLICIT NULL, + -- applies across all of the databases in Search PDU + list [2] IMPLICIT SEQUENCE OF DatabaseName + -- applies across all databases in this list + }, + count [2] IMPLICIT INTEGER OPTIONAL, + -- Number of records for query component (and, as above, if during search, + -- via resource control, number of records so far). + resultSetName [3] IMPLICIT InternationalString OPTIONAL + -- Target-assigned result set by which subQuery is available. Should not + -- be provided unless processing for this query component is concluded (i.e., + -- when this report comes during search, via resource control, as opposed + -- to after search, via additionalSearchInfo). + } + +QueryExpression ::= CHOICE { + term [1] IMPLICIT SEQUENCE{ + queryTerm [1] Term, + termComment [2] IMPLICIT InternationalString OPTIONAL}, + query [2] Query} +END + + + +ElementSpecificationFormat-eSpec-1 +{Z39-50-elementSpec eSpec-1 (1)} DEFINITIONS ::= +BEGIN +IMPORTS Variant FROM RecordSyntax-generic +StringOrNumeric, InternationalString FROM Z39-50-APDU-1995; +-- +Espec-1 ::= SEQUENCE{ + elementSetNames [1] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, + -- Origin may include one or more element set names, each + -- specifying a set of elements. Each of the elements is to be + -- treated as an elementRequest in the form of simpleElement, + -- where occurrence is 1. + defaultVariantSetId [2] IMPLICIT OBJECT IDENTIFIER OPTIONAL, + -- If supplied, applies whenever variantRequest + -- does not include variantSetId. + defaultVariantRequest [3] IMPLICIT Variant OPTIONAL, + -- If supplied, then for each simple elementRequest that does not + -- include a variantRequest, the defaultVariantRequest applies. + -- (defaultVariantRequest does not apply to a compositeRequest.) + defaultTagType [4] IMPLICIT INTEGER OPTIONAL, + -- If supplied, applies whenever 'tagType' (within 'tag' within TagPath) + -- is omitted. + elements [5] IMPLICIT SEQUENCE OF ElementRequest OPTIONAL} +-- + +ElementRequest::= CHOICE{ + simpleElement [1] IMPLICIT SimpleElement, + compositeElement [2] IMPLICIT SEQUENCE{ + elementList [1] CHOICE{ + primitives [1] IMPLICIT SEQUENCE OF InternationalString, + -- Origin may specify one or more element + -- set names, each identifying a set of elements, + -- and the composite element is the union. + specs [2] IMPLICIT SEQUENCE OF SimpleElement}, + + deliveryTag [2] IMPLICIT TagPath, + -- DeliveryTag tagPath for compositeElement may not + -- include wildThing or wildPath. + variantRequest [3] IMPLICIT Variant OPTIONAL}} + +SimpleElement ::= SEQUENCE{ + path [1] IMPLICIT TagPath, + variantRequest [2] IMPLICIT Variant OPTIONAL} + + +TagPath ::= SEQUENCE OF CHOICE{ + specificTag [1] IMPLICIT SEQUENCE{ + tagType [1] IMPLICIT INTEGER OPTIONAL, + -- If omitted, then 'defaultTagType' (above) applies, if supplied, and + -- if not supplied, then default listed in schema applies. + tagValue [2] StringOrNumeric, + occurrence [3] Occurrences OPTIONAL + -- default is "first occurrence" + }, + wildThing [2] Occurrences, + -- Get Nth "thing" at this level, regardless of tag, for each N specified by + -- "Occurrences" (which may be 'all' meaning match every element at this level). + -- E.g., if "Occurrences" is 3, get third element regardless of its tag or the tag of + -- the first two elements. + wildPath [3] IMPLICIT NULL + -- Match any tag, at this level or below, that is on a path for which next tag in this + -- TagPath sequence occurs. WildPath may not be last member of the TagPath + -- sequence. + } +-- + +Occurrences ::= CHOICE{ + all [1] IMPLICIT NULL, + last [2] IMPLICIT NULL, + values [3] IMPLICIT SEQUENCE{ + start [1] IMPLICIT INTEGER, + -- if 'start' alone is included, then single occurrence is requested + howMany [2] IMPLICIT INTEGER OPTIONAL + -- For example, if 'start' is 5 and 'howMany' is 6, then request is for + -- "occurrences 5 through 10." + }} +END + diff --git a/src/zgdu.c b/src/zgdu.c new file mode 100644 index 0000000..a37a96e --- /dev/null +++ b/src/zgdu.c @@ -0,0 +1,364 @@ +/* + * Copyright (c) 2002-2003, Index Data. + * See the file LICENSE for details. + * + * $Id: zgdu.c,v 1.1 2003-10-27 12:21:36 adam Exp $ + */ + +#include +#include +#include + +static int decode_headers_content(ODR o, int off, Z_HTTP_Header **headers, + char **content_buf, int *content_len) +{ + int i = off; + + *headers = 0; + while (i < o->size-1 && o->buf[i] == '\r') + { + int po; + i++; + if (o->buf[i] != '\n') + { + o->error = OHTTP; + return 0; + } + i++; + if (o->buf[i] == '\r') + break; + for (po = i; ; i++) + { + if (i == o->size) + { + o->error = OHTTP; + return 0; + } + else if (o->buf[i] == ':') + break; + } + *headers = (Z_HTTP_Header *) odr_malloc(o, sizeof(**headers)); + (*headers)->name = (char*) odr_malloc(o, i - po + 1); + memcpy ((*headers)->name, o->buf + po, i - po); + (*headers)->name[i - po] = '\0'; + i++; + while (i < o->size-1 && o->buf[i] == ' ') + i++; + for (po = i; i < o->size-1 && o->buf[i] != '\r' ; i++) + ; + + (*headers)->value = (char*) odr_malloc(o, i - po + 1); + memcpy ((*headers)->value, o->buf + po, i - po); + (*headers)->value[i - po] = '\0'; + + headers = &(*headers)->next; + } + *headers = 0; + i++; + if (o->buf[i] != '\n') + { + o->error = OHTTP; + return 0; + } + i++; + + if (i > o->size) + { + o->error = OHTTP; + return 0; + } + else if (i == o->size) + { + *content_buf = 0; + *content_len = 0; + } + else + { + *content_len = o->size - i; + *content_buf = (char*) odr_malloc(o, *content_len + 1); + memcpy(*content_buf, o->buf + i, *content_len); + (*content_buf)[*content_len] = '\0'; + } + return 1; +} + +void z_HTTP_header_add(ODR o, Z_HTTP_Header **hp, const char *n, + const char *v) +{ + while (*hp) + hp = &(*hp)->next; + *hp = (Z_HTTP_Header *) odr_malloc(o, sizeof(**hp)); + (*hp)->name = odr_strdup(o, n); + (*hp)->value = odr_strdup(o, v); + (*hp)->next = 0; +} + +const char *z_HTTP_header_lookup(Z_HTTP_Header *hp, const char *n) +{ + for (; hp; hp = hp->next) + if (!strcmp(hp->name, n)) + return hp->value; + return 0; +} + + +Z_GDU *z_get_HTTP_Request(ODR o) +{ + Z_GDU *p = (Z_GDU *) odr_malloc(o, sizeof(*p)); + Z_HTTP_Request *hreq; + + p->which = Z_GDU_HTTP_Request; + p->u.HTTP_Request = (Z_HTTP_Request *) odr_malloc(o, sizeof(*hreq)); + hreq = p->u.HTTP_Request; + hreq->headers = 0; + hreq->content_len = 0; + hreq->content_buf = 0; + hreq->version = "1.1"; + hreq->method = "POST"; + hreq->path = "/"; + z_HTTP_header_add(o, &hreq->headers, "User-Agent", + "YAZ/" YAZ_VERSION); + return p; +} + +Z_GDU *z_get_HTTP_Response(ODR o, int code) +{ + Z_GDU *p = (Z_GDU *) odr_malloc(o, sizeof(*p)); + Z_HTTP_Response *hres; + + p->which = Z_GDU_HTTP_Response; + p->u.HTTP_Response = (Z_HTTP_Response *) odr_malloc(o, sizeof(*hres)); + hres = p->u.HTTP_Response; + hres->headers = 0; + hres->content_len = 0; + hres->content_buf = 0; + hres->code = code; + hres->version = "1.1"; + z_HTTP_header_add(o, &hres->headers, "Server", + "YAZ/" YAZ_VERSION); + if (code != 200) + { + hres->content_buf = (char*) odr_malloc(o, 400); + sprintf (hres->content_buf, + "\n" + "\n" + " \n" + " YAZ " YAZ_VERSION "\n" + " \n" + " \n" + "

YAZ " + YAZ_VERSION "

\n" + "

Error: %d

\n" + "

Description: %.50s

\n" + " \n" + "\n", + code, z_HTTP_errmsg(code)); + hres->content_len = strlen(hres->content_buf); + z_HTTP_header_add(o, &hres->headers, "Content-Type", "text/html"); + } + return p; +} + +const char *z_HTTP_errmsg(int code) +{ + if (code == 200) + return "OK"; + else if (code == 400) + return "Bad Request"; + else if (code == 404) + return "Not Found"; + else if (code == 405) + return "Method Not Allowed"; + else if (code == 500) + return "Internal Error"; + else + return "Unknown Error"; +} + +int z_GDU (ODR o, Z_GDU **p, int opt, const char *name) +{ + if (o->direction == ODR_DECODE) { + *p = (Z_GDU *) odr_malloc(o, sizeof(**p)); + if (o->size > 10 && !memcmp(o->buf, "HTTP/", 5)) + { + int i, po; + Z_HTTP_Response *hr; + (*p)->which = Z_GDU_HTTP_Response; + + hr = (*p)->u.HTTP_Response = (Z_HTTP_Response *) + odr_malloc(o, sizeof(*hr)); + po = i = 5; + while (i < o->size-2 && o->buf[i] != ' ' && o->buf[i] != '\r') + i++; + hr->version = (char *) odr_malloc(o, i - po + 1); + if (i - po) + memcpy(hr->version, o->buf + po, i - po); + hr->version[i-po] = 0; + if (o->buf[i] != ' ') + { + o->error = OHTTP; + return 0; + } + i++; + hr->code = 0; + while (i < o->size-2 && o->buf[i] >= '0' && o->buf[i] <= '9') + { + hr->code = hr->code*10 + (o->buf[i] - '0'); + i++; + } + while (i < o->size-1 && o->buf[i] != '\r') + i++; + return decode_headers_content(o, i, &hr->headers, + &hr->content_buf, &hr->content_len); + } + else if (o->size > 5 && + o->buf[0] >= 0x20 && o->buf[0] < 0x7f + && o->buf[1] >= 0x20 && o->buf[1] < 0x7f + && o->buf[2] >= 0x20 && o->buf[2] < 0x7f + && o->buf[3] >= 0x20 && o->buf[3] < 0x7f) + { + int i, po; + Z_HTTP_Request *hr; + + (*p)->which = Z_GDU_HTTP_Request; + hr = (*p)->u.HTTP_Request = + (Z_HTTP_Request *) odr_malloc(o, sizeof(*hr)); + + /* method .. */ + for (i = 0; o->buf[i] != ' '; i++) + if (i >= o->size-5 || i > 30) + { + o->error = OHTTP; + return 0; + } + hr->method = (char *) odr_malloc(o, i+1); + memcpy (hr->method, o->buf, i); + hr->method[i] = '\0'; + /* path */ + po = i+1; + for (i = po; o->buf[i] != ' '; i++) + if (i >= o->size-5) + { + o->error = OHTTP; + return 0; + } + hr->path = (char *) odr_malloc(o, i - po + 1); + memcpy (hr->path, o->buf+po, i - po); + hr->path[i - po] = '\0'; + /* HTTP version */ + i++; + if (i > o->size-5 || memcmp(o->buf+i, "HTTP/", 5)) + { + o->error = OHTTP; + return 0; + } + i+= 5; + po = i; + while (o->buf[i] != '\r') + { + if (i >= o->size-1) + { + o->error = OHTTP; + return 0; + } + i++; + } + hr->version = (char *) odr_malloc(o, i - po + 1); + memcpy(hr->version, o->buf + po, i - po); + hr->version[i - po] = '\0'; + /* headers */ + return decode_headers_content(o, i, &hr->headers, + &hr->content_buf, &hr->content_len); + + } + else + { + (*p)->which = Z_GDU_Z3950; + return z_APDU(o, &(*p)->u.z3950, opt, 0); + } + } + else /* ENCODE or PRINT */ + { + int top0 = o->top; + char sbuf[80]; + Z_HTTP_Header *h; + switch((*p)->which) + { + case Z_GDU_HTTP_Response: + sprintf(sbuf, "HTTP/%s %d %s\r\n", (*p)->u.HTTP_Response->version, + (*p)->u.HTTP_Response->code, + z_HTTP_errmsg((*p)->u.HTTP_Response->code)); + odr_write(o, (unsigned char *) sbuf, strlen(sbuf)); + /* apply Content-Length if not already applied */ + if (!z_HTTP_header_lookup((*p)->u.HTTP_Response->headers, + "Content-Length")) + { + char lstr[20]; + sprintf(lstr, "%d", (*p)->u.HTTP_Response->content_len); + z_HTTP_header_add(o, + &(*p)->u.HTTP_Response->headers, + "Content-Length", lstr); + } + for (h = (*p)->u.HTTP_Response->headers; h; h = h->next) + { + odr_write(o, (unsigned char *) h->name, strlen(h->name)); + odr_write(o, (unsigned char *) ": ", 2); + odr_write(o, (unsigned char *) h->value, strlen(h->value)); + odr_write(o, (unsigned char *) "\r\n", 2); + } + odr_write(o, (unsigned char *) "\r\n", 2); + if ((*p)->u.HTTP_Response->content_buf) + odr_write(o, (unsigned char *) + (*p)->u.HTTP_Response->content_buf, + (*p)->u.HTTP_Response->content_len); + if (o->direction == ODR_PRINT) + { + fprintf(o->print, "-- HTTP response:\n%.*s\n", o->top - top0, + o->buf + top0); + fprintf(o->print, "-- \n"); + } + break; + case Z_GDU_HTTP_Request: + odr_write(o, (unsigned char *) (*p)->u.HTTP_Request->method, + strlen((*p)->u.HTTP_Request->method)); + odr_write(o, (unsigned char *) " ", 1); + odr_write(o, (unsigned char *) (*p)->u.HTTP_Request->path, + strlen((*p)->u.HTTP_Request->path)); + odr_write(o, (unsigned char *) " HTTP/", 6); + odr_write(o, (unsigned char *) (*p)->u.HTTP_Request->version, + strlen((*p)->u.HTTP_Request->version)); + odr_write(o, (unsigned char *) "\r\n", 2); + if ((*p)->u.HTTP_Request->content_len && + !z_HTTP_header_lookup((*p)->u.HTTP_Request->headers, + "Content-Length")) + { + char lstr[20]; + sprintf(lstr, "%d", (*p)->u.HTTP_Request->content_len); + z_HTTP_header_add(o, + &(*p)->u.HTTP_Request->headers, + "Content-Length", lstr); + } + for (h = (*p)->u.HTTP_Request->headers; h; h = h->next) + { + odr_write(o, (unsigned char *) h->name, strlen(h->name)); + odr_write(o, (unsigned char *) ": ", 2); + odr_write(o, (unsigned char *) h->value, strlen(h->value)); + odr_write(o, (unsigned char *) "\r\n", 2); + } + odr_write(o, (unsigned char *) "\r\n", 2); + if ((*p)->u.HTTP_Request->content_buf) + odr_write(o, (unsigned char *) + (*p)->u.HTTP_Request->content_buf, + (*p)->u.HTTP_Request->content_len); + if (o->direction == ODR_PRINT) + { + fprintf(o->print, "-- HTTP request:\n%.*s\n", o->top, o->buf); + } + break; + case Z_GDU_Z3950: + return z_APDU(o, &(*p)->u.z3950, opt, 0); + } + } + return 1; +} + diff --git a/src/zget.c b/src/zget.c new file mode 100644 index 0000000..76036fc --- /dev/null +++ b/src/zget.c @@ -0,0 +1,498 @@ +/* + * Copyright (c) 1995-2003, Index Data. + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Id: zget.c,v 1.1 2003-10-27 12:21:36 adam Exp $ + */ + +#include + +Z_InitRequest *zget_InitRequest(ODR o) +{ + Z_InitRequest *r = (Z_InitRequest *)odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->options = (Odr_bitmask *)odr_malloc(o, sizeof(*r->options)); + ODR_MASK_ZERO(r->options); + r->protocolVersion = (Odr_bitmask *) + odr_malloc(o, sizeof(*r->protocolVersion)); + + ODR_MASK_SET(r->options, Z_Options_search); + ODR_MASK_SET(r->options, Z_Options_present); + + ODR_MASK_ZERO(r->protocolVersion); + + ODR_MASK_SET(r->protocolVersion, Z_ProtocolVersion_1); + ODR_MASK_SET(r->protocolVersion, Z_ProtocolVersion_2); + + r->preferredMessageSize = odr_intdup(o, 30*1024); + r->maximumRecordSize = odr_intdup(o, 30*1024); + r->idAuthentication = 0; + r->implementationId = "81"; + r->implementationName = "Index Data/YAZ"; + r->implementationVersion = YAZ_VERSION +#ifdef YAZ_DATE_STR + " (" YAZ_DATE_STR ")" +#endif +#ifdef YAZ_OS + " " YAZ_OS +#endif + ; + r->userInformationField = 0; + r->otherInfo = 0; + return r; +} + +Z_InitResponse *zget_InitResponse(ODR o) +{ + Z_InitResponse *r = (Z_InitResponse *)odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->options = (Odr_bitmask *)odr_malloc(o, sizeof(*r->options)); + ODR_MASK_ZERO(r->options); + r->protocolVersion = (Odr_bitmask *)odr_malloc(o, sizeof(*r->protocolVersion)); + ODR_MASK_ZERO(r->protocolVersion); + r->preferredMessageSize = odr_intdup(o, 30*1024); + r->maximumRecordSize = odr_intdup(o, 30*1024); + r->result = odr_intdup(o, 1); + r->implementationId = "81"; + r->implementationName = "Index Data/YAZ"; + r->implementationVersion = YAZ_VERSION +#ifdef YAZ_DATE_STR + " (" YAZ_DATE_STR ")" +#endif +#ifdef YAZ_OS + " " YAZ_OS +#endif + ; + r->userInformationField = 0; + r->otherInfo = 0; + return r; +} + +Z_SearchRequest *zget_SearchRequest(ODR o) +{ + Z_SearchRequest *r = (Z_SearchRequest *)odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->smallSetUpperBound = odr_intdup(o, 0); + r->largeSetLowerBound = odr_intdup(o, 1); + r->mediumSetPresentNumber = odr_intdup(o, 0); + r->replaceIndicator = odr_intdup(o, 1); + r->resultSetName = "default"; + r->num_databaseNames = 0; + r->databaseNames = 0; + r->smallSetElementSetNames = 0; + r->mediumSetElementSetNames = 0; + r->preferredRecordSyntax = 0; + r->query = 0; + r->additionalSearchInfo = 0; + r->otherInfo = 0; + return r; +} + +Z_SearchResponse *zget_SearchResponse(ODR o) +{ + Z_SearchResponse *r = (Z_SearchResponse *)odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->resultCount = odr_intdup(o, 0); + r->numberOfRecordsReturned = odr_intdup(o, 0); + r->nextResultSetPosition = odr_intdup(o, 0); + r->searchStatus = odr_intdup(o, 1); + r->resultSetStatus = 0; + r->presentStatus = 0; + r->records = 0; + r->additionalSearchInfo = 0; + r->otherInfo = 0; + return r; +} + +Z_PresentRequest *zget_PresentRequest(ODR o) +{ + Z_PresentRequest *r = (Z_PresentRequest *)odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->resultSetId = "default"; + r->resultSetStartPoint = odr_intdup(o, 1); + r->numberOfRecordsRequested = odr_intdup(o, 10); + r->num_ranges = 0; + r->additionalRanges = 0; + r->recordComposition = 0; + r->preferredRecordSyntax = 0; + r->maxSegmentCount = 0; + r->maxRecordSize = 0; + r->maxSegmentSize = 0; + r->otherInfo = 0; + return r; +} + +Z_PresentResponse *zget_PresentResponse(ODR o) +{ + Z_PresentResponse *r = (Z_PresentResponse *)odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->numberOfRecordsReturned = odr_intdup(o, 0); + r->nextResultSetPosition = odr_intdup(o, 0); + r->presentStatus = odr_intdup(o, Z_PresentStatus_success); + r->records = 0; + r->otherInfo = 0; + return r; +} + +Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o) +{ + Z_DeleteResultSetRequest *r = (Z_DeleteResultSetRequest *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->deleteFunction = odr_intdup(o, Z_DeleteRequest_list); + r->num_resultSetList = 0; + r->resultSetList = 0; + r->otherInfo = 0; + return r; +} + +Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o) +{ + Z_DeleteResultSetResponse *r = (Z_DeleteResultSetResponse *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->deleteOperationStatus = odr_intdup(o, Z_DeleteStatus_success); + r->deleteListStatuses = 0; + r->numberNotDeleted = 0; + r->bulkStatuses = 0; + r->deleteMessage = 0; + r->otherInfo = 0; + return r; +} + +Z_ScanRequest *zget_ScanRequest(ODR o) +{ + Z_ScanRequest *r = (Z_ScanRequest *)odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->num_databaseNames = 0; + r->databaseNames = 0; + r->attributeSet = 0; + r->termListAndStartPoint = 0; + r->stepSize = 0; + r->numberOfTermsRequested = odr_intdup(o, 20); + r->preferredPositionInResponse = 0; + r->otherInfo = 0; + return r; +} + +Z_ScanResponse *zget_ScanResponse(ODR o) +{ + Z_ScanResponse *r = (Z_ScanResponse *)odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->stepSize = 0; + r->scanStatus = odr_intdup(o, Z_Scan_success); + r->numberOfEntriesReturned = odr_intdup(o, 0); + r->positionOfTerm =0; + r->entries = 0; + r->attributeSet = 0; + r->otherInfo = 0; + return r; +} + +Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o) +{ + Z_TriggerResourceControlRequest *r = (Z_TriggerResourceControlRequest *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->requestedAction = odr_intdup(o, Z_TriggerResourceCtrl_resourceReport); + r->prefResourceReportFormat = 0; + r->resultSetWanted = 0; + r->otherInfo = 0; + return r; +} + +Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o) +{ + Z_ResourceControlRequest *r = (Z_ResourceControlRequest *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->suspendedFlag = 0; + r->resourceReport = 0; + r->partialResultsAvailable = 0; + r->responseRequired = odr_intdup(o, 0); + r->triggeredRequestFlag = 0; + r->otherInfo = 0; + return r; +} + +Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o) +{ + Z_ResourceControlResponse *r = (Z_ResourceControlResponse *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->continueFlag = odr_intdup(o, 1); + r->resultSetWanted = 0; + r->otherInfo = 0; + return r; +} + +Z_AccessControlRequest *zget_AccessControlRequest(ODR o) +{ + Z_AccessControlRequest *r = (Z_AccessControlRequest *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->which = Z_AccessRequest_simpleForm; + r->u.simpleForm = 0; + r->otherInfo = 0; + return r; +} + +Z_AccessControlResponse *zget_AccessControlResponse(ODR o) +{ + Z_AccessControlResponse *r = (Z_AccessControlResponse *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->which = Z_AccessResponse_simpleForm; + r->u.simpleForm = 0; + r->diagnostic = 0; + r->otherInfo = 0; + return r; +} + +Z_Segment *zget_Segment(ODR o) +{ + Z_Segment *r = (Z_Segment *)odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->numberOfRecordsReturned = odr_intdup(o, 0); + r->num_segmentRecords = 0; + r->segmentRecords = (Z_NamePlusRecord **) odr_nullval(); + r->otherInfo = 0; + return r; +} + +Z_Close *zget_Close(ODR o) +{ + Z_Close *r = (Z_Close *)odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->closeReason = odr_intdup(o, Z_Close_finished); + r->diagnosticInformation = 0; + r->resourceReportFormat = 0; + r->resourceReport = 0; + r->otherInfo = 0; + return r; +} + +Z_ResourceReportRequest *zget_ResourceReportRequest(ODR o) +{ + Z_ResourceReportRequest *r = (Z_ResourceReportRequest *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->opId = 0; + r->prefResourceReportFormat = 0; + r->otherInfo = 0; + return r; +} + +Z_ResourceReportResponse *zget_ResourceReportResponse(ODR o) +{ + Z_ResourceReportResponse *r = (Z_ResourceReportResponse *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->resourceReportStatus = odr_intdup(o, Z_ResourceReportStatus_success); + r->resourceReport = 0; + r->otherInfo = 0; + return r; +} + +Z_SortRequest *zget_SortRequest(ODR o) +{ + Z_SortRequest *r = (Z_SortRequest *)odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->inputResultSetNames = 0; + r->sortedResultSetName = 0; + r->sortSequence = 0; + r->otherInfo = 0; + return r; +} + +Z_SortResponse *zget_SortResponse(ODR o) +{ + Z_SortResponse *r = (Z_SortResponse *)odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->sortStatus = odr_intdup(o, Z_SortStatus_success); + r->resultSetStatus = odr_intdup(o, Z_SortResultSetStatus_empty); + r->diagnostics = 0; + r->resultCount = 0; + r->otherInfo = 0; + return r; +} + +Z_ExtendedServicesRequest *zget_ExtendedServicesRequest(ODR o) +{ + Z_ExtendedServicesRequest *r = (Z_ExtendedServicesRequest *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->function = odr_intdup(o, Z_ExtendedServicesRequest_create); + r->packageType = 0; + r->packageName = 0; + r->userId = 0; + r->retentionTime = 0; + r->permissions = 0; + r->description = 0; + r->taskSpecificParameters = 0; + r->waitAction = odr_intdup(o, Z_ExtendedServicesRequest_waitIfPossible); + r->elements = 0; + r->otherInfo = 0; + return r; +} + +Z_ExtendedServicesResponse *zget_ExtendedServicesResponse(ODR o) +{ + Z_ExtendedServicesResponse *r = (Z_ExtendedServicesResponse *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->operationStatus = odr_intdup(o, Z_ExtendedServicesResponse_done); + r->num_diagnostics = 0; + r->diagnostics = 0; + r->taskPackage = 0; + r->otherInfo = 0; + return r; +} + +Z_DuplicateDetectionRequest *zget_DuplicateDetectionRequest(ODR o) +{ + Z_DuplicateDetectionRequest *r = (Z_DuplicateDetectionRequest *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->num_inputResultSetIds = 0; + r->inputResultSetIds = 0; + r->outputResultSetName = 0; + r->applicablePortionOfRecord = 0; + r->num_duplicateDetectionCriteria = 0; + r->duplicateDetectionCriteria = 0; + r->clustering = 0; + r->num_retentionCriteria = 0; + r->retentionCriteria = 0; + r->num_sortCriteria = 0; + r->sortCriteria = 0; + r->otherInfo = 0; + return r; +} + +Z_DuplicateDetectionResponse *zget_DuplicateDetectionResponse(ODR o) +{ + Z_DuplicateDetectionResponse *r = (Z_DuplicateDetectionResponse *) + odr_malloc(o, sizeof(*r)); + + r->referenceId = 0; + r->status = odr_intdup(o, Z_DuplicateDetectionResponse_success); + r->resultSetCount = 0; + r->num_diagnostics = 0; + r->diagnostics = 0; + r->otherInfo = 0; + return r; +} + +Z_APDU *zget_APDU(ODR o, int which) +{ + Z_APDU *r = (Z_APDU *)odr_malloc(o, sizeof(*r)); + + switch (r->which = which) + { + case Z_APDU_initRequest: + r->u.initRequest = zget_InitRequest(o); + break; + case Z_APDU_initResponse: + r->u.initResponse = zget_InitResponse(o); + break; + case Z_APDU_searchRequest: + r->u.searchRequest = zget_SearchRequest(o); + break; + case Z_APDU_searchResponse: + r->u.searchResponse = zget_SearchResponse(o); + break; + case Z_APDU_presentRequest: + r->u.presentRequest = zget_PresentRequest(o); + break; + case Z_APDU_presentResponse: + r->u.presentResponse = zget_PresentResponse(o); + break; + case Z_APDU_deleteResultSetRequest: + r->u.deleteResultSetRequest = zget_DeleteResultSetRequest(o); + break; + case Z_APDU_deleteResultSetResponse: + r->u.deleteResultSetResponse = zget_DeleteResultSetResponse(o); + break; + case Z_APDU_scanRequest: + r->u.scanRequest = zget_ScanRequest(o); + break; + case Z_APDU_scanResponse: + r->u.scanResponse = zget_ScanResponse(o); + break; + case Z_APDU_triggerResourceControlRequest: + r->u.triggerResourceControlRequest = + zget_TriggerResourceControlRequest(o); + break; + case Z_APDU_resourceControlRequest: + r->u.resourceControlRequest = zget_ResourceControlRequest(o); + break; + case Z_APDU_resourceControlResponse: + r->u.resourceControlResponse = zget_ResourceControlResponse(o); + break; + case Z_APDU_segmentRequest: + r->u.segmentRequest = zget_Segment(o); + break; + case Z_APDU_close: + r->u.close = zget_Close(o); + break; + case Z_APDU_accessControlRequest: + r->u.accessControlRequest = zget_AccessControlRequest(o); + break; + case Z_APDU_accessControlResponse: + r->u.accessControlResponse = zget_AccessControlResponse(o); + break; + case Z_APDU_resourceReportRequest: + r->u.resourceReportRequest = zget_ResourceReportRequest(o); + break; + case Z_APDU_resourceReportResponse: + r->u.resourceReportResponse = zget_ResourceReportResponse(o); + break; + case Z_APDU_sortRequest: + r->u.sortRequest = zget_SortRequest(o); + break; + case Z_APDU_sortResponse: + r->u.sortResponse = zget_SortResponse(o); + break; + case Z_APDU_extendedServicesRequest: + r->u.extendedServicesRequest = zget_ExtendedServicesRequest(o); + break; + case Z_APDU_extendedServicesResponse: + r->u.extendedServicesResponse = zget_ExtendedServicesResponse(o); + break; + case Z_APDU_duplicateDetectionRequest: + r->u.duplicateDetectionRequest = zget_DuplicateDetectionRequest(o); + break; + case Z_APDU_duplicateDetectionResponse: + r->u.duplicateDetectionResponse = zget_DuplicateDetectionResponse(o); + break; + default: + fprintf(stderr, "Bad APDU-type to zget_APDU"); + exit(1); + } + return r; +} diff --git a/src/zoom-c.c b/src/zoom-c.c new file mode 100644 index 0000000..da9ca8b --- /dev/null +++ b/src/zoom-c.c @@ -0,0 +1,3224 @@ +/* + * Copyright (c) 2000-2003, Index Data + * See the file LICENSE for details. + * + * $Id: zoom-c.c,v 1.1 2003-10-27 12:21:36 adam Exp $ + * + * ZOOM layer for C, connections, result sets, queries. + */ +#include +#include +#include "zoom-p.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if HAVE_SYS_POLL_H +#include +#endif + +typedef enum { + zoom_pending, + zoom_complete +} zoom_ret; + +static zoom_ret ZOOM_connection_send_init (ZOOM_connection c); +static zoom_ret do_write_ex (ZOOM_connection c, char *buf_out, int len_out); + +static ZOOM_Event ZOOM_Event_create (int kind) +{ + ZOOM_Event event = (ZOOM_Event) xmalloc (sizeof(*event)); + event->kind = kind; + event->next = 0; + event->prev = 0; + return event; +} + +static void ZOOM_Event_destroy (ZOOM_Event event) +{ + xfree (event); +} + +static void ZOOM_connection_put_event (ZOOM_connection c, ZOOM_Event event) +{ + if (c->m_queue_back) + { + c->m_queue_back->prev = event; + assert (c->m_queue_front); + } + else + { + assert (!c->m_queue_front); + c->m_queue_front = event; + } + event->next = c->m_queue_back; + event->prev = 0; + c->m_queue_back = event; +} + +static ZOOM_Event ZOOM_connection_get_event(ZOOM_connection c) +{ + ZOOM_Event event = c->m_queue_front; + if (!event) + { + c->last_event = ZOOM_EVENT_NONE; + return 0; + } + assert (c->m_queue_back); + c->m_queue_front = event->prev; + if (c->m_queue_front) + { + assert (c->m_queue_back); + c->m_queue_front->next = 0; + } + else + c->m_queue_back = 0; + c->last_event = event->kind; + return event; +} + + +static void set_dset_error (ZOOM_connection c, int error, + const char *dset, + const char *addinfo, const char *addinfo2) +{ + xfree (c->addinfo); + c->addinfo = 0; + c->error = error; + c->diagset = dset; + if (addinfo && addinfo2) + { + c->addinfo = xmalloc(strlen(addinfo) + strlen(addinfo2) + 2); + strcpy(c->addinfo, addinfo); + strcat(c->addinfo, addinfo2); + } + else if (addinfo) + c->addinfo = xstrdup(addinfo); + if (error) + yaz_log(LOG_DEBUG, "Error %s %s:%d %s %s", + c->host_port ? c->host_port : "<>", dset, error, + addinfo ? addinfo : "", + addinfo2 ? addinfo2 : ""); +} + +#if HAVE_XML2 +static void set_HTTP_error (ZOOM_connection c, int error, + const char *addinfo, const char *addinfo2) +{ + set_dset_error(c, error, "HTTP", addinfo, addinfo2); +} +#endif + +static void set_ZOOM_error (ZOOM_connection c, int error, + const char *addinfo) +{ + set_dset_error(c, error, "ZOOM", addinfo, 0); +} + +static void clear_error (ZOOM_connection c) +{ + + switch (c->error) + { + case ZOOM_ERROR_CONNECT: + case ZOOM_ERROR_MEMORY: + case ZOOM_ERROR_DECODE: + case ZOOM_ERROR_CONNECTION_LOST: + case ZOOM_ERROR_INIT: + case ZOOM_ERROR_INTERNAL: + case ZOOM_ERROR_UNSUPPORTED_PROTOCOL: + break; + default: + set_ZOOM_error(c, ZOOM_ERROR_NONE, 0); + } +} + +ZOOM_task ZOOM_connection_add_task (ZOOM_connection c, int which) +{ + ZOOM_task *taskp = &c->tasks; + while (*taskp) + taskp = &(*taskp)->next; + *taskp = (ZOOM_task) xmalloc (sizeof(**taskp)); + (*taskp)->running = 0; + (*taskp)->which = which; + (*taskp)->next = 0; + clear_error (c); + return *taskp; +} + +ZOOM_task ZOOM_connection_insert_task (ZOOM_connection c, int which) +{ + ZOOM_task task = (ZOOM_task) xmalloc (sizeof(*task)); + + task->next = c->tasks; + c->tasks = task; + + task->running = 0; + task->which = which; + clear_error (c); + return task; +} + +void ZOOM_connection_remove_task (ZOOM_connection c) +{ + ZOOM_task task = c->tasks; + + if (task) + { + c->tasks = task->next; + switch (task->which) + { + case ZOOM_TASK_SEARCH: + + ZOOM_resultset_destroy (task->u.search.resultset); + break; + case ZOOM_TASK_RETRIEVE: + ZOOM_resultset_destroy (task->u.retrieve.resultset); + break; + case ZOOM_TASK_CONNECT: + break; + case ZOOM_TASK_SCAN: + ZOOM_scanset_destroy (task->u.scan.scan); + break; + case ZOOM_TASK_PACKAGE: + ZOOM_package_destroy (task->u.package); + break; + default: + assert (0); + } + xfree (task); + } +} + +static int ZOOM_connection_exec_task (ZOOM_connection c); + +void ZOOM_connection_remove_tasks (ZOOM_connection c) +{ + while (c->tasks) + ZOOM_connection_remove_task(c); +} + +static ZOOM_record record_cache_lookup (ZOOM_resultset r, int pos); + +ZOOM_API(ZOOM_connection) +ZOOM_connection_create (ZOOM_options options) +{ + ZOOM_connection c = (ZOOM_connection) xmalloc (sizeof(*c)); + + c->proto = PROTO_Z3950; + c->cs = 0; + c->mask = 0; + c->reconnect_ok = 0; + c->state = STATE_IDLE; + c->addinfo = 0; + set_ZOOM_error(c, ZOOM_ERROR_NONE, 0); + c->buf_in = 0; + c->len_in = 0; + c->buf_out = 0; + c->len_out = 0; + c->resultsets = 0; + + c->options = ZOOM_options_create_with_parent(options); + + c->host_port = 0; + c->path = 0; + c->proxy = 0; + + c->charset = c->lang = 0; + + c->cookie_out = 0; + c->cookie_in = 0; + c->client_IP = 0; + c->tasks = 0; + + c->odr_in = odr_createmem (ODR_DECODE); + c->odr_out = odr_createmem (ODR_ENCODE); + + c->async = 0; + c->support_named_resultsets = 0; + c->last_event = ZOOM_EVENT_NONE; + + c->m_queue_front = 0; + c->m_queue_back = 0; + return c; +} + +/* set database names. Take local databases (if set); otherwise + take databases given in ZURL (if set); otherwise use Default */ +static char **set_DatabaseNames (ZOOM_connection con, ZOOM_options options, + int *num) +{ + char **databaseNames; + const char *c; + int no = 2; + const char *cp = ZOOM_options_get (options, "databaseName"); + + if (!cp || !*cp) + { + if (strncmp (con->host_port, "unix:", 5) == 0) + cp = strchr (con->host_port+5, ':'); + else + cp = strchr (con->host_port, '/'); + if (cp) + cp++; + } + if (cp) + { + c = cp; + while ((c = strchr(c, '+'))) + { + c++; + no++; + } + } + else + cp = "Default"; + databaseNames = (char**) + odr_malloc (con->odr_out, no * sizeof(*databaseNames)); + no = 0; + while (*cp) + { + c = strchr (cp, '+'); + if (!c) + c = cp + strlen(cp); + else if (c == cp) + { + cp++; + continue; + } + /* cp ptr to first char of db name, c is char + following db name */ + databaseNames[no] = (char*) odr_malloc (con->odr_out, 1+c-cp); + memcpy (databaseNames[no], cp, c-cp); + databaseNames[no++][c-cp] = '\0'; + cp = c; + if (*cp) + cp++; + } + databaseNames[no] = NULL; + *num = no; + return databaseNames; +} + +ZOOM_API(ZOOM_connection) +ZOOM_connection_new (const char *host, int portnum) +{ + ZOOM_connection c = ZOOM_connection_create (0); + + ZOOM_connection_connect (c, host, portnum); + return c; +} + +ZOOM_API(void) +ZOOM_connection_connect(ZOOM_connection c, + const char *host, int portnum) +{ + const char *val; + ZOOM_task task; + + if (c->cs) + { + yaz_log (LOG_DEBUG, "reconnect"); + c->reconnect_ok = 1; + return; + } + yaz_log(LOG_DEBUG, "connect"); + xfree (c->proxy); + val = ZOOM_options_get (c->options, "proxy"); + if (val && *val) + c->proxy = xstrdup (val); + else + c->proxy = 0; + + xfree (c->charset); + val = ZOOM_options_get (c->options, "charset"); + if (val && *val) + c->charset = xstrdup (val); + else + c->charset = 0; + + xfree (c->lang); + val = ZOOM_options_get (c->options, "lang"); + if (val && *val) + c->lang = xstrdup (val); + else + c->lang = 0; + + xfree (c->host_port); + if (portnum) + { + char hostn[128]; + sprintf (hostn, "%.80s:%d", host, portnum); + c->host_port = xstrdup(hostn); + } + else + c->host_port = xstrdup(host); + + ZOOM_options_set(c->options, "host", c->host_port); + + val = ZOOM_options_get (c->options, "cookie"); + if (val && *val) + c->cookie_out = xstrdup (val); + + val = ZOOM_options_get (c->options, "clientIP"); + if (val && *val) + c->client_IP = xstrdup (val); + + c->async = ZOOM_options_get_bool (c->options, "async", 0); + + set_ZOOM_error(c, ZOOM_ERROR_NONE, 0); + + task = ZOOM_connection_add_task (c, ZOOM_TASK_CONNECT); + + if (!c->async) + { + while (ZOOM_event (1, &c)) + ; + } +} + +ZOOM_API(ZOOM_query) +ZOOM_query_create(void) +{ + ZOOM_query s = (ZOOM_query) xmalloc (sizeof(*s)); + + s->refcount = 1; + s->z_query = 0; + s->sort_spec = 0; + s->odr = odr_createmem (ODR_ENCODE); + s->query_string = 0; + + return s; +} + +ZOOM_API(void) +ZOOM_query_destroy(ZOOM_query s) +{ + if (!s) + return; + + (s->refcount)--; + yaz_log (LOG_DEBUG, "ZOOM_query_destroy count=%d", s->refcount); + if (s->refcount == 0) + { + odr_destroy (s->odr); + xfree (s); + } +} + +ZOOM_API(int) +ZOOM_query_prefix(ZOOM_query s, const char *str) +{ + s->query_string = odr_strdup(s->odr, str); + s->z_query = (Z_Query *) odr_malloc (s->odr, sizeof(*s->z_query)); + s->z_query->which = Z_Query_type_1; + s->z_query->u.type_1 = p_query_rpn(s->odr, PROTO_Z3950, str); + if (!s->z_query->u.type_1) + return -1; + return 0; +} + +ZOOM_API(int) +ZOOM_query_cql(ZOOM_query s, const char *str) +{ + Z_External *ext; + + s->query_string = odr_strdup(s->odr, str); + + ext = (Z_External *) odr_malloc(s->odr, sizeof(*ext)); + ext->direct_reference = odr_getoidbystr(s->odr, "1.2.840.10003.16.2"); + ext->indirect_reference = 0; + ext->descriptor = 0; + ext->which = Z_External_CQL; + ext->u.cql = s->query_string; + + s->z_query = (Z_Query *) odr_malloc (s->odr, sizeof(*s->z_query)); + s->z_query->which = Z_Query_type_104; + s->z_query->u.type_104 = ext; + + return 0; +} + +ZOOM_API(int) +ZOOM_query_sortby(ZOOM_query s, const char *criteria) +{ + s->sort_spec = yaz_sort_spec (s->odr, criteria); + if (!s->sort_spec) + return -1; + return 0; +} + +static zoom_ret do_write(ZOOM_connection c); + +ZOOM_API(void) +ZOOM_connection_destroy(ZOOM_connection c) +{ + ZOOM_resultset r; + if (!c) + return; + if (c->cs) + cs_close (c->cs); + for (r = c->resultsets; r; r = r->next) + r->connection = 0; + + xfree (c->buf_in); + xfree (c->addinfo); + odr_destroy (c->odr_in); + odr_destroy (c->odr_out); + ZOOM_options_destroy (c->options); + ZOOM_connection_remove_tasks (c); + xfree (c->host_port); + xfree (c->path); + xfree (c->proxy); + xfree (c->charset); + xfree (c->lang); + xfree (c->cookie_out); + xfree (c->cookie_in); + xfree (c->client_IP); + xfree (c); +} + +void ZOOM_resultset_addref (ZOOM_resultset r) +{ + if (r) + { + (r->refcount)++; + yaz_log (LOG_DEBUG, "ZOOM_resultset_addref r=%p count=%d", + r, r->refcount); + } +} +ZOOM_resultset ZOOM_resultset_create () +{ + ZOOM_resultset r = (ZOOM_resultset) xmalloc (sizeof(*r)); + + yaz_log (LOG_DEBUG, "ZOOM_resultset_create r = %p", r); + r->refcount = 1; + r->size = 0; + r->odr = odr_createmem (ODR_ENCODE); + r->start = 0; + r->piggyback = 1; + r->setname = 0; + r->schema = 0; + r->count = 0; + r->step = 0; + r->record_cache = 0; + r->r_sort_spec = 0; + r->query = 0; + r->connection = 0; + r->next = 0; + return r; +} + +ZOOM_API(ZOOM_resultset) +ZOOM_connection_search_pqf(ZOOM_connection c, const char *q) +{ + ZOOM_resultset r; + ZOOM_query s = ZOOM_query_create(); + + ZOOM_query_prefix (s, q); + + r = ZOOM_connection_search (c, s); + ZOOM_query_destroy (s); + return r; +} + +ZOOM_API(ZOOM_resultset) +ZOOM_connection_search(ZOOM_connection c, ZOOM_query q) +{ + ZOOM_resultset r = ZOOM_resultset_create (); + ZOOM_task task; + const char *cp; + + r->r_sort_spec = q->sort_spec; + r->query = q; + + r->options = ZOOM_options_create_with_parent(c->options); + + r->start = ZOOM_options_get_int(r->options, "start", 0); + r->count = ZOOM_options_get_int(r->options, "count", 0); + r->step = ZOOM_options_get_int(r->options, "step", 0); + r->piggyback = ZOOM_options_get_bool (r->options, "piggyback", 1); + cp = ZOOM_options_get (r->options, "setname"); + if (cp) + r->setname = xstrdup(cp); + cp = ZOOM_options_get (r->options, "schema"); + if (cp) + r->schema = xstrdup(cp); + + r->connection = c; + + r->next = c->resultsets; + c->resultsets = r; + + if (c->host_port && c->proto == PROTO_HTTP) + { + if (!c->cs) + { + yaz_log(LOG_DEBUG, "NO COMSTACK"); + ZOOM_connection_add_task(c, ZOOM_TASK_CONNECT); + } + else + { + yaz_log(LOG_DEBUG, "PREPARE FOR RECONNECT"); + c->reconnect_ok = 1; + } + } + + task = ZOOM_connection_add_task (c, ZOOM_TASK_SEARCH); + task->u.search.resultset = r; + ZOOM_resultset_addref (r); + + (q->refcount)++; + + if (!c->async) + { + while (ZOOM_event (1, &c)) + ; + } + return r; +} + +ZOOM_API(void) +ZOOM_resultset_destroy(ZOOM_resultset r) +{ + if (!r) + return; + (r->refcount)--; + yaz_log (LOG_DEBUG, "ZOOM_resultset_destroy r = %p count=%d", + r, r->refcount); + if (r->refcount == 0) + { + ZOOM_record_cache rc; + + for (rc = r->record_cache; rc; rc = rc->next) + { + if (rc->rec.wrbuf_marc) + wrbuf_free (rc->rec.wrbuf_marc, 1); + if (rc->rec.wrbuf_iconv) + wrbuf_free (rc->rec.wrbuf_iconv, 1); + if (rc->rec.wrbuf_opac) + wrbuf_free (rc->rec.wrbuf_opac, 1); + } + if (r->connection) + { + /* remove ourselves from the resultsets in connection */ + ZOOM_resultset *rp = &r->connection->resultsets; + while (1) + { + assert (*rp); /* we must be in this list!! */ + if (*rp == r) + { /* OK, we're here - take us out of it */ + *rp = (*rp)->next; + break; + } + rp = &(*rp)->next; + } + } + ZOOM_query_destroy (r->query); + ZOOM_options_destroy (r->options); + odr_destroy (r->odr); + xfree (r->setname); + xfree (r->schema); + xfree (r); + } +} + +ZOOM_API(size_t) +ZOOM_resultset_size (ZOOM_resultset r) +{ + return r->size; +} + +static void do_close (ZOOM_connection c) +{ + if (c->cs) + cs_close(c->cs); + c->cs = 0; + c->mask = 0; + c->state = STATE_IDLE; +} + +static void ZOOM_resultset_retrieve (ZOOM_resultset r, + int force_sync, int start, int count) +{ + ZOOM_task task; + ZOOM_connection c; + const char *cp; + + if (!r) + return; + c = r->connection; + if (!c) + return; + + if (c->host_port && c->proto == PROTO_HTTP) + { + if (!c->cs) + { + yaz_log(LOG_DEBUG, "NO COMSTACK"); + ZOOM_connection_add_task(c, ZOOM_TASK_CONNECT); + } + else + { + yaz_log(LOG_DEBUG, "PREPARE FOR RECONNECT"); + c->reconnect_ok = 1; + } + } + task = ZOOM_connection_add_task (c, ZOOM_TASK_RETRIEVE); + task->u.retrieve.resultset = r; + task->u.retrieve.start = start; + task->u.retrieve.count = count; + + cp = ZOOM_options_get (r->options, "schema"); + if (cp) + { + if (!r->schema || strcmp(r->schema, cp)) + { + xfree(r->schema); + r->schema = xstrdup(cp); + } + } + + ZOOM_resultset_addref (r); + + if (!r->connection->async || force_sync) + while (r->connection && ZOOM_event (1, &r->connection)) + ; +} + +ZOOM_API(void) +ZOOM_resultset_records (ZOOM_resultset r, ZOOM_record *recs, + size_t start, size_t count) +{ + int force_present = 0; + + if (!r) + return ; + if (count && recs) + force_present = 1; + ZOOM_resultset_retrieve (r, force_present, start, count); + if (force_present) + { + size_t i; + for (i = 0; i< count; i++) + recs[i] = ZOOM_resultset_record_immediate (r, i+start); + } +} + +static zoom_ret do_connect (ZOOM_connection c) +{ + void *add; + const char *effective_host; + + if (c->proxy) + effective_host = c->proxy; + else + effective_host = c->host_port; + + yaz_log (LOG_DEBUG, "do_connect host=%s", effective_host); + + assert (!c->cs); + c->cs = cs_create_host (effective_host, 0, &add); + + if (c->cs && c->cs->protocol == PROTO_HTTP) + { +#if HAVE_XML2 + const char *path = 0; + + c->proto = PROTO_HTTP; + cs_get_host_args(c->host_port, &path); + xfree(c->path); + c->path = xmalloc(strlen(path)+2); + c->path[0] = '/'; + strcpy (c->path+1, path); +#else + set_ZOOM_error(c, ZOOM_ERROR_UNSUPPORTED_PROTOCOL, "SRW"); + do_close(c); + return zoom_complete; +#endif + } + if (c->cs) + { + int ret = cs_connect (c->cs, add); + if (ret == 0) + { + ZOOM_Event event = ZOOM_Event_create(ZOOM_EVENT_CONNECT); + ZOOM_connection_put_event(c, event); + if (c->proto == PROTO_Z3950) + ZOOM_connection_send_init(c); + else + { + /* no init request for SRW .. */ + assert (c->tasks->which == ZOOM_TASK_CONNECT); + ZOOM_connection_remove_task (c); + c->mask = 0; + ZOOM_connection_exec_task (c); + } + c->state = STATE_ESTABLISHED; + return zoom_pending; + } + else if (ret > 0) + { + c->state = STATE_CONNECTING; + c->mask = ZOOM_SELECT_EXCEPT; + if (c->cs->io_pending & CS_WANT_WRITE) + c->mask += ZOOM_SELECT_WRITE; + if (c->cs->io_pending & CS_WANT_READ) + c->mask += ZOOM_SELECT_READ; + return zoom_pending; + } + } + c->state = STATE_IDLE; + set_ZOOM_error(c, ZOOM_ERROR_CONNECT, effective_host); + return zoom_complete; +} + +int z3950_connection_socket(ZOOM_connection c) +{ + if (c->cs) + return cs_fileno(c->cs); + return -1; +} + +int z3950_connection_mask(ZOOM_connection c) +{ + if (c->cs) + return c->mask; + return 0; +} + +static void otherInfo_attach (ZOOM_connection c, Z_APDU *a, ODR out) +{ + int i; + for (i = 0; i<200; i++) + { + size_t len; + Z_OtherInformation **oi; + char buf[80]; + const char *val; + const char *cp; + int oidval; + + sprintf (buf, "otherInfo%d", i); + val = ZOOM_options_get (c->options, buf); + if (!val) + break; + cp = strchr (val, ':'); + if (!cp) + continue; + len = cp - val; + if (len >= sizeof(buf)) + len = sizeof(buf)-1; + memcpy (buf, val, len); + buf[len] = '\0'; + oidval = oid_getvalbyname (buf); + if (oidval == VAL_NONE) + continue; + + yaz_oi_APDU(a, &oi); + yaz_oi_set_string_oidval(oi, out, oidval, 1, cp+1); + } +} + +static int encode_APDU(ZOOM_connection c, Z_APDU *a, ODR out) +{ + assert (a); + if (c->cookie_out) + { + Z_OtherInformation **oi; + yaz_oi_APDU(a, &oi); + yaz_oi_set_string_oidval(oi, out, VAL_COOKIE, 1, c->cookie_out); + } + if (c->client_IP) + { + Z_OtherInformation **oi; + yaz_oi_APDU(a, &oi); + yaz_oi_set_string_oidval(oi, out, VAL_CLIENT_IP, 1, c->client_IP); + } + otherInfo_attach (c, a, out); + if (!z_APDU(out, &a, 0, 0)) + { + FILE *outf = fopen("/tmp/apdu.txt", "a"); + if (a && outf) + { + ODR odr_pr = odr_createmem(ODR_PRINT); + fprintf (outf, "a=%p\n", a); + odr_setprint(odr_pr, outf); + z_APDU(odr_pr, &a, 0, 0); + odr_destroy(odr_pr); + } + yaz_log (LOG_DEBUG, "encoding failed"); + set_ZOOM_error(c, ZOOM_ERROR_ENCODE, 0); + odr_reset(out); + return -1; + } + + return 0; +} + +static zoom_ret send_APDU (ZOOM_connection c, Z_APDU *a) +{ + ZOOM_Event event; + assert (a); + if (encode_APDU(c, a, c->odr_out)) + return zoom_complete; + yaz_log(LOG_DEBUG, "send APDU type=%d", a->which); + c->buf_out = odr_getbuf(c->odr_out, &c->len_out, 0); + event = ZOOM_Event_create (ZOOM_EVENT_SEND_APDU); + ZOOM_connection_put_event (c, event); + odr_reset(c->odr_out); + return do_write (c); +} + +/* returns 1 if PDU was sent OK (still pending ) + 0 if PDU was not sent OK (nothing to wait for) +*/ + +static zoom_ret ZOOM_connection_send_init (ZOOM_connection c) +{ + const char *impname; + Z_APDU *apdu = zget_APDU(c->odr_out, Z_APDU_initRequest); + Z_InitRequest *ireq = apdu->u.initRequest; + Z_IdAuthentication *auth = (Z_IdAuthentication *) + odr_malloc(c->odr_out, sizeof(*auth)); + const char *auth_groupId = ZOOM_options_get (c->options, "group"); + const char *auth_userId = ZOOM_options_get (c->options, "user"); + const char *auth_password = ZOOM_options_get (c->options, "pass"); + + ODR_MASK_SET(ireq->options, Z_Options_search); + ODR_MASK_SET(ireq->options, Z_Options_present); + ODR_MASK_SET(ireq->options, Z_Options_scan); + ODR_MASK_SET(ireq->options, Z_Options_sort); + ODR_MASK_SET(ireq->options, Z_Options_extendedServices); + ODR_MASK_SET(ireq->options, Z_Options_namedResultSets); + + ODR_MASK_SET(ireq->protocolVersion, Z_ProtocolVersion_1); + ODR_MASK_SET(ireq->protocolVersion, Z_ProtocolVersion_2); + ODR_MASK_SET(ireq->protocolVersion, Z_ProtocolVersion_3); + + impname = ZOOM_options_get (c->options, "implementationName"); + ireq->implementationName = + (char *) odr_malloc (c->odr_out, 15 + (impname ? strlen(impname) : 0)); + strcpy (ireq->implementationName, ""); + if (impname) + { + strcat (ireq->implementationName, impname); + strcat (ireq->implementationName, "/"); + } + strcat (ireq->implementationName, "ZOOM-C/YAZ"); + + *ireq->maximumRecordSize = + ZOOM_options_get_int (c->options, "maximumRecordSize", 1024*1024); + *ireq->preferredMessageSize = + ZOOM_options_get_int (c->options, "preferredMessageSize", 1024*1024); + + if (auth_groupId || auth_password) + { + Z_IdPass *pass = (Z_IdPass *) odr_malloc(c->odr_out, sizeof(*pass)); + int i = 0; + pass->groupId = 0; + if (auth_groupId && *auth_groupId) + { + pass->groupId = (char *) + odr_malloc(c->odr_out, strlen(auth_groupId)+1); + strcpy(pass->groupId, auth_groupId); + i++; + } + pass->userId = 0; + if (auth_userId && *auth_userId) + { + pass->userId = (char *) + odr_malloc(c->odr_out, strlen(auth_userId)+1); + strcpy(pass->userId, auth_userId); + i++; + } + pass->password = 0; + if (auth_password && *auth_password) + { + pass->password = (char *) + odr_malloc(c->odr_out, strlen(auth_password)+1); + strcpy(pass->password, auth_password); + i++; + } + if (i) + { + auth->which = Z_IdAuthentication_idPass; + auth->u.idPass = pass; + ireq->idAuthentication = auth; + } + } + else if (auth_userId) + { + auth->which = Z_IdAuthentication_open; + auth->u.open = (char *) + odr_malloc(c->odr_out, strlen(auth_userId)+1); + strcpy(auth->u.open, auth_userId); + ireq->idAuthentication = auth; + } + if (c->proxy) + yaz_oi_set_string_oidval(&ireq->otherInfo, c->odr_out, + VAL_PROXY, 1, c->host_port); + if (c->charset||c->lang) + { + Z_OtherInformation **oi; + Z_OtherInformationUnit *oi_unit; + + yaz_oi_APDU(apdu, &oi); + + if ((oi_unit = yaz_oi_update(oi, c->odr_out, NULL, 0, 0))) + { + ODR_MASK_SET(ireq->options, Z_Options_negotiationModel); + + oi_unit->which = Z_OtherInfo_externallyDefinedInfo; + oi_unit->information.externallyDefinedInfo = + yaz_set_proposal_charneg + (c->odr_out, + (const char **)&c->charset, (c->charset) ? 1:0, + (const char **)&c->lang, (c->lang) ? 1:0, 1); + } + } + assert (apdu); + return send_APDU (c, apdu); +} + +#if HAVE_XML2 +static zoom_ret send_srw (ZOOM_connection c, Z_SRW_PDU *sr) +{ + char ctype[50]; + Z_SOAP_Handler h[2] = { + {"http://www.loc.gov/zing/srw/v1.0/", 0, (Z_SOAP_fun) yaz_srw_codec}, + {0, 0, 0} + }; + ODR o = odr_createmem(ODR_ENCODE); + int ret; + Z_SOAP *p = odr_malloc(o, sizeof(*p)); + Z_GDU *gdu; + ZOOM_Event event; + + gdu = z_get_HTTP_Request(c->odr_out); + gdu->u.HTTP_Request->path = c->path; + + if (c->host_port) + { + const char *cp0 = strstr(c->host_port, "://"); + const char *cp1 = 0; + if (cp0) + cp0 = cp0+3; + else + cp0 = c->host_port; + + cp1 = strchr(cp0, '/'); + if (!cp1) + cp1 = cp0+strlen(cp0); + + if (cp0 && cp1) + { + char *h = odr_malloc(c->odr_out, cp1 - cp0 + 1); + memcpy (h, cp0, cp1 - cp0); + h[cp1-cp0] = '\0'; + z_HTTP_header_add(c->odr_out, &gdu->u.HTTP_Request->headers, + "host", h); + } + } + + strcpy(ctype, "text/xml"); + if (c->charset && strlen(c->charset) < 20) + { + strcat(ctype, "; charset="); + strcat(ctype, c->charset); + } + z_HTTP_header_add(c->odr_out, &gdu->u.HTTP_Request->headers, + "Content-Type", ctype); + z_HTTP_header_add(c->odr_out, &gdu->u.HTTP_Request->headers, + "SOAPAction", "\"\""); + p->which = Z_SOAP_generic; + p->u.generic = odr_malloc(o, sizeof(*p->u.generic)); + p->u.generic->no = 0; + p->u.generic->ns = 0; + p->u.generic->p = sr; + p->ns = "http://schemas.xmlsoap.org/soap/envelope/"; + + ret = z_soap_codec_enc(o, &p, + &gdu->u.HTTP_Request->content_buf, + &gdu->u.HTTP_Request->content_len, h, + c->charset); + + if (!z_GDU(c->odr_out, &gdu, 0, 0)) + return zoom_complete; + c->buf_out = odr_getbuf(c->odr_out, &c->len_out, 0); + + odr_destroy(o); + + event = ZOOM_Event_create (ZOOM_EVENT_SEND_APDU); + ZOOM_connection_put_event (c, event); + odr_reset(c->odr_out); + return do_write (c); +} +#endif + +#if HAVE_XML2 +static zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c) +{ + int i; + ZOOM_resultset resultset = 0; + Z_SRW_PDU *sr = 0; + const char *recordPacking = 0; + + if (c->error) /* don't continue on error */ + return zoom_complete; + assert (c->tasks); + if (c->tasks->which == ZOOM_TASK_SEARCH) + { + resultset = c->tasks->u.search.resultset; + resultset->setname = xstrdup ("default"); + ZOOM_options_set (resultset->options, "setname", resultset->setname); + } + else if(c->tasks->which == ZOOM_TASK_RETRIEVE) + { + resultset = c->tasks->u.retrieve.resultset; + + resultset->start = c->tasks->u.retrieve.start; + resultset->count = c->tasks->u.retrieve.count; + + if (resultset->start >= resultset->size) + return zoom_complete; + if (resultset->start + resultset->count > resultset->size) + resultset->count = resultset->size - resultset->start; + + for (i = 0; icount; i++) + { + ZOOM_record rec = + record_cache_lookup (resultset, i + resultset->start); + if (!rec) + break; + } + if (i == resultset->count) + return zoom_complete; + } + assert(resultset->query); + + sr = yaz_srw_get(c->odr_out, Z_SRW_searchRetrieve_request); + + if (resultset->query->z_query->which == Z_Query_type_104 + && resultset->query->z_query->u.type_104->which == Z_External_CQL) + { + + sr->u.request->query_type = Z_SRW_query_type_cql; + sr->u.request->query.cql =resultset->query->z_query->u.type_104->u.cql; + } + else if (resultset->query->z_query->which == Z_Query_type_1 && + resultset->query->z_query->u.type_1) + { + sr->u.request->query_type = Z_SRW_query_type_pqf; + sr->u.request->query.pqf = resultset->query->query_string; + } + else + { + set_ZOOM_error(c, ZOOM_ERROR_UNSUPPORTED_QUERY, 0); + return zoom_complete; + } + sr->u.request->startRecord = odr_intdup (c->odr_out, resultset->start + 1); + sr->u.request->maximumRecords = odr_intdup ( + c->odr_out, resultset->step>0 ? resultset->step : resultset->count); + sr->u.request->recordSchema = resultset->schema; + + recordPacking = ZOOM_resultset_option_get (resultset, "recordPacking"); + + if (recordPacking) + sr->u.request->recordPacking = odr_strdup(c->odr_out, recordPacking); + + return send_srw(c, sr); +} +#else +static zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c) +{ + return zoom_complete; +} +#endif + +static zoom_ret ZOOM_connection_send_search (ZOOM_connection c) +{ + ZOOM_resultset r; + int lslb, ssub, mspn; + const char *syntax; + Z_APDU *apdu = zget_APDU(c->odr_out, Z_APDU_searchRequest); + Z_SearchRequest *search_req = apdu->u.searchRequest; + const char *elementSetName; + const char *smallSetElementSetName; + const char *mediumSetElementSetName; + + assert (c->tasks); + assert (c->tasks->which == ZOOM_TASK_SEARCH); + + r = c->tasks->u.search.resultset; + + elementSetName = + ZOOM_options_get (r->options, "elementSetName"); + smallSetElementSetName = + ZOOM_options_get (r->options, "smallSetElementSetName"); + mediumSetElementSetName = + ZOOM_options_get (r->options, "mediumSetElementSetName"); + + if (!smallSetElementSetName) + smallSetElementSetName = elementSetName; + + if (!mediumSetElementSetName) + mediumSetElementSetName = elementSetName; + + assert (r); + assert (r->query); + + /* prepare query for the search request */ + search_req->query = r->query->z_query; + + search_req->databaseNames = + set_DatabaseNames (c, r->options, &search_req->num_databaseNames); + + /* get syntax (no need to provide unless piggyback is in effect) */ + syntax = ZOOM_options_get (r->options, "preferredRecordSyntax"); + + lslb = ZOOM_options_get_int (r->options, "largeSetLowerBound", -1); + ssub = ZOOM_options_get_int (r->options, "smallSetUpperBound", -1); + mspn = ZOOM_options_get_int (r->options, "mediumSetPresentNumber", -1); + if (lslb != -1 && ssub != -1 && mspn != -1) + { + /* So're a Z39.50 expert? Let's hope you don't do sort */ + *search_req->largeSetLowerBound = lslb; + *search_req->smallSetUpperBound = ssub; + *search_req->mediumSetPresentNumber = mspn; + } + else if (r->start == 0 && r->count > 0 + && r->piggyback && !r->r_sort_spec && !r->schema) + { + /* Regular piggyback - do it unless we're going to do sort */ + *search_req->largeSetLowerBound = 2000000000; + *search_req->smallSetUpperBound = 1; + *search_req->mediumSetPresentNumber = r->step>0 ? r->step : r->count; + } + else + { + /* non-piggyback. Need not provide elementsets or syntaxes .. */ + smallSetElementSetName = 0; + mediumSetElementSetName = 0; + syntax = 0; + } + if (smallSetElementSetName && *smallSetElementSetName) + { + Z_ElementSetNames *esn = (Z_ElementSetNames *) + odr_malloc (c->odr_out, sizeof(*esn)); + + esn->which = Z_ElementSetNames_generic; + esn->u.generic = odr_strdup (c->odr_out, smallSetElementSetName); + search_req->smallSetElementSetNames = esn; + } + if (mediumSetElementSetName && *mediumSetElementSetName) + { + Z_ElementSetNames *esn = (Z_ElementSetNames *) + odr_malloc (c->odr_out, sizeof(*esn)); + + esn->which = Z_ElementSetNames_generic; + esn->u.generic = odr_strdup (c->odr_out, mediumSetElementSetName); + search_req->mediumSetElementSetNames = esn; + } + if (syntax) + search_req->preferredRecordSyntax = + yaz_str_to_z3950oid (c->odr_out, CLASS_RECSYN, syntax); + + if (!r->setname) + { + if (c->support_named_resultsets) + { + char setname[14]; + int ord; + /* find the lowest unused ordinal so that we re-use + result sets on the server. */ + for (ord = 1; ; ord++) + { + ZOOM_resultset rp; + sprintf (setname, "%d", ord); + for (rp = c->resultsets; rp; rp = rp->next) + if (rp->setname && !strcmp (rp->setname, setname)) + break; + if (!rp) + break; + } + r->setname = xstrdup (setname); + yaz_log (LOG_DEBUG, "allocating set %s", r->setname); + } + else + r->setname = xstrdup ("default"); + ZOOM_options_set (r->options, "setname", r->setname); + } + search_req->resultSetName = odr_strdup(c->odr_out, r->setname); + /* send search request */ + return send_APDU (c, apdu); +} + +static void response_diag (ZOOM_connection c, Z_DiagRec *p) +{ + int oclass; + Z_DefaultDiagFormat *r; + char *addinfo = 0; + + xfree (c->addinfo); + c->addinfo = 0; + if (p->which != Z_DiagRec_defaultFormat) + { + set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); + return; + } + r = p->u.defaultFormat; + switch (r->which) + { + case Z_DefaultDiagFormat_v2Addinfo: + addinfo = r->u.v2Addinfo; + break; + case Z_DefaultDiagFormat_v3Addinfo: + addinfo = r->u.v3Addinfo; + break; + } + set_dset_error(c, *r->condition, + yaz_z3950oid_to_str(r->diagnosticSetId, &oclass), + addinfo, 0); +} + +ZOOM_API(ZOOM_record) +ZOOM_record_clone (ZOOM_record srec) +{ + char *buf; + int size; + ODR odr_enc; + ZOOM_record nrec; + + odr_enc = odr_createmem(ODR_ENCODE); + if (!z_NamePlusRecord (odr_enc, &srec->npr, 0, 0)) + return 0; + buf = odr_getbuf (odr_enc, &size, 0); + + nrec = (ZOOM_record) xmalloc (sizeof(*nrec)); + nrec->odr = odr_createmem(ODR_DECODE); + nrec->wrbuf_marc = 0; + nrec->wrbuf_iconv = 0; + nrec->wrbuf_opac = 0; + odr_setbuf (nrec->odr, buf, size, 0); + z_NamePlusRecord (nrec->odr, &nrec->npr, 0, 0); + + odr_destroy (odr_enc); + return nrec; +} + +ZOOM_API(ZOOM_record) +ZOOM_resultset_record_immediate (ZOOM_resultset s,size_t pos) +{ + return record_cache_lookup (s, pos); +} + +ZOOM_API(ZOOM_record) +ZOOM_resultset_record (ZOOM_resultset r, size_t pos) +{ + ZOOM_record rec = ZOOM_resultset_record_immediate(r, pos); + + if (!rec) + { + ZOOM_resultset_retrieve (r, 1, pos, 1); + rec = ZOOM_resultset_record_immediate (r, pos); + } + return rec; +} + +ZOOM_API(void) +ZOOM_record_destroy (ZOOM_record rec) +{ + if (!rec) + return; + if (rec->wrbuf_marc) + wrbuf_free (rec->wrbuf_marc, 1); + if (rec->wrbuf_iconv) + wrbuf_free (rec->wrbuf_iconv, 1); + if (rec->wrbuf_opac) + wrbuf_free (rec->wrbuf_opac, 1); + odr_destroy (rec->odr); + xfree (rec); +} + +static const char *record_iconv_return(ZOOM_record rec, int *len, + const char *buf, int sz, + const char *record_charset) +{ + char to[40]; + char from[40]; + yaz_iconv_t cd = 0; + + *from = '\0'; + strcpy(to, "UTF-8"); + if (record_charset && *record_charset) + { + /* Use "from,to" or just "from" */ + const char *cp =strchr(record_charset, ','); + int clen = strlen(record_charset); + if (cp && cp[1]) + { + strncpy( to, cp+1, sizeof(to)-1); + to[sizeof(to)-1] = '\0'; + clen = cp - record_charset; + } + if (clen > sizeof(from)-1) + clen = sizeof(from)-1; + + if (clen) + strncpy(from, record_charset, clen); + from[clen] = '\0'; + } + + if (*from && *to && (cd = yaz_iconv_open(to, from))) + { + char outbuf[12]; + size_t inbytesleft = sz; + const char *inp = buf; + + if (!rec->wrbuf_iconv) + rec->wrbuf_iconv = wrbuf_alloc(); + + wrbuf_rewind(rec->wrbuf_iconv); + + while (inbytesleft) + { + size_t outbytesleft = sizeof(outbuf); + char *outp = outbuf; + size_t r = yaz_iconv (cd, (char**) &inp, + &inbytesleft, + &outp, &outbytesleft); + if (r == (size_t) (-1)) + { + int e = yaz_iconv_error(cd); + if (e != YAZ_ICONV_E2BIG) + break; + } + wrbuf_write(rec->wrbuf_iconv, outbuf, outp - outbuf); + } + wrbuf_puts(rec->wrbuf_iconv, ""); + buf = wrbuf_buf(rec->wrbuf_iconv); + sz = wrbuf_len(rec->wrbuf_iconv); + yaz_iconv_close(cd); + } + if (len) + *len = sz; + return buf; +} + +ZOOM_API(const char *) +ZOOM_record_get (ZOOM_record rec, const char *type_spec, int *len) +{ + char type[40]; + char charset[40]; + const char *cp; + int i; + Z_NamePlusRecord *npr; + + if (len) + *len = 0; /* default return */ + + if (!rec) + return 0; + npr = rec->npr; + if (!npr) + return 0; + + cp = type_spec; + for (i = 0; cp[i] && i < sizeof(type)-1; i++) + { + if (cp[i] == ';' || cp[i] == ' ') + break; + type[i] = cp[i]; + } + type[i] = '\0'; + charset[0] = '\0'; + if (type_spec[i] == ';') + { + i++; + while (type_spec[i] == ' ') + i++; + if (!strncmp(type_spec+i, "charset=", 8)) + { + cp = type_spec+i+8; + for (i = 0; cp[i] && i < sizeof(charset)-1; i++) + { + if (cp[i] == ';' || cp[i] == ' ') + break; + charset[i] = cp[i]; + } + charset[i] = '\0'; + } + } + + if (!strcmp (type, "database")) + { + if (len) + *len = (npr->databaseName ? strlen(npr->databaseName) : 0); + return npr->databaseName; + } + else if (!strcmp (type, "syntax")) + { + const char *desc = 0; + if (npr->which == Z_NamePlusRecord_databaseRecord) + { + Z_External *r = (Z_External *) npr->u.databaseRecord; + oident *ent = oid_getentbyoid(r->direct_reference); + if (ent) + desc = ent->desc; + } + if (!desc) + desc = "none"; + if (len) + *len = strlen(desc); + return desc; + } + else if (!strcmp (type, "render") && + npr->which == Z_NamePlusRecord_databaseRecord) + { + Z_External *r = (Z_External *) npr->u.databaseRecord; + oident *ent = oid_getentbyoid(r->direct_reference); + + /* render bibliographic record .. */ + if (r->which == Z_External_OPAC) + { + r = r->u.opac->bibliographicRecord; + if (!r) + return 0; + ent = oid_getentbyoid(r->direct_reference); + } + if (r->which == Z_External_sutrs) + return record_iconv_return(rec, len, + r->u.sutrs->buf, r->u.sutrs->len, + charset); + else if (r->which == Z_External_octet) + { + yaz_marc_t mt; + switch (ent->value) + { + case VAL_SOIF: + case VAL_HTML: + case VAL_SUTRS: + break; + case VAL_TEXT_XML: + case VAL_APPLICATION_XML: + break; + default: + if (!rec->wrbuf_marc) + rec->wrbuf_marc = wrbuf_alloc(); + + mt = yaz_marc_create(); + wrbuf_rewind (rec->wrbuf_marc); + if (yaz_marc_decode_wrbuf ( + mt, (const char *) r->u.octet_aligned->buf, + r->u.octet_aligned->len, + rec->wrbuf_marc) > 0) + { + yaz_marc_destroy(mt); + return record_iconv_return(rec, len, + wrbuf_buf(rec->wrbuf_marc), + wrbuf_len(rec->wrbuf_marc), + charset); + } + yaz_marc_destroy(mt); + } + return record_iconv_return(rec, len, + (const char *) r->u.octet_aligned->buf, + r->u.octet_aligned->len, + charset); + } + else if (r->which == Z_External_grs1) + { + if (!rec->wrbuf_marc) + rec->wrbuf_marc = wrbuf_alloc(); + wrbuf_rewind (rec->wrbuf_marc); + yaz_display_grs1(rec->wrbuf_marc, r->u.grs1, 0); + return record_iconv_return(rec, len, + wrbuf_buf(rec->wrbuf_marc), + wrbuf_len(rec->wrbuf_marc), + charset); + } + return 0; + } + else if (npr->which == Z_NamePlusRecord_databaseRecord && + (!strcmp (type, "xml") || !strcmp(type, "oai"))) + { + Z_External *r = (Z_External *) npr->u.databaseRecord; + oident *ent = oid_getentbyoid(r->direct_reference); + + /* render bibliographic record .. */ + if (r->which == Z_External_OPAC) + { + r = r->u.opac->bibliographicRecord; + if (!r) + return 0; + ent = oid_getentbyoid(r->direct_reference); + } + + if (r->which == Z_External_sutrs) + return record_iconv_return(rec, len, + (const char *) r->u.sutrs->buf, + r->u.sutrs->len, + charset); + else if (r->which == Z_External_octet) + { + yaz_marc_t mt; + int marc_decode_type = YAZ_MARC_MARCXML; + + if (!strcmp(type, "oai")) + marc_decode_type = YAZ_MARC_OAIMARC; + switch (ent->value) + { + case VAL_SOIF: + case VAL_HTML: + case VAL_SUTRS: + break; + case VAL_TEXT_XML: + case VAL_APPLICATION_XML: + break; + default: + if (!rec->wrbuf_marc) + rec->wrbuf_marc = wrbuf_alloc(); + wrbuf_rewind (rec->wrbuf_marc); + mt = yaz_marc_create(); + + yaz_marc_xml(mt, YAZ_MARC_MARCXML); + if (yaz_marc_decode_wrbuf ( + mt, (const char *) r->u.octet_aligned->buf, + r->u.octet_aligned->len, + rec->wrbuf_marc) > 0) + { + yaz_marc_destroy(mt); + return record_iconv_return(rec, len, + wrbuf_buf(rec->wrbuf_marc), + wrbuf_len(rec->wrbuf_marc), + charset); + } + yaz_marc_destroy(mt); + } + return record_iconv_return(rec, len, + (const char *) r->u.octet_aligned->buf, + r->u.octet_aligned->len, + charset); + } + else if (r->which == Z_External_grs1) + { + if (len) *len = 5; + return "GRS-1"; + } + return 0; + } + else if (!strcmp (type, "raw")) + { + if (npr->which == Z_NamePlusRecord_databaseRecord) + { + Z_External *r = (Z_External *) npr->u.databaseRecord; + + if (r->which == Z_External_sutrs) + { + if (len) *len = r->u.sutrs->len; + return (const char *) r->u.sutrs->buf; + } + else if (r->which == Z_External_octet) + { + if (len) *len = r->u.octet_aligned->len; + return (const char *) r->u.octet_aligned->buf; + } + else /* grs-1, explain, OPAC, ... */ + { + if (len) *len = -1; + return (const char *) npr->u.databaseRecord; + } + } + return 0; + } + else if (!strcmp (type, "ext")) + { + if (npr->which == Z_NamePlusRecord_databaseRecord) + return (const char *) npr->u.databaseRecord; + return 0; + } + else if (npr->which == Z_NamePlusRecord_databaseRecord && + !strcmp (type, "opac")) + + { + Z_External *r = (Z_External *) npr->u.databaseRecord; + if (r->which == Z_External_OPAC) + { + if (!rec->wrbuf_opac) + rec->wrbuf_opac = wrbuf_alloc(); + wrbuf_rewind (rec->wrbuf_opac); + yaz_display_OPAC(rec->wrbuf_opac, r->u.opac, 0); + return record_iconv_return(rec, len, + wrbuf_buf(rec->wrbuf_opac), + wrbuf_len(rec->wrbuf_opac), + charset); + } + } + return 0; +} + +static int strcmp_null(const char *v1, const char *v2) +{ + if (!v1 && !v2) + return 0; + if (!v1 || !v2) + return -1; + return strcmp(v1, v2); +} + +static void record_cache_add (ZOOM_resultset r, Z_NamePlusRecord *npr, + int pos) +{ + ZOOM_record_cache rc; + const char *elementSetName = + ZOOM_resultset_option_get (r, "elementSetName"); + const char *syntax = + ZOOM_resultset_option_get (r, "preferredRecordSyntax"); + + ZOOM_Event event = ZOOM_Event_create(ZOOM_EVENT_RECV_RECORD); + ZOOM_connection_put_event(r->connection, event); + + for (rc = r->record_cache; rc; rc = rc->next) + { + if (pos == rc->pos) + { + if (strcmp_null(r->schema, rc->schema)) + continue; + if (strcmp_null(elementSetName,rc->elementSetName)) + continue; + if (strcmp_null(syntax, rc->syntax)) + continue; + /* not destroying rc->npr (it's handled by nmem )*/ + rc->rec.npr = npr; + /* keeping wrbuf_marc too */ + return; + } + } + rc = (ZOOM_record_cache) odr_malloc (r->odr, sizeof(*rc)); + rc->rec.npr = npr; + rc->rec.odr = 0; + rc->rec.wrbuf_marc = 0; + rc->rec.wrbuf_iconv = 0; + rc->rec.wrbuf_opac = 0; + if (elementSetName) + rc->elementSetName = odr_strdup (r->odr, elementSetName); + else + rc->elementSetName = 0; + + if (syntax) + rc->syntax = odr_strdup (r->odr, syntax); + else + rc->syntax = 0; + + if (r->schema) + rc->schema = odr_strdup (r->odr, r->schema); + else + rc->schema = 0; + + rc->pos = pos; + rc->next = r->record_cache; + r->record_cache = rc; +} + +static ZOOM_record record_cache_lookup (ZOOM_resultset r, int pos) +{ + ZOOM_record_cache rc; + const char *elementSetName = + ZOOM_resultset_option_get (r, "elementSetName"); + const char *syntax = + ZOOM_resultset_option_get (r, "preferredRecordSyntax"); + + for (rc = r->record_cache; rc; rc = rc->next) + { + if (pos == rc->pos) + { + if (strcmp_null(r->schema, rc->schema)) + continue; + if (strcmp_null(elementSetName,rc->elementSetName)) + continue; + if (strcmp_null(syntax, rc->syntax)) + continue; + return &rc->rec; + } + } + return 0; +} + +static void handle_records (ZOOM_connection c, Z_Records *sr, + int present_phase) +{ + ZOOM_resultset resultset; + + if (!c->tasks) + return ; + switch (c->tasks->which) + { + case ZOOM_TASK_SEARCH: + resultset = c->tasks->u.search.resultset; + break; + case ZOOM_TASK_RETRIEVE: + resultset = c->tasks->u.retrieve.resultset; + break; + default: + return; + } + if (sr && sr->which == Z_Records_NSD) + { + Z_DiagRec dr, *dr_p = &dr; + dr.which = Z_DiagRec_defaultFormat; + dr.u.defaultFormat = sr->u.nonSurrogateDiagnostic; + + response_diag (c, dr_p); + } + else if (sr && sr->which == Z_Records_multipleNSD) + { + if (sr->u.multipleNonSurDiagnostics->num_diagRecs >= 1) + response_diag(c, sr->u.multipleNonSurDiagnostics->diagRecs[0]); + else + set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); + } + else + { + if (resultset->count + resultset->start > resultset->size) + resultset->count = resultset->size - resultset->start; + if (resultset->count < 0) + resultset->count = 0; + if (sr && sr->which == Z_Records_DBOSD) + { + int i; + NMEM nmem = odr_extract_mem (c->odr_in); + Z_NamePlusRecordList *p = + sr->u.databaseOrSurDiagnostics; + for (i = 0; inum_records; i++) + { + record_cache_add (resultset, p->records[i], + i+ resultset->start); + } + /* transfer our response to search_nmem .. we need it later */ + nmem_transfer (resultset->odr->mem, nmem); + nmem_destroy (nmem); + if (present_phase && p->num_records == 0) + { + /* present response and we didn't get any records! */ + set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); + } + } + else if (present_phase) + { + /* present response and we didn't get any records! */ + set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); + } + } +} + +static void handle_present_response (ZOOM_connection c, Z_PresentResponse *pr) +{ + handle_records (c, pr->records, 1); +} + +static void handle_search_response (ZOOM_connection c, Z_SearchResponse *sr) +{ + ZOOM_resultset resultset; + ZOOM_Event event; + + yaz_log (LOG_DEBUG, "got search response"); + + if (!c->tasks || c->tasks->which != ZOOM_TASK_SEARCH) + return ; + + event = ZOOM_Event_create(ZOOM_EVENT_RECV_SEARCH); + ZOOM_connection_put_event(c, event); + + resultset = c->tasks->u.search.resultset; + + resultset->size = *sr->resultCount; + handle_records (c, sr->records, 0); +} + +static void sort_response (ZOOM_connection c, Z_SortResponse *res) +{ + if (res->diagnostics && res->num_diagnostics > 0) + response_diag (c, res->diagnostics[0]); +} + +static int scan_response (ZOOM_connection c, Z_ScanResponse *res) +{ + NMEM nmem = odr_extract_mem (c->odr_in); + ZOOM_scanset scan; + + if (!c->tasks || c->tasks->which != ZOOM_TASK_SCAN) + return 0; + scan = c->tasks->u.scan.scan; + + if (res->entries && res->entries->nonsurrogateDiagnostics) + response_diag(c, res->entries->nonsurrogateDiagnostics[0]); + scan->scan_response = res; + nmem_transfer (scan->odr->mem, nmem); + if (res->stepSize) + ZOOM_options_set_int (scan->options, "stepSize", *res->stepSize); + if (res->positionOfTerm) + ZOOM_options_set_int (scan->options, "position", *res->positionOfTerm); + if (res->scanStatus) + ZOOM_options_set_int (scan->options, "scanStatus", *res->scanStatus); + if (res->numberOfEntriesReturned) + ZOOM_options_set_int (scan->options, "number", + *res->numberOfEntriesReturned); + nmem_destroy (nmem); + return 1; +} + +static zoom_ret send_sort (ZOOM_connection c) +{ + ZOOM_resultset resultset; + + if (!c->tasks || c->tasks->which != ZOOM_TASK_SEARCH) + return zoom_complete; + + resultset = c->tasks->u.search.resultset; + + if (c->error) + { + resultset->r_sort_spec = 0; + return zoom_complete; + } + if (resultset->r_sort_spec) + { + Z_APDU *apdu = zget_APDU(c->odr_out, Z_APDU_sortRequest); + Z_SortRequest *req = apdu->u.sortRequest; + + req->num_inputResultSetNames = 1; + req->inputResultSetNames = (Z_InternationalString **) + odr_malloc (c->odr_out, sizeof(*req->inputResultSetNames)); + req->inputResultSetNames[0] = + odr_strdup (c->odr_out, resultset->setname); + req->sortedResultSetName = odr_strdup (c->odr_out, resultset->setname); + req->sortSequence = resultset->r_sort_spec; + resultset->r_sort_spec = 0; + return send_APDU (c, apdu); + } + return zoom_complete; +} + +static zoom_ret send_present (ZOOM_connection c) +{ + Z_APDU *apdu = 0; + Z_PresentRequest *req = 0; + int i = 0; + const char *syntax = 0; + const char *elementSetName = 0; + ZOOM_resultset resultset; + + if (!c->tasks) + return zoom_complete; + + switch (c->tasks->which) + { + case ZOOM_TASK_SEARCH: + resultset = c->tasks->u.search.resultset; + break; + case ZOOM_TASK_RETRIEVE: + resultset = c->tasks->u.retrieve.resultset; + resultset->start = c->tasks->u.retrieve.start; + resultset->count = c->tasks->u.retrieve.count; + + if (resultset->start >= resultset->size) + return zoom_complete; + if (resultset->start + resultset->count > resultset->size) + resultset->count = resultset->size - resultset->start; + break; + default: + return zoom_complete; + } + + syntax = ZOOM_resultset_option_get (resultset, "preferredRecordSyntax"); + elementSetName = ZOOM_resultset_option_get (resultset, "elementSetName"); + + if (c->error) /* don't continue on error */ + return zoom_complete; + if (resultset->start < 0) + return zoom_complete; + for (i = 0; icount; i++) + { + ZOOM_record rec = + record_cache_lookup (resultset, i + resultset->start); + if (!rec) + break; + } + if (i == resultset->count) + return zoom_complete; + + apdu = zget_APDU(c->odr_out, Z_APDU_presentRequest); + req = apdu->u.presentRequest; + + resultset->start += i; + resultset->count -= i; + *req->resultSetStartPoint = resultset->start + 1; + *req->numberOfRecordsRequested = resultset->step>0 ? + resultset->step : resultset->count; + assert (*req->numberOfRecordsRequested > 0); + + if (syntax && *syntax) + req->preferredRecordSyntax = + yaz_str_to_z3950oid (c->odr_out, CLASS_RECSYN, syntax); + + if (resultset->schema && *resultset->schema) + { + Z_RecordComposition *compo = (Z_RecordComposition *) + odr_malloc (c->odr_out, sizeof(*compo)); + + req->recordComposition = compo; + compo->which = Z_RecordComp_complex; + compo->u.complex = (Z_CompSpec *) + odr_malloc(c->odr_out, sizeof(*compo->u.complex)); + compo->u.complex->selectAlternativeSyntax = (bool_t *) + odr_malloc(c->odr_out, sizeof(bool_t)); + *compo->u.complex->selectAlternativeSyntax = 0; + + compo->u.complex->generic = (Z_Specification *) + odr_malloc(c->odr_out, sizeof(*compo->u.complex->generic)); + + compo->u.complex->generic->which = Z_Schema_oid; + compo->u.complex->generic->schema.oid = (Odr_oid *) + yaz_str_to_z3950oid (c->odr_out, CLASS_SCHEMA, resultset->schema); + + if (!compo->u.complex->generic->schema.oid) + { + /* OID wasn't a schema! Try record syntax instead. */ + + compo->u.complex->generic->schema.oid = (Odr_oid *) + yaz_str_to_z3950oid (c->odr_out, CLASS_RECSYN, resultset->schema); + } + if (elementSetName && *elementSetName) + { + compo->u.complex->generic->elementSpec = (Z_ElementSpec *) + odr_malloc(c->odr_out, sizeof(Z_ElementSpec)); + compo->u.complex->generic->elementSpec->which = + Z_ElementSpec_elementSetName; + compo->u.complex->generic->elementSpec->u.elementSetName = + odr_strdup (c->odr_out, elementSetName); + } + else + compo->u.complex->generic->elementSpec = 0; + compo->u.complex->num_dbSpecific = 0; + compo->u.complex->dbSpecific = 0; + compo->u.complex->num_recordSyntax = 0; + compo->u.complex->recordSyntax = 0; + } + else if (elementSetName && *elementSetName) + { + Z_ElementSetNames *esn = (Z_ElementSetNames *) + odr_malloc (c->odr_out, sizeof(*esn)); + Z_RecordComposition *compo = (Z_RecordComposition *) + odr_malloc (c->odr_out, sizeof(*compo)); + + esn->which = Z_ElementSetNames_generic; + esn->u.generic = odr_strdup (c->odr_out, elementSetName); + compo->which = Z_RecordComp_simple; + compo->u.simple = esn; + req->recordComposition = compo; + } + req->resultSetId = odr_strdup(c->odr_out, resultset->setname); + return send_APDU (c, apdu); +} + +ZOOM_API(ZOOM_scanset) +ZOOM_connection_scan (ZOOM_connection c, const char *start) +{ + ZOOM_scanset scan = (ZOOM_scanset) xmalloc (sizeof(*scan)); + + scan->connection = c; + scan->odr = odr_createmem (ODR_DECODE); + scan->options = ZOOM_options_create_with_parent (c->options); + scan->refcount = 1; + scan->scan_response = 0; + + if ((scan->termListAndStartPoint = + p_query_scan(scan->odr, PROTO_Z3950, &scan->attributeSet, + start))) + { + ZOOM_task task = ZOOM_connection_add_task (c, ZOOM_TASK_SCAN); + task->u.scan.scan = scan; + + (scan->refcount)++; + if (!c->async) + { + while (ZOOM_event (1, &c)) + ; + } + } + return scan; +} + +ZOOM_API(void) +ZOOM_scanset_destroy (ZOOM_scanset scan) +{ + if (!scan) + return; + (scan->refcount)--; + if (scan->refcount == 0) + { + odr_destroy (scan->odr); + + ZOOM_options_destroy (scan->options); + xfree (scan); + } +} + +static zoom_ret send_package (ZOOM_connection c) +{ + ZOOM_Event event; + if (!c->tasks) + return zoom_complete; + assert (c->tasks->which == ZOOM_TASK_PACKAGE); + + event = ZOOM_Event_create (ZOOM_EVENT_SEND_APDU); + ZOOM_connection_put_event (c, event); + + return do_write_ex (c, c->tasks->u.package->buf_out, + c->tasks->u.package->len_out); +} + +static zoom_ret send_scan (ZOOM_connection c) +{ + ZOOM_scanset scan; + Z_APDU *apdu = zget_APDU(c->odr_out, Z_APDU_scanRequest); + Z_ScanRequest *req = apdu->u.scanRequest; + if (!c->tasks) + return zoom_complete; + assert (c->tasks->which == ZOOM_TASK_SCAN); + scan = c->tasks->u.scan.scan; + + req->termListAndStartPoint = scan->termListAndStartPoint; + req->attributeSet = scan->attributeSet; + + *req->numberOfTermsRequested = + ZOOM_options_get_int(scan->options, "number", 10); + + req->preferredPositionInResponse = + odr_intdup (c->odr_out, + ZOOM_options_get_int(scan->options, "position", 1)); + + req->stepSize = + odr_intdup (c->odr_out, + ZOOM_options_get_int(scan->options, "stepSize", 0)); + + req->databaseNames = set_DatabaseNames (c, scan->options, + &req->num_databaseNames); + + return send_APDU (c, apdu); +} + +ZOOM_API(size_t) +ZOOM_scanset_size (ZOOM_scanset scan) +{ + if (!scan || !scan->scan_response || !scan->scan_response->entries) + return 0; + return scan->scan_response->entries->num_entries; +} + +ZOOM_API(const char *) +ZOOM_scanset_term (ZOOM_scanset scan, size_t pos, + int *occ, int *len) +{ + const char *term = 0; + size_t noent = ZOOM_scanset_size (scan); + Z_ScanResponse *res = scan->scan_response; + + *len = 0; + *occ = 0; + if (pos >= noent) + return 0; + if (res->entries->entries[pos]->which == Z_Entry_termInfo) + { + Z_TermInfo *t = res->entries->entries[pos]->u.termInfo; + + if (t->term->which == Z_Term_general) + { + term = (const char *) t->term->u.general->buf; + *len = t->term->u.general->len; + } + *occ = t->globalOccurrences ? *t->globalOccurrences : 0; + } + return term; +} + +ZOOM_API(const char *) +ZOOM_scanset_option_get (ZOOM_scanset scan, const char *key) +{ + return ZOOM_options_get (scan->options, key); +} + +ZOOM_API(void) +ZOOM_scanset_option_set (ZOOM_scanset scan, const char *key, + const char *val) +{ + ZOOM_options_set (scan->options, key, val); +} + +static Z_APDU *create_es_package (ZOOM_package p, int type) +{ + const char *str; + Z_APDU *apdu = zget_APDU(p->odr_out, Z_APDU_extendedServicesRequest); + Z_ExtendedServicesRequest *req = apdu->u.extendedServicesRequest; + + *req->function = Z_ExtendedServicesRequest_create; + + str = ZOOM_options_get(p->options, "package-name"); + if (str && *str) + req->packageName = nmem_strdup (p->odr_out->mem, str); + + str = ZOOM_options_get(p->options, "user-id"); + if (str) + req->userId = nmem_strdup (p->odr_out->mem, str); + + req->packageType = yaz_oidval_to_z3950oid(p->odr_out, CLASS_EXTSERV, + type); + + str = ZOOM_options_get(p->options, "function"); + if (str) + { + if (!strcmp (str, "create")) + *req->function = 1; + if (!strcmp (str, "delete")) + *req->function = 2; + if (!strcmp (str, "modify")) + *req->function = 3; + } + return apdu; +} + +static const char *ill_array_lookup (void *clientData, const char *idx) +{ + ZOOM_package p = (ZOOM_package) clientData; + return ZOOM_options_get (p->options, idx+4); +} + +static Z_External *encode_ill_request (ZOOM_package p) +{ + ODR out = p->odr_out; + ILL_Request *req; + Z_External *r = 0; + struct ill_get_ctl ctl; + + ctl.odr = p->odr_out; + ctl.clientData = p; + ctl.f = ill_array_lookup; + + req = ill_get_ILLRequest(&ctl, "ill", 0); + + if (!ill_Request (out, &req, 0, 0)) + { + int ill_request_size; + char *ill_request_buf = odr_getbuf (out, &ill_request_size, 0); + if (ill_request_buf) + odr_setbuf (out, ill_request_buf, ill_request_size, 1); + return 0; + } + else + { + oident oid; + int illRequest_size = 0; + char *illRequest_buf = odr_getbuf (out, &illRequest_size, 0); + + oid.proto = PROTO_GENERAL; + oid.oclass = CLASS_GENERAL; + oid.value = VAL_ISO_ILL_1; + + r = (Z_External *) odr_malloc (out, sizeof(*r)); + r->direct_reference = odr_oiddup(out,oid_getoidbyent(&oid)); + r->indirect_reference = 0; + r->descriptor = 0; + r->which = Z_External_single; + + r->u.single_ASN1_type = (Odr_oct *) + odr_malloc (out, sizeof(*r->u.single_ASN1_type)); + r->u.single_ASN1_type->buf = (unsigned char*) + odr_malloc (out, illRequest_size); + r->u.single_ASN1_type->len = illRequest_size; + r->u.single_ASN1_type->size = illRequest_size; + memcpy (r->u.single_ASN1_type->buf, illRequest_buf, illRequest_size); + } + return r; +} + +static Z_ItemOrder *encode_item_order(ZOOM_package p) +{ + Z_ItemOrder *req = (Z_ItemOrder *) odr_malloc (p->odr_out, sizeof(*req)); + const char *str; + + req->which=Z_IOItemOrder_esRequest; + req->u.esRequest = (Z_IORequest *) + odr_malloc(p->odr_out,sizeof(Z_IORequest)); + + /* to keep part ... */ + req->u.esRequest->toKeep = (Z_IOOriginPartToKeep *) + odr_malloc(p->odr_out,sizeof(Z_IOOriginPartToKeep)); + req->u.esRequest->toKeep->supplDescription = 0; + req->u.esRequest->toKeep->contact = (Z_IOContact *) + odr_malloc (p->odr_out, sizeof(*req->u.esRequest->toKeep->contact)); + + str = ZOOM_options_get(p->options, "contact-name"); + req->u.esRequest->toKeep->contact->name = str ? + nmem_strdup (p->odr_out->mem, str) : 0; + + str = ZOOM_options_get(p->options, "contact-phone"); + req->u.esRequest->toKeep->contact->phone = str ? + nmem_strdup (p->odr_out->mem, str) : 0; + + str = ZOOM_options_get(p->options, "contact-email"); + req->u.esRequest->toKeep->contact->email = str ? + nmem_strdup (p->odr_out->mem, str) : 0; + + req->u.esRequest->toKeep->addlBilling = 0; + + /* not to keep part ... */ + req->u.esRequest->notToKeep = (Z_IOOriginPartNotToKeep *) + odr_malloc(p->odr_out,sizeof(Z_IOOriginPartNotToKeep)); + + str = ZOOM_options_get(p->options, "itemorder-setname"); + if (!str) + str = "default"; + + if (!*str) + req->u.esRequest->notToKeep->resultSetItem = 0; + else + { + req->u.esRequest->notToKeep->resultSetItem = (Z_IOResultSetItem *) + odr_malloc(p->odr_out, sizeof(Z_IOResultSetItem)); + + req->u.esRequest->notToKeep->resultSetItem->resultSetId = + nmem_strdup (p->odr_out->mem, str); + req->u.esRequest->notToKeep->resultSetItem->item = + (int *) odr_malloc(p->odr_out, sizeof(int)); + + str = ZOOM_options_get(p->options, "itemorder-item"); + *req->u.esRequest->notToKeep->resultSetItem->item = + (str ? atoi(str) : 1); + } + req->u.esRequest->notToKeep->itemRequest = encode_ill_request(p); + + return req; +} + +ZOOM_API(void) + ZOOM_package_send (ZOOM_package p, const char *type) +{ + Z_APDU *apdu = 0; + ZOOM_connection c; + if (!p) + return; + c = p->connection; + odr_reset (p->odr_out); + xfree (p->buf_out); + p->buf_out = 0; + if (!strcmp(type, "itemorder")) + { + Z_External *r; + apdu = create_es_package (p, VAL_ITEMORDER); + if (apdu) + { + r = (Z_External *) odr_malloc (p->odr_out, sizeof(*r)); + + r->direct_reference = + yaz_oidval_to_z3950oid(p->odr_out, CLASS_EXTSERV, + VAL_ITEMORDER); + r->descriptor = 0; + r->which = Z_External_itemOrder; + r->indirect_reference = 0; + r->u.itemOrder = encode_item_order (p); + + apdu->u.extendedServicesRequest->taskSpecificParameters = r; + } + } + if (apdu) + { + if (encode_APDU(p->connection, apdu, p->odr_out) == 0) + { + char *buf; + + ZOOM_task task = ZOOM_connection_add_task (c, ZOOM_TASK_PACKAGE); + task->u.package = p; + buf = odr_getbuf(p->odr_out, &p->len_out, 0); + p->buf_out = (char *) xmalloc (p->len_out); + memcpy (p->buf_out, buf, p->len_out); + + (p->refcount)++; + if (!c->async) + { + while (ZOOM_event (1, &c)) + ; + } + } + } +} + +ZOOM_API(ZOOM_package) + ZOOM_connection_package (ZOOM_connection c, ZOOM_options options) +{ + ZOOM_package p = (ZOOM_package) xmalloc (sizeof(*p)); + + p->connection = c; + p->odr_out = odr_createmem (ODR_ENCODE); + p->options = ZOOM_options_create_with_parent2 (options, c->options); + p->refcount = 1; + p->buf_out = 0; + p->len_out = 0; + return p; +} + +ZOOM_API(void) + ZOOM_package_destroy(ZOOM_package p) +{ + if (!p) + return; + (p->refcount)--; + if (p->refcount == 0) + { + odr_destroy (p->odr_out); + xfree (p->buf_out); + + ZOOM_options_destroy (p->options); + xfree (p); + } +} + +ZOOM_API(const char *) +ZOOM_package_option_get (ZOOM_package p, const char *key) +{ + return ZOOM_options_get (p->options, key); +} + + +ZOOM_API(void) +ZOOM_package_option_set (ZOOM_package p, const char *key, + const char *val) +{ + ZOOM_options_set (p->options, key, val); +} + +static int ZOOM_connection_exec_task (ZOOM_connection c) +{ + ZOOM_task task = c->tasks; + zoom_ret ret = zoom_complete; + + if (!task) + { + yaz_log (LOG_DEBUG, "ZOOM_connection_exec_task task="); + return 0; + } + yaz_log (LOG_DEBUG, "ZOOM_connection_exec_task type=%d run=%d", + task->which, task->running); + if (c->error != ZOOM_ERROR_NONE) + { + yaz_log (LOG_DEBUG, "remove tasks because of error = %d", c->error); + ZOOM_connection_remove_tasks (c); + return 0; + } + if (task->running) + { + yaz_log (LOG_DEBUG, "task already running"); + return 0; + } + task->running = 1; + ret = zoom_complete; + if (c->cs || task->which == ZOOM_TASK_CONNECT) + { + switch (task->which) + { + case ZOOM_TASK_SEARCH: + if (c->proto == PROTO_HTTP) + ret = ZOOM_connection_srw_send_search(c); + else + ret = ZOOM_connection_send_search(c); + break; + case ZOOM_TASK_RETRIEVE: + if (c->proto == PROTO_HTTP) + ret = ZOOM_connection_srw_send_search(c); + else + ret = send_present (c); + break; + case ZOOM_TASK_CONNECT: + ret = do_connect(c); + break; + case ZOOM_TASK_SCAN: + ret = send_scan(c); + break; + case ZOOM_TASK_PACKAGE: + ret = send_package(c); + break; + } + } + else + { + yaz_log (LOG_DEBUG, "remove tasks because no connection exist"); + ZOOM_connection_remove_tasks (c); + } + if (ret == zoom_complete) + { + yaz_log (LOG_DEBUG, "task removed (complete)"); + ZOOM_connection_remove_task (c); + return 0; + } + yaz_log (LOG_DEBUG, "task pending"); + return 1; +} + +static zoom_ret send_sort_present (ZOOM_connection c) +{ + zoom_ret r = send_sort (c); + if (r == zoom_complete) + r = send_present (c); + return r; +} + +static int es_response (ZOOM_connection c, + Z_ExtendedServicesResponse *res) +{ + if (!c->tasks || c->tasks->which != ZOOM_TASK_PACKAGE) + return 0; + if (res->diagnostics && res->num_diagnostics > 0) + response_diag(c, res->diagnostics[0]); + if (res->taskPackage && + res->taskPackage->which == Z_External_extendedService) + { + Z_TaskPackage *taskPackage = res->taskPackage->u.extendedService; + Odr_oct *id = taskPackage->targetReference; + + if (id) + ZOOM_options_setl (c->tasks->u.package->options, + "targetReference", (char*) id->buf, id->len); + } + return 1; +} + + +static void handle_apdu (ZOOM_connection c, Z_APDU *apdu) +{ + Z_InitResponse *initrs; + + c->mask = 0; + yaz_log (LOG_DEBUG, "recv APDU type=%d", apdu->which); + switch(apdu->which) + { + case Z_APDU_initResponse: + initrs = apdu->u.initResponse; + ZOOM_connection_option_set(c, "targetImplementationId", + initrs->implementationId ? + initrs->implementationId : ""); + ZOOM_connection_option_set(c, "targetImplementationName", + initrs->implementationName ? + initrs->implementationName : ""); + ZOOM_connection_option_set(c, "targetImplementationVersion", + initrs->implementationVersion ? + initrs->implementationVersion : ""); + if (!*initrs->result) + { + set_ZOOM_error(c, ZOOM_ERROR_INIT, 0); + } + else + { + char *cookie = + yaz_oi_get_string_oidval (&apdu->u.initResponse->otherInfo, + VAL_COOKIE, 1, 0); + xfree (c->cookie_in); + c->cookie_in = 0; + if (cookie) + c->cookie_in = xstrdup(cookie); + if (ODR_MASK_GET(initrs->options, Z_Options_namedResultSets) && + ODR_MASK_GET(initrs->protocolVersion, Z_ProtocolVersion_3)) + c->support_named_resultsets = 1; + if (c->tasks) + { + assert (c->tasks->which == ZOOM_TASK_CONNECT); + ZOOM_connection_remove_task (c); + } + ZOOM_connection_exec_task (c); + } + if (ODR_MASK_GET(initrs->options, Z_Options_negotiationModel)) + { + NMEM tmpmem = nmem_create(); + Z_CharSetandLanguageNegotiation *p = + yaz_get_charneg_record(initrs->otherInfo); + + if (p) + { + char *charset=NULL, *lang=NULL; + int sel; + + yaz_get_response_charneg(tmpmem, p, &charset, &lang, &sel); + yaz_log(LOG_DEBUG, "Target accepted: charset %s, " + "language %s, select %d", + charset ? charset : "none", lang ? lang : "none", sel); + if (charset) + ZOOM_connection_option_set (c, "negotiation-charset", + charset); + if (lang) + ZOOM_connection_option_set (c, "negotiation-lang", + lang); + nmem_destroy(tmpmem); + } + } + break; + case Z_APDU_searchResponse: + handle_search_response (c, apdu->u.searchResponse); + if (send_sort_present (c) == zoom_complete) + ZOOM_connection_remove_task (c); + break; + case Z_APDU_presentResponse: + handle_present_response (c, apdu->u.presentResponse); + if (send_present (c) == zoom_complete) + ZOOM_connection_remove_task (c); + break; + case Z_APDU_sortResponse: + sort_response (c, apdu->u.sortResponse); + if (send_present (c) == zoom_complete) + ZOOM_connection_remove_task (c); + break; + case Z_APDU_scanResponse: + scan_response (c, apdu->u.scanResponse); + ZOOM_connection_remove_task (c); + break; + case Z_APDU_extendedServicesResponse: + es_response (c, apdu->u.extendedServicesResponse); + ZOOM_connection_remove_task (c); + break; + case Z_APDU_close: + if (c->reconnect_ok) + { + do_close(c); + c->tasks->running = 0; + ZOOM_connection_insert_task (c, ZOOM_TASK_CONNECT); + } + else + { + set_ZOOM_error(c, ZOOM_ERROR_CONNECTION_LOST, 0); + do_close(c); + } + break; + default: + set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); + do_close(c); + } +} + +#if HAVE_XML2 +static void handle_srw_response(ZOOM_connection c, + Z_SRW_searchRetrieveResponse *res) +{ + ZOOM_resultset resultset = 0; + int i; + NMEM nmem; + ZOOM_Event event; + + if (!c->tasks) + return; + + if (c->tasks->which == ZOOM_TASK_SEARCH) + resultset = c->tasks->u.search.resultset; + else if (c->tasks->which == ZOOM_TASK_RETRIEVE) + resultset = c->tasks->u.retrieve.resultset; + else + return ; + + event = ZOOM_Event_create(ZOOM_EVENT_RECV_SEARCH); + ZOOM_connection_put_event(c, event); + + resultset->size = 0; + + yaz_log(LOG_DEBUG, "got SRW response OK"); + + if (res->numberOfRecords) + resultset->size = *res->numberOfRecords; + + for (i = 0; inum_records; i++) + { + int pos; + + Z_NamePlusRecord *npr = (Z_NamePlusRecord *) + odr_malloc(c->odr_in, sizeof(Z_NamePlusRecord)); + + if (res->records[i].recordPosition && + *res->records[i].recordPosition > 0) + pos = *res->records[i].recordPosition - 1; + else + pos = resultset->start + i; + + npr->databaseName = 0; + npr->which = Z_NamePlusRecord_databaseRecord; + npr->u.databaseRecord = (Z_External *) + odr_malloc(c->odr_in, sizeof(Z_External)); + npr->u.databaseRecord->descriptor = 0; + npr->u.databaseRecord->direct_reference = + yaz_oidval_to_z3950oid(c->odr_in, CLASS_RECSYN, VAL_TEXT_XML); + npr->u.databaseRecord->which = Z_External_octet; + npr->u.databaseRecord->u.octet_aligned = (Odr_oct *) + odr_malloc(c->odr_in, sizeof(Odr_oct)); + npr->u.databaseRecord->u.octet_aligned->buf = + res->records[i].recordData_buf; + npr->u.databaseRecord->u.octet_aligned->len = + npr->u.databaseRecord->u.octet_aligned->size = + res->records[i].recordData_len; + record_cache_add (resultset, npr, pos); + } + if (res->num_diagnostics > 0) + { + set_dset_error(c, *res->diagnostics[0].code, "SRW", + res->diagnostics[0].details, 0); + } + nmem = odr_extract_mem(c->odr_in); + nmem_transfer(resultset->odr->mem, nmem); + nmem_destroy(nmem); +} +#endif + +#if HAVE_XML2 +static void handle_http(ZOOM_connection c, Z_HTTP_Response *hres) +{ + int ret = -1; + const char *content_type = z_HTTP_header_lookup(hres->headers, + "Content-Type"); + const char *connection_head = z_HTTP_header_lookup(hres->headers, + "Connection"); + c->mask = 0; + yaz_log (LOG_DEBUG, "handle_http"); + + if (content_type && !yaz_strcmp_del("text/xml", content_type, "; ")) + { + Z_SOAP *soap_package = 0; + ODR o = odr_createmem(ODR_DECODE); + Z_SOAP_Handler soap_handlers[2] = { + {"http://www.loc.gov/zing/srw/v1.0/", 0, + (Z_SOAP_fun) yaz_srw_codec}, + {0, 0, 0} + }; + ret = z_soap_codec(o, &soap_package, + &hres->content_buf, &hres->content_len, + soap_handlers); + if (!ret && soap_package->which == Z_SOAP_generic && + soap_package->u.generic->no == 0) + { + Z_SRW_PDU *sr = soap_package->u.generic->p; + if (sr->which == Z_SRW_searchRetrieve_response) + handle_srw_response(c, sr->u.response); + else + ret = -1; + } + else if (!ret && (soap_package->which == Z_SOAP_fault + || soap_package->which == Z_SOAP_error)) + { + set_HTTP_error(c, hres->code, + soap_package->u.fault->fault_code, + soap_package->u.fault->fault_string); + } + else + ret = -1; + odr_destroy(o); + } + if (ret) + { + if (hres->code != 200) + set_HTTP_error(c, hres->code, 0, 0); + else + set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); + do_close (c); + } + ZOOM_connection_remove_task(c); + if (!strcmp(hres->version, "1.0")) + { + /* HTTP 1.0: only if Keep-Alive we stay alive.. */ + if (!connection_head || strcmp(connection_head, "Keep-Alive")) + do_close(c); + } + else + { + /* HTTP 1.1: only if no close we stay alive .. */ + if (connection_head && !strcmp(connection_head, "close")) + do_close(c); + } +} +#endif + +static int do_read (ZOOM_connection c) +{ + int r, more; + ZOOM_Event event; + + event = ZOOM_Event_create (ZOOM_EVENT_RECV_DATA); + ZOOM_connection_put_event (c, event); + + + r = cs_get (c->cs, &c->buf_in, &c->len_in); + more = cs_more(c->cs); + yaz_log (LOG_DEBUG, "do_read len=%d more=%d", r, more); + if (r == 1) + return 0; + if (r <= 0) + { + if (c->reconnect_ok) + { + do_close (c); + c->reconnect_ok = 0; + yaz_log (LOG_DEBUG, "reconnect read"); + c->tasks->running = 0; + ZOOM_connection_insert_task (c, ZOOM_TASK_CONNECT); + } + else + { + set_ZOOM_error(c, ZOOM_ERROR_CONNECTION_LOST, 0); + do_close (c); + } + } + else + { + Z_GDU *gdu; + ZOOM_Event event; + + odr_reset (c->odr_in); + odr_setbuf (c->odr_in, c->buf_in, r, 0); + event = ZOOM_Event_create (ZOOM_EVENT_RECV_APDU); + ZOOM_connection_put_event (c, event); + + if (!z_GDU (c->odr_in, &gdu, 0, 0)) + { + set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); + do_close (c); + } + else if (gdu->which == Z_GDU_Z3950) + handle_apdu (c, gdu->u.z3950); + else if (gdu->which == Z_GDU_HTTP_Response) + { +#if HAVE_XML2 + handle_http (c, gdu->u.HTTP_Response); +#else + set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); + do_close (c); +#endif + } + c->reconnect_ok = 0; + } + return 1; +} + +static zoom_ret do_write_ex (ZOOM_connection c, char *buf_out, int len_out) +{ + int r; + ZOOM_Event event; + + event = ZOOM_Event_create(ZOOM_EVENT_SEND_DATA); + ZOOM_connection_put_event (c, event); + + yaz_log (LOG_DEBUG, "do_write_ex len=%d", len_out); + if ((r=cs_put (c->cs, buf_out, len_out)) < 0) + { + if (c->reconnect_ok) + { + do_close (c); + c->reconnect_ok = 0; + yaz_log (LOG_DEBUG, "reconnect write"); + c->tasks->running = 0; + ZOOM_connection_insert_task (c, ZOOM_TASK_CONNECT); + return zoom_pending; + } + if (c->state == STATE_CONNECTING) + set_ZOOM_error(c, ZOOM_ERROR_CONNECT, 0); + else + set_ZOOM_error(c, ZOOM_ERROR_CONNECTION_LOST, 0); + do_close (c); + return zoom_complete; + } + else if (r == 1) + { + c->mask = ZOOM_SELECT_EXCEPT; + if (c->cs->io_pending & CS_WANT_WRITE) + c->mask += ZOOM_SELECT_WRITE; + if (c->cs->io_pending & CS_WANT_READ) + c->mask += ZOOM_SELECT_READ; + yaz_log (LOG_DEBUG, "do_write_ex 1 mask=%d", c->mask); + } + else + { + c->mask = ZOOM_SELECT_READ|ZOOM_SELECT_EXCEPT; + yaz_log (LOG_DEBUG, "do_write_ex 2 mask=%d", c->mask); + } + return zoom_pending; +} + +static zoom_ret do_write(ZOOM_connection c) +{ + return do_write_ex (c, c->buf_out, c->len_out); +} + + +ZOOM_API(const char *) +ZOOM_connection_option_get (ZOOM_connection c, const char *key) +{ + return ZOOM_options_get (c->options, key); +} + +ZOOM_API(void) +ZOOM_connection_option_set (ZOOM_connection c, const char *key, + const char *val) +{ + ZOOM_options_set (c->options, key, val); +} + +ZOOM_API(const char *) +ZOOM_resultset_option_get (ZOOM_resultset r, const char *key) +{ + return ZOOM_options_get (r->options, key); +} + +ZOOM_API(void) +ZOOM_resultset_option_set (ZOOM_resultset r, const char *key, + const char *val) +{ + ZOOM_options_set (r->options, key, val); +} + + +ZOOM_API(int) +ZOOM_connection_errcode (ZOOM_connection c) +{ + return ZOOM_connection_error (c, 0, 0); +} + +ZOOM_API(const char *) +ZOOM_connection_errmsg (ZOOM_connection c) +{ + const char *msg; + ZOOM_connection_error (c, &msg, 0); + return msg; +} + +ZOOM_API(const char *) +ZOOM_connection_addinfo (ZOOM_connection c) +{ + const char *addinfo; + ZOOM_connection_error (c, 0, &addinfo); + return addinfo; +} + +ZOOM_API(const char *) +ZOOM_diag_str (int error) +{ + switch (error) + { + case ZOOM_ERROR_NONE: + return "No error"; + case ZOOM_ERROR_CONNECT: + return "Connect failed"; + case ZOOM_ERROR_MEMORY: + return "Out of memory"; + case ZOOM_ERROR_ENCODE: + return "Encoding failed"; + case ZOOM_ERROR_DECODE: + return "Decoding failed"; + case ZOOM_ERROR_CONNECTION_LOST: + return "Connection lost"; + case ZOOM_ERROR_INIT: + return "Init rejected"; + case ZOOM_ERROR_INTERNAL: + return "Internal failure"; + case ZOOM_ERROR_TIMEOUT: + return "Timeout"; + case ZOOM_ERROR_UNSUPPORTED_PROTOCOL: + return "Unsupported protocol"; + case ZOOM_ERROR_UNSUPPORTED_QUERY: + return "Unsupported query type"; + default: + return diagbib1_str (error); + } +} + +ZOOM_API(int) +ZOOM_connection_error_x (ZOOM_connection c, const char **cp, + const char **addinfo, const char **diagset) +{ + int error = c->error; + if (cp) + { + if (!c->diagset || !strcmp(c->diagset, "ZOOM")) + *cp = ZOOM_diag_str(error); + else if (!strcmp(c->diagset, "HTTP")) + *cp = z_HTTP_errmsg(c->error); + else if (!strcmp(c->diagset, "Bib-1")) + *cp = ZOOM_diag_str(error); + else if (!strcmp(c->diagset, "SRW")) + *cp = yaz_diag_srw_str(c->error); + else + *cp = "Unknown error and diagnostic set"; + } + if (addinfo) + *addinfo = c->addinfo ? c->addinfo : ""; + if (diagset) + *diagset = c->diagset ? c->diagset : ""; + return c->error; +} + +ZOOM_API(int) +ZOOM_connection_error (ZOOM_connection c, const char **cp, + const char **addinfo) +{ + return ZOOM_connection_error_x(c, cp, addinfo, 0); +} + +static int ZOOM_connection_do_io(ZOOM_connection c, int mask) +{ + ZOOM_Event event = 0; + int r = cs_look(c->cs); + yaz_log (LOG_DEBUG, "ZOOM_connection_do_io c=%p mask=%d cs_look=%d", + c, mask, r); + + if (r == CS_NONE) + { + event = ZOOM_Event_create (ZOOM_EVENT_CONNECT); + set_ZOOM_error(c, ZOOM_ERROR_CONNECT, 0); + do_close (c); + ZOOM_connection_put_event (c, event); + } + else if (r == CS_CONNECT) + { + int ret; + event = ZOOM_Event_create (ZOOM_EVENT_CONNECT); + + ret = cs_rcvconnect (c->cs); + yaz_log (LOG_DEBUG, "cs_rcvconnect returned %d", ret); + if (ret == 1) + { + c->mask = ZOOM_SELECT_EXCEPT; + if (c->cs->io_pending & CS_WANT_WRITE) + c->mask += ZOOM_SELECT_WRITE; + if (c->cs->io_pending & CS_WANT_READ) + c->mask += ZOOM_SELECT_READ; + ZOOM_connection_put_event (c, event); + } + else if (ret == 0) + { + ZOOM_connection_put_event (c, event); + if (c->proto == PROTO_Z3950) + ZOOM_connection_send_init(c); + else + { + /* no init request for SRW .. */ + assert (c->tasks->which == ZOOM_TASK_CONNECT); + ZOOM_connection_remove_task (c); + c->mask = 0; + ZOOM_connection_exec_task (c); + } + c->state = STATE_ESTABLISHED; + } + else + { + set_ZOOM_error(c, ZOOM_ERROR_CONNECT, 0); + do_close (c); + ZOOM_connection_put_event (c, event); + } + } + else + { + if (mask & ZOOM_SELECT_READ) + do_read (c); + if (c->cs && (mask & ZOOM_SELECT_WRITE)) + do_write (c); + } + return 1; +} + +ZOOM_API(int) +ZOOM_connection_last_event(ZOOM_connection cs) +{ + if (!cs) + return ZOOM_EVENT_NONE; + return cs->last_event; +} + +ZOOM_API(int) +ZOOM_event (int no, ZOOM_connection *cs) +{ + int timeout = 5000; +#if HAVE_SYS_POLL_H + struct pollfd pollfds[1024]; + ZOOM_connection poll_cs[1024]; +#else + struct timeval tv; + fd_set input, output, except; +#endif + int i, r, nfds; + int max_fd = 0; + + for (i = 0; ioptions, "timeout", -1); + if (this_timeout != -1 && this_timeout < timeout) + timeout = this_timeout; +#if HAVE_SYS_POLL_H + if (mask) + { + short poll_events = 0; + + if (mask & ZOOM_SELECT_READ) + poll_events += POLLIN; + if (mask & ZOOM_SELECT_WRITE) + poll_events += POLLOUT; + if (mask & ZOOM_SELECT_EXCEPT) + poll_events += POLLERR; + pollfds[nfds].fd = fd; + pollfds[nfds].events = poll_events; + pollfds[nfds].revents = 0; + poll_cs[nfds] = c; + nfds++; + } +#else + if (mask & ZOOM_SELECT_READ) + { + FD_SET (fd, &input); + nfds++; + } + if (mask & ZOOM_SELECT_WRITE) + { + FD_SET (fd, &output); + nfds++; + } + if (mask & ZOOM_SELECT_EXCEPT) + { + FD_SET (fd, &except); + nfds++; + } +#endif + } + if (timeout >= 5000) + timeout = 30; + + if (!nfds) + return 0; + +#if HAVE_SYS_POLL_H + r = poll (pollfds, nfds, timeout * 1000); + for (i = 0; imask) + { + int mask = 0; + if (pollfds[i].revents & POLLIN) + mask += ZOOM_SELECT_READ; + if (pollfds[i].revents & POLLOUT) + mask += ZOOM_SELECT_WRITE; + if (pollfds[i].revents & POLLERR) + mask += ZOOM_SELECT_EXCEPT; + if (mask) + ZOOM_connection_do_io(c, mask); + } + else if (r == 0 && c->mask) + { + ZOOM_Event event = ZOOM_Event_create(ZOOM_EVENT_TIMEOUT); + /* timeout and this connection was waiting */ + set_ZOOM_error(c, ZOOM_ERROR_TIMEOUT, 0); + do_close (c); + ZOOM_connection_put_event(c, event); + } + } +#else + tv.tv_sec = timeout; + tv.tv_usec = 0; + yaz_log (LOG_DEBUG, "select start"); + r = select (max_fd+1, &input, &output, &except, &tv); + yaz_log (LOG_DEBUG, "select stop, returned r=%d", r); + for (i = 0; imask) + { + /* no timeout and real socket */ + if (FD_ISSET(fd, &input)) + mask += ZOOM_SELECT_READ; + if (FD_ISSET(fd, &output)) + mask += ZOOM_SELECT_WRITE; + if (FD_ISSET(fd, &except)) + mask += ZOOM_SELECT_EXCEPT; + if (mask) + ZOOM_connection_do_io(c, mask); + } + if (r == 0 && c->mask) + { + ZOOM_Event event = ZOOM_Event_create(ZOOM_EVENT_TIMEOUT); + /* timeout and this connection was waiting */ + set_ZOOM_error(c, ZOOM_ERROR_TIMEOUT, 0); + do_close (c); + yaz_log (LOG_DEBUG, "timeout"); + ZOOM_connection_put_event(c, event); + } + } +#endif + for (i = 0; i +#include "zoom-p.h" + +#include + +ZOOM_API(ZOOM_options) +ZOOM_options_create_with_parent (ZOOM_options parent) +{ + return ZOOM_options_create_with_parent2(parent, 0); +} + +ZOOM_API(ZOOM_options) +ZOOM_options_create (void) +{ + return ZOOM_options_create_with_parent (0); +} + + +ZOOM_API(ZOOM_options) +ZOOM_options_create_with_parent2 (ZOOM_options parent1, ZOOM_options parent2) +{ + ZOOM_options opt = (ZOOM_options) xmalloc (sizeof(*opt)); + + opt->refcount = 1; + opt->callback_func = 0; + opt->callback_handle = 0; + opt->entries = 0; + opt->parent1= parent1; + if (parent1) + (parent1->refcount)++; + opt->parent2= parent2; + if (parent2) + (parent2->refcount)++; + return opt; +} + + +void ZOOM_options_addref (ZOOM_options opt) +{ + (opt->refcount)++; +} + +ZOOM_API(ZOOM_options_callback) +ZOOM_options_set_callback ( + ZOOM_options opt, + ZOOM_options_callback callback_func, + void *callback_handle) +{ + ZOOM_options_callback callback_old; + + assert (opt); + callback_old = opt->callback_func; + opt->callback_func = callback_func; + opt->callback_handle = callback_handle; + return callback_old; +} + +ZOOM_API(void) +ZOOM_options_destroy (ZOOM_options opt) +{ + if (!opt) + return; + (opt->refcount)--; + if (opt->refcount == 0) + { + struct ZOOM_options_entry *e; + + ZOOM_options_destroy (opt->parent1); + ZOOM_options_destroy (opt->parent2); + e = opt->entries; + while (e) + { + struct ZOOM_options_entry *e0 = e; + xfree (e->name); + xfree (e->value); + e = e->next; + xfree (e0); + } + xfree (opt); + } +} + +ZOOM_API(void) +ZOOM_options_setl (ZOOM_options opt, const char *name, const char *value, + int len) +{ + struct ZOOM_options_entry **e; + + e = &opt->entries; + while (*e) + { + if (!strcmp((*e)->name, name)) + { + xfree ((*e)->value); + (*e)->value = 0; + if (value) + { + (*e)->value = (char *) xmalloc (len+1); + memcpy ((*e)->value, value, len); + (*e)->value[len] = '\0'; + } + return; + } + e = &(*e)->next; + } + *e = (struct ZOOM_options_entry *) xmalloc (sizeof(**e)); + (*e)->name = xstrdup (name); + (*e)->value = 0; + if (value) + { + (*e)->value = (char *) xmalloc (len+1); + memcpy ((*e)->value, value, len); + (*e)->value[len] = '\0'; + } + (*e)->next = 0; +} + +ZOOM_API(void) +ZOOM_options_set (ZOOM_options opt, const char *name, const char *value) +{ + ZOOM_options_setl (opt, name, value, value ? strlen(value): 0); +} + +ZOOM_API(const char *) +ZOOM_options_get (ZOOM_options opt, const char *name) +{ + const char *v = 0; + if (!opt) + return 0; + if (opt->callback_func) + v = (*opt->callback_func)(opt->callback_handle, name); + if (!v) + { + struct ZOOM_options_entry *e; + for (e = opt->entries; e; e = e->next) + if (!strcmp(e->name, name)) + { + v = e->value; + break; + } + } + if (!v) + v = ZOOM_options_get(opt->parent1, name); + if (!v) + v = ZOOM_options_get(opt->parent2, name); + return v; +} + +ZOOM_API(int) +ZOOM_options_get_bool (ZOOM_options opt, const char *name, int defa) +{ + const char *v = ZOOM_options_get (opt, name); + + if (!v) + return defa; + if (!strcmp (v, "1") || !strcmp(v, "T")) + return 1; + return 0; +} + +ZOOM_API(int) +ZOOM_options_get_int (ZOOM_options opt, const char *name, int defa) +{ + const char *v = ZOOM_options_get (opt, name); + + if (!v || !*v) + return defa; + return atoi(v); +} + +ZOOM_API(void) +ZOOM_options_set_int(ZOOM_options opt, const char *name, int value) +{ + char s[40]; + + sprintf (s, "%d", value); + ZOOM_options_set (opt, name, s); +} diff --git a/src/zoom-p.h b/src/zoom-p.h new file mode 100644 index 0000000..b9d8223 --- /dev/null +++ b/src/zoom-p.h @@ -0,0 +1,168 @@ +/* + * Private C header for ZOOM C. + * $Id: zoom-p.h,v 1.1 2003-10-27 12:21:36 adam Exp $ + */ + +#if HAVE_XSLT +#include +#endif + +#include +#include +#include +#include +#include +typedef struct ZOOM_Event_p *ZOOM_Event; + +struct ZOOM_query_p { + Z_Query *z_query; + Z_SortKeySpecList *sort_spec; + int refcount; + ODR odr; + char *query_string; +}; + +#define STATE_IDLE 0 +#define STATE_CONNECTING 1 +#define STATE_ESTABLISHED 2 + +#define ZOOM_SELECT_READ 1 +#define ZOOM_SELECT_WRITE 2 +#define ZOOM_SELECT_EXCEPT 4 + +struct ZOOM_connection_p { + enum oid_proto proto; + COMSTACK cs; + char *host_port; + char *path; + int error; + char *addinfo; + const char *diagset; + int state; + int mask; + int reconnect_ok; + ODR odr_in; + ODR odr_out; + char *buf_in; + int len_in; + char *buf_out; + int len_out; + char *proxy; + char *charset; + char *lang; + char *cookie_out; + char *cookie_in; + char *client_IP; + int async; + int support_named_resultsets; + int last_event; + ZOOM_task tasks; + ZOOM_options options; + ZOOM_resultset resultsets; + ZOOM_Event m_queue_front; + ZOOM_Event m_queue_back; +}; + +struct ZOOM_options_entry { + char *name; + char *value; + struct ZOOM_options_entry *next; +}; + +struct ZOOM_options_p { + int refcount; + void *callback_handle; + ZOOM_options_callback callback_func; + struct ZOOM_options_entry *entries; + ZOOM_options parent1; + ZOOM_options parent2; +}; + +typedef struct ZOOM_record_cache_p *ZOOM_record_cache; + +struct ZOOM_resultset_p { + Z_SortKeySpecList *r_sort_spec; + ZOOM_query query; + int refcount; + int size; + int start; + int count; + int step; + int piggyback; + char *setname; + char *schema; + ODR odr; + ZOOM_record_cache record_cache; + ZOOM_options options; + ZOOM_connection connection; + ZOOM_resultset next; +}; + +struct ZOOM_record_p { + ODR odr; + WRBUF wrbuf_marc; + WRBUF wrbuf_iconv; + WRBUF wrbuf_opac; + Z_NamePlusRecord *npr; +}; + +struct ZOOM_record_cache_p { + struct ZOOM_record_p rec; + char *elementSetName; + char *syntax; + char *schema; + int pos; + ZOOM_record_cache next; +}; + +struct ZOOM_scanset_p { + int refcount; + ODR odr; + ZOOM_options options; + ZOOM_connection connection; + Z_AttributesPlusTerm *termListAndStartPoint; + Z_AttributeSetId *attributeSet; + Z_ScanResponse *scan_response; +}; + +struct ZOOM_package_p { + int refcount; + ODR odr_out; + ZOOM_options options; + ZOOM_connection connection; + char *buf_out; + int len_out; +}; + +struct ZOOM_task_p { + int running; + int which; + union { +#define ZOOM_TASK_SEARCH 1 + struct { + ZOOM_resultset resultset; + } search; +#define ZOOM_TASK_RETRIEVE 2 + struct { + int start; + ZOOM_resultset resultset; + int count; + } retrieve; +#define ZOOM_TASK_CONNECT 3 +#define ZOOM_TASK_SCAN 4 + struct { + ZOOM_scanset scan; + } scan; +#define ZOOM_TASK_PACKAGE 5 + ZOOM_package package; + } u; + ZOOM_task next; +}; + +struct ZOOM_Event_p { + int kind; + ZOOM_Event next; + ZOOM_Event prev; +}; + +void ZOOM_options_addref (ZOOM_options opt); diff --git a/srw/.cvsignore b/srw/.cvsignore deleted file mode 100644 index 9db4dc3..0000000 --- a/srw/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -srw_* -*.lo -*.la diff --git a/srwapps/.cvsignore b/srwapps/.cvsignore deleted file mode 100644 index da7b481..0000000 --- a/srwapps/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.lo diff --git a/tab/.cvsignore b/tab/.cvsignore deleted file mode 100644 index 282522d..0000000 --- a/tab/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 0000000..02f7e07 --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,38 @@ +## Copyright (C) 1994-2003, Index Data +## All rights reserved. +## $Id: Makefile.am,v 1.1 2003-10-27 12:21:38 adam Exp $ + +check_PROGRAMS = tsticonv tstnmem tstmatchstr tstwrbuf tstodr tstccl + +TESTS = $(check_PROGRAMS) + +EXTRA_DIST = tstodr.asn tstodrcodec.c tstodrcodec.h + +YAZCOMP = $(top_srcdir)/util/yaz-asncomp +YAZCOMPLINE = $(YAZCOMP) -d z.tcl -i yaz -I../include $(YCFLAGS) + +AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) + +# Rule for generating codecs for our small ASN.1 spec +tstodrcodec.c tstodrcodec.h: tstodr.asn $(YAZCOMP) + cd $(srcdir); $(YAZCOMP) tstodr.asn + +# Tests.. +tsticonv_LDADD = ../src/libyaz.la +tsticonv_SOURCES = tsticonv.c + +tstnmem_LDADD = ../src/libyaz.la +tstnmem_SOURCES = tstnmem.c + +tstmatchstr_LDADD = ../src/libyaz.la +tstmatchstr_SOURCES = tstmatchstr.c + +tstwrbuf_LDADD = ../src/libyaz.la +tstwrbuf_SOURCES = tstwrbuf.c + +tstodr_LDADD = ../src/libyaz.la +tstodr_SOURCES = tstodrcodec.c tstodrcodec.h tstodr.c + +tstccl_LDADD = ../src/libyaz.la +tstccl_SOURCES = tstccl.c + diff --git a/test/tstccl.c b/test/tstccl.c new file mode 100644 index 0000000..2f1f897 --- /dev/null +++ b/test/tstccl.c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2002-2003, Index Data + * See the file LICENSE for details. + * + * $Id: tstccl.c,v 1.1 2003-10-27 12:21:38 adam Exp $ + */ + +/* CCL test */ + +#include + +struct ccl_tst { + char *query; + char *result; +}; + +static struct ccl_tst query_str[] = { + { "x1", "@attr 4=2 @attr 1=1016 x1 "}, + { "(((((x1)))))", "@attr 4=2 @attr 1=1016 x1 "}, + {"x1 and x2", "@and @attr 4=2 @attr 1=1016 x1 @attr 4=2 @attr 1=1016 x2 "}, + { "ti=x3", "@attr 4=2 @attr 1=4 x3 "}, + { "dc.title=x4", "@attr 1=/my/title x4 "}, + { "x1 and", 0}, + { "tix=x5", 0}, + {0, 0} +}; + +void tst1(void) +{ + CCL_parser parser = ccl_parser_create (); + CCL_bibset bibset = ccl_qual_mk(); + int i; + + ccl_qual_fitem(bibset, "u=4 s=pw t=l,r", "ti"); + ccl_qual_fitem(bibset, "1=1016 s=al,pw", "term"); + ccl_qual_fitem(bibset, "1=/my/title", "dc.title"); + + parser->bibset = bibset; + + for (i = 0; query_str[i].query; i++) + { + struct ccl_token *token_list = + ccl_parser_tokenize(parser, query_str[i].query); + struct ccl_rpn_node *rpn = ccl_parser_find(parser, token_list); + ccl_token_del (token_list); + if (rpn) + { + WRBUF wrbuf = wrbuf_alloc(); + ccl_pquery(wrbuf, rpn); + + if (!query_str[i].result) + { + printf ("Failed %s\n", query_str[i].query); + printf (" got:%s:\n", wrbuf_buf(wrbuf)); + printf (" expected failure\n"); + exit(3); + } + else if (strcmp(wrbuf_buf(wrbuf), query_str[i].result)) + { + printf ("Failed %s\n", query_str[i].query); + printf (" got:%s:\n", wrbuf_buf(wrbuf)); + printf (" expected:%s:\n", query_str[i].result); + exit(2); + } + ccl_rpn_delete(rpn); + wrbuf_free(wrbuf, 1); + } + else if (query_str[i].result) + { + printf ("Failed %s\n", query_str[i].query); + printf (" got failure\n"); + printf (" expected:%s:\n", query_str[i].result); + exit(4); + } + } + ccl_parser_destroy (parser); + ccl_qual_rm(&bibset); +} + +int main(int argc, char **argv) +{ + tst1(); + exit(0); +} diff --git a/test/tsticonv.c b/test/tsticonv.c new file mode 100644 index 0000000..6410e57 --- /dev/null +++ b/test/tsticonv.c @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2002-2003, Index Data + * See the file LICENSE for details. + * + * $Id: tsticonv.c,v 1.1 2003-10-27 12:21:38 adam Exp $ + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include + +/* some test strings in ISO-8859-1 format */ +const char *buf[] = { + "ax" , + "\330", + "eneb\346r", + "\xfc", + "\xfb", + "\xfbr", + 0 }; + +/* some test strings in MARC-8 format */ +const char *marc8_strings[] = { + "ax", + "\xa2", /* latin capital letter o with stroke */ + "eneb\xb5r", /* latin small letter ae */ + "\xe8\x75", /* latin small letter u with umlaut */ + "\xe3\x75", /* latin small letter u with circumflex */ + "\xe3\x75r", /* latin small letter u with circumflex */ + 0 +}; + +static void marc8_tst() +{ + int i; + yaz_iconv_t cd; + + cd = yaz_iconv_open("ISO-8859-1", "MARC8"); + for (i = 0; buf[i]; i++) + { + size_t r; + char *inbuf= (char*) marc8_strings[i]; + size_t inbytesleft = strlen(inbuf); + char outbuf0[24]; + char *outbuf = outbuf0; + size_t outbytesleft = sizeof(outbuf0); + + r = yaz_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + if (r == (size_t) (-1)) + { + int e = yaz_iconv_error(cd); + + printf ("tsticonv 6 i=%d e=%d\n", i, e); + exit(6); + } + if ((outbuf - outbuf0) != strlen(buf[i]) + || memcmp(outbuf0, buf[i], strlen(buf[i]))) + { + printf ("tsticonv 7 i=%d\n", i); + printf ("buf=%s out=%s\n", buf[i], outbuf0); + exit(7); + } + } + yaz_iconv_close(cd); +} + +static void dconvert(int mandatory, const char *tmpcode) +{ + int i; + yaz_iconv_t cd; + for (i = 0; buf[i]; i++) + { + size_t r; + char *inbuf = (char*) buf[i]; + size_t inbytesleft = strlen(inbuf); + char outbuf0[24]; + char outbuf1[10]; + char *outbuf = outbuf0; + size_t outbytesleft = sizeof(outbuf0); + + cd = yaz_iconv_open(tmpcode, "ISO-8859-1"); + if (!cd) + { + if (!mandatory) + return; + printf ("tsticonv 1\n"); + exit(1); + } + r = yaz_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + if (r == (size_t)(-1)) + { + int e = yaz_iconv_error(cd); + + printf ("tsticonv 2 e=%d\n", e); + exit(2); + } + yaz_iconv_close(cd); + + cd = yaz_iconv_open("ISO-8859-1", tmpcode); + if (!cd) + { + if (!mandatory) + return; + printf ("tsticonv 3\n"); + exit(3); + } + inbuf = outbuf0; + inbytesleft = sizeof(outbuf0) - outbytesleft; + + outbuf = outbuf1; + outbytesleft = sizeof(outbuf1); + r = yaz_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + if (r == (size_t)(-1)) { + int e = yaz_iconv_error(cd); + + printf ("tsticonv 4 e=%d\n", e); + exit(4); + } + if (strlen(buf[i]) == (sizeof(outbuf1) - outbytesleft) && + memcmp(outbuf1, buf[i], strlen(buf[i]))) + { + printf ("tsticonv 5\n"); + exit(5); + } + yaz_iconv_close(cd); + } +} + +int main (int argc, char **argv) +{ + dconvert(1, "UTF-8"); + dconvert(1, "ISO-8859-1"); + dconvert(1, "UCS4"); + dconvert(0, "CP865"); + marc8_tst(); + exit (0); +} diff --git a/test/tstmatchstr.c b/test/tstmatchstr.c new file mode 100644 index 0000000..6f5c14c --- /dev/null +++ b/test/tstmatchstr.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2002-2003, Index Data + * See the file LICENSE for details. + * + * $Id: tstmatchstr.c,v 1.1 2003-10-27 12:21:38 adam Exp $ + */ + +#include + +#include + +struct { + char *s1; + char *s2; + int res; +} comp_strings[] = { + { "x", "x", 0 }, + { "x", "X", 0 }, + { "a", "b", 1 }, + { "b", "a", 1 }, + { "aa","a", 1 }, + { "a-", "a", 1 }, + { "A-b", "ab", 0}, + { "A--b", "ab", 1}, + { "A--b", "a-b", 1}, + { "A--b", "a--b", 0}, + { "a123", "a?", 0}, + {"a123", "a1.3", 0}, + {"a123", "..?", 0}, + {"a123", "a1.", 1}, + {"a123", "a...", 0}, + {0, 0, 0} }; + +int main (int argc, char **argv) +{ + int i; + for (i = 0; comp_strings[i].s1; i++) + { + int got = yaz_matchstr(comp_strings[i].s1,comp_strings[i].s2); + if (got > 0) + got = 1; + else if (got < 0) + got = -1; + if (got != comp_strings[i].res) + { + printf ("tststr %d got=%d res=%d\n", i, + got, comp_strings[i].res); + exit(1); + } + } + exit(0); +} + diff --git a/test/tstnmem.c b/test/tstnmem.c new file mode 100644 index 0000000..284e0a8 --- /dev/null +++ b/test/tstnmem.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2002-2003, Index Data + * See the file LICENSE for details. + * + * $Id: tstnmem.c,v 1.1 2003-10-27 12:21:38 adam Exp $ + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include + +int main (int argc, char **argv) +{ + void *cp; + NMEM n; + int j; + + nmem_init(); + n = nmem_create(); + if (!n) + exit (1); + for (j = 1; j<500; j++) + { + cp = nmem_malloc(n, j); + if (!cp) + exit(2); + } + + for (j = 2000; j<20000; j+= 2000) + { + cp = nmem_malloc(n, j); + if (!cp) + exit(3); + } + nmem_destroy(n); + nmem_exit(); + exit(0); +} diff --git a/test/tstodr.asn b/test/tstodr.asn new file mode 100644 index 0000000..e61dd73 --- /dev/null +++ b/test/tstodr.asn @@ -0,0 +1,16 @@ +-- Small ASN.1 spec for tstodr test +-- $Id: tstodr.asn,v 1.1 2003-10-27 12:21:38 adam Exp $ +tstodrcodec +{tstodrcodec} DEFINITIONS ::= +BEGIN +MySequence ::= SEQUENCE { + first [1] IMPLICIT INTEGER, + second [2] IMPLICIT OCTET STRING, + third [3] IMPLICIT BOOLEAN, + fourth [4] IMPLICIT NULL, + fifth [5] IMPLICIT INTEGER { + enum1(0), + enum2(1) + } +} +END diff --git a/test/tstodr.c b/test/tstodr.c new file mode 100644 index 0000000..9561e11 --- /dev/null +++ b/test/tstodr.c @@ -0,0 +1,115 @@ +/* + * Copyright (c) 1995-2003, Index Data + * See the file LICENSE for details. + * + * $Id: tstodr.c,v 1.1 2003-10-27 12:21:38 adam Exp $ + * + */ +#include +#include +#include "tstodrcodec.h" + +void tst_MySequence1(ODR encode, ODR decode) +{ + char *ber_buf; + int ber_len; + Yc_MySequence *s = odr_malloc(encode, sizeof(*s)); + Yc_MySequence *t; + + s->first = odr_intdup(encode, 12345); + s->second = odr_malloc(encode, sizeof(*s->second)); + s->second->buf = "hello"; + s->second->len = 5; + s->second->size = 0; + s->third = odr_intdup(encode, 1); + s->fourth = odr_nullval(); + s->fifth = odr_intdup(encode, YC_MySequence_enum1); + + if (!yc_MySequence(encode, &s, 0, 0)) + exit(1); + + ber_buf = odr_getbuf(encode, &ber_len, 0); + + odr_setbuf(decode, ber_buf, ber_len, 0); + + if (!yc_MySequence(decode, &t, 0, 0)) + exit(2); + if (!t->first || *t->first != 12345) + exit(3); + if (!t->second || !t->second->buf || t->second->len != 5) + exit(4); + if (memcmp(t->second->buf, "hello", t->second->len)) + exit(5); + if (!t->third || *t->third != 1) + exit(6); + if (!t->fourth) + exit(7); + if (!t->fifth || *t->fifth != YC_MySequence_enum1) + exit(8); +} + +void tst_MySequence2(ODR encode, ODR decode) +{ + char *ber_buf; + int ber_len; + Yc_MySequence *s = odr_malloc(encode, sizeof(*s)); + Yc_MySequence *t; + + s->first = 0; /* deliberately miss this .. */ + s->second = odr_malloc(encode, sizeof(*s->second)); + s->second->buf = "hello"; + s->second->len = 5; + s->second->size = 0; + s->third = odr_intdup(encode, 1); + s->fourth = odr_nullval(); + s->fifth = odr_intdup(encode, YC_MySequence_enum1); + + if (yc_MySequence(encode, &s, 0, 0)) /* should fail */ + exit(9); + if (odr_geterror(encode) != OREQUIRED) + exit(10); + if (strcmp(odr_getelement(encode), "first")) + exit(11); + odr_reset(encode); + + if (odr_geterror(encode) != ONONE) + exit(12); + if (strcmp(odr_getelement(encode), "")) + exit(13); +} + +void tst_MySequence3(ODR encode, ODR decode) +{ + char buf[40]; + int i; + Yc_MySequence *t; + + srand(123); + for (i = 0; i<1000; i++) + { + int j; + for (j = 0; j + +#include + +int main (int argc, char **argv) +{ + int step; + WRBUF wr = wrbuf_alloc(); + + wrbuf_free(wr, 1); + + wr = wrbuf_alloc(); + + for (step = 1; step < 65; step++) + { + int i, j, k; + int len; + char buf[64]; + char *cp; + for (j = 1; j -#endif - -#include -#include -#include - -int atoi_n (const char *buf, int len) -{ - int val = 0; - - while (--len >= 0) - { - if (isdigit (*buf)) - val = val*10 + (*buf - '0'); - buf++; - } - return val; -} - diff --git a/util/cclsh.c b/util/cclsh.c new file mode 100644 index 0000000..25d7649 --- /dev/null +++ b/util/cclsh.c @@ -0,0 +1,228 @@ +/* + * Copyright (c) 1995, the EUROPAGATE consortium (see below). + * + * The EUROPAGATE consortium members are: + * + * University College Dublin + * Danmarks Teknologiske Videnscenter + * An Chomhairle Leabharlanna + * Consejo Superior de Investigaciones Cientificas + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation, in whole or in part, for any purpose, is hereby granted, + * provided that: + * + * 1. This copyright and permission notice appear in all copies of the + * software and its documentation. Notices of copyright or attribution + * which appear at the beginning of any file must remain unchanged. + * + * 2. The names of EUROPAGATE or the project partners may not be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * 3. Users of this software (implementors and gateway operators) agree to + * inform the EUROPAGATE consortium of their use of the software. This + * information will be used to evaluate the EUROPAGATE project and the + * software, and to plan further developments. The consortium may use + * the information in later publications. + * + * 4. Users of this software agree to make their best efforts, when + * documenting their use of the software, to acknowledge the EUROPAGATE + * consortium, and the role played by the software in their work. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * IN NO EVENT SHALL THE EUROPAGATE CONSORTIUM OR ITS MEMBERS BE LIABLE + * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF + * ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA + * OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND + * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* CCL shell. + * Europagate 1995 + * + * $Id: cclsh.c,v 1.1 2003-10-27 12:21:38 adam Exp $ + * + * Old Europagate Log: + * + * Revision 1.11 1995/05/16 09:39:27 adam + * LICENSE. + * + * Revision 1.10 1995/05/11 14:03:57 adam + * Changes in the reading of qualifier(s). New function: ccl_qual_fitem. + * New variable ccl_case_sensitive, which controls whether reserved + * words and field names are case sensitive or not. + * + * Revision 1.9 1995/02/23 08:32:00 adam + * Changed header. + * + * Revision 1.7 1995/02/15 17:42:16 adam + * Minor changes of the api of this module. FILE* argument added + * to ccl_pr_tree. + * + * Revision 1.6 1995/02/14 19:55:13 adam + * Header files ccl.h/cclp.h are gone! They have been merged an + * moved to ../include/ccl.h. + * Node kind(s) in ccl_rpn_node have changed names. + * + * Revision 1.5 1995/02/14 16:20:57 adam + * Qualifiers are read from a file now. + * + * Revision 1.4 1995/02/14 14:12:42 adam + * Ranges for ordered qualfiers implemented (e.g. pd=1980-1990). + * + * Revision 1.3 1995/02/14 10:25:57 adam + * The constructions 'qualifier rel term ...' implemented. + * + * Revision 1.2 1995/02/13 15:15:07 adam + * Added handling of qualifiers. Not finished yet. + * + * Revision 1.1 1995/02/13 12:35:21 adam + * First version of CCL. Qualifiers aren't handled yet. + */ + +#include +#include + +#include + + +#if HAVE_READLINE_READLINE_H +#include +#endif +#if HAVE_READLINE_HISTORY_H +#include +#endif + + +static int debug = 0; +static char *prog; + +void usage(const char *prog) +{ + fprintf (stderr, "%s: [-d] [-b configfile]\n", prog); + exit (1); +} + +int main (int argc, char **argv) +{ + CCL_bibset bibset; + FILE *bib_inf; + char *bib_fname; + + prog = *argv; + bibset = ccl_qual_mk (); + while (--argc > 0) + { + if (**++argv == '-') + { + switch (argv[0][1]) + { + case 'd': + debug = 1; + break; + case 'b': + if (argv[0][2]) + bib_fname = argv[0]+2; + else if (argc > 0) + { + --argc; + bib_fname = *++argv; + } + else + { + fprintf (stderr, "%s: missing bib filename\n", prog); + exit (1); + } + bib_inf = fopen (bib_fname, "r"); + if (!bib_inf) + { + fprintf (stderr, "%s: cannot open %s\n", prog, + bib_fname); + exit (1); + } + ccl_qual_file (bibset, bib_inf); + fclose (bib_inf); + break; + default: + usage(prog); + } + } + else + { + fprintf (stderr, "%s: no filenames, please\n", prog); + exit (1); + } + } + while (1) + { + char buf[1000]; + int i, error, pos; + struct ccl_rpn_node *rpn; + +#if HAVE_READLINE_READLINE_H + char* line_in; + line_in=readline("CCLSH>"); + if (!line_in) + break; +#if HAVE_READLINE_HISTORY_H + if (*line_in) + add_history(line_in); +#endif + if (strlen(line_in) > 999) { + fprintf(stderr,"Input line to long\n"); + break; + } + strcpy(buf,line_in); + free (line_in); +#else + printf ("CCLSH>"); fflush (stdout); + if (!fgets (buf, 999, stdin)) + break; +#endif + + for (i = 0; i<1; i++) + { + CCL_parser cclp = ccl_parser_create (); + struct ccl_token *list; + + cclp->bibset = bibset; + + list = ccl_parser_tokenize (cclp, buf); + rpn = ccl_parser_find (cclp, list); + + error = cclp->error_code; + if (error) + pos = cclp->error_pos - buf; + + if (error) + { + printf ("%*s^ - ", 6+pos, " "); + printf ("%s\n", ccl_err_msg (error)); + } + else + { + if (rpn && i == 0) + { + ccl_pr_tree (rpn, stdout); + printf ("\n"); + } + } + if (debug) + { + struct ccl_token *lp; + for (lp = list; lp; lp = lp->next) + printf ("%d %.*s\n", lp->kind, (int) (lp->len), lp->name); + } + ccl_token_del (list); + ccl_parser_destroy (cclp); + if (rpn) + ccl_rpn_delete(rpn); + } + } + printf ("\n"); + return 0; +} diff --git a/util/charconv.sgm b/util/charconv.sgm deleted file mode 100644 index e7a6759..0000000 --- a/util/charconv.sgm +++ /dev/null @@ -1,586 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Aacutelatin capital letter a with acute00C1 -aacutelatin small letter a with acute00E1 -Abreveaclatin capital letter a with breve and acute1EAE -abreveaclatin small letter a with breve and acute1EAF -Abrevedblatin capital letter a with breve and dot below1EB6 -abrevedblatin small letter a with breve and dot below1EB7 -Abrevegrlatin capital letter a with breve and grave1EB0 -abrevegrlatin small letter a with breve and grave1EB1 -Abrevehalatin capital letter a with breve and hook above1EB2 -abrevehalatin small letter a with breve and hook above1EB3 -Abrevetilatin capital letter a with breve and tilde1EB4 -abrevetilatin small letter a with breve and tilde1EB5 -Abrevelatin capital letter a with breve0102 -abrevelatin small letter a with breve0103 -Acaronlatin capital letter a with caron01CD -acaronlatin small letter a with caron01CE -Acircaclatin capital letter a with circumflex and acute1EA4 -acircaclatin small letter a with circumflex and acute1EA5 -Acircdblatin capital letter a with circumflex and dot below1EAC -acircdblatin small letter a with circumflex and dot below1EAD -acircgrlatin capital letter a with circumflex and grave1EA6 -acircgrlatin small letter a with circumflex and grave1EA7 -Acirchalatin capital letter a with circumflex and hook above1EA8 -acirchalatin small letter a with circumflex and hook above1EA9 -Acirctilatin capital letter a with circumflex and tilde1EAA -acirctilatin small letter a with circumflex and tilde1EAB -Acirclatin capital letter a with circumflex00C2 -acirclatin small letter a with circumflex00E2 -acutecombining acute accent0301 -Adotamalatin capital letter a with dot above and macron01E0 -adotamalatin small letter a with dot above and macron01E1 -Adotblatin capital letter a with dot below1EA0 -adotblatin small letter a with dot below1EA1 -Adotlatin capital letter a with dot above0226 -adotlatin small letter a with dot above0227 -Aeacutelatin capital letter ae with acute01FC -aeacutelatin small letter ae with acute01FD -AEliglatin capital letter ae00C6 -aeliglatin small letter ae00E6 -Aemacrlatin capital letter ae with macron01E2 -aemacrlatin small letter ae with macron01E3 -Agravelatin capital letter a with grave00C0 -agravelatin small letter a with grave00E0 -Ahookalatin capital letter a with hook above1EA2 -ahookalatin small letter a with hook above1EA3 -alphagreek small letter alpha03B1 -Amacrlatin capital letter a with macron0100 -amacrlatin small letter a with macron0101 -Aogonlatin capital letter a with ogonek0104 -aogonlatin small letter a with ogonek0105 -Aringaclatin capital letter a with ring above and acute01FA -aringaclatin small letter a with ring above and acute01FB -Aringlatin capital letter a with ring00C5 -aringlatin small letter a with ring00E5 -Atildelatin capital letter a with tilde00C3 -atildelatin small letter a with tilde00E3 -Aumlmalatin capital letter a with diaeresis and macron01DE -aumlmalatin small letter a with diaeresis and macron01DF -Aumllatin capital letter a with umlaut00C4 -aumllatin small letter a with umlaut00E4 -Bdotalatin capital letter b with dot above1E02 -bdotalatin small letter b with dot above1E03 -Bdotblatin capital letter b with dot below1E04 -bdotblatin small letter b with dot below1E05 -betagreek small letter beta03B2 -Bmacrblatin capital letter b with line below1E06 -bmacrblatin small letter b with line below1E07 -brevebcombining breve below032E -brevecombining breve0306 -Cacutelatin capital letter c with acute0106 -cacutelatin small letter c with acute0107 -candracombining candrabindu0310 -caroncombining caron030C -Ccaronlatin capital letter c with caron010C -ccaronlatin small letter c with caron010D -Ccedilaclatin capital letter c with cedilla and acute1E08 -ccedilaclatin small letter c with cedilla and acute1E09 -Ccedillatin capital letter c with cedilla00C7 -ccedillatin small letter c with cedilla00E7 -Ccirclatin capital letter c with circumflex0108 -ccirclatin small letter c with circumflex0109 -Cdotlatin capital letter c with dot above010A -cdotlatin small letter c with dot above010B -cedilcombining cedilla0327 -circcombining circumflex0302 -commaacombining comma above0313 -commabcombining comma below0326 -copysrsound recording copyright2117 -copycopyright sign00A9 -dblaccombining double acute accent030B -dbldotbcombining double dot below0324 -dblundercombining double low line0333 -Dcaronlatin capital letter d with caron010E -dcaronlatin small letter d with caron010F -Dcommablatin capital letter d with comma below1E10 -dcommablatin small letter d with comma below1E11 -Ddotalatin capital letter d with dot above1E0A -ddotalatin small letter d with dot above1E0B -Ddotblatin capital letter d with dot below1E0C -ddotblatin small letter d with dot below1E0D -degdegree sign00B0 -Dmacrblatin capital letter d with line below1E0E -dmacrblatin small letter d with line below1E0F -dotbcombining dot below0323 -dotcombining dot above0307 -Dstroklatin capital letter d with stroke0110 -dstroklatin small letter d with stroke0111 -Eacutelatin capital letter e with acute00C9 -eacutelatin small letter e with acute00E9 -Ebrevelatin capital letter e with breve0114 -ebrevelatin small letter e with breve0115 -Ecaronlatin capital letter e with caron011A -ecaronlatin small letter e with caron011B -Ecedilbrlatin capital letter e with cedilla and breve1E1C -ecedilbrlatin small letter e with cedilla and breve1E1D -Ecedillatin capital letter e with cedilla0228 -ecedillatin small letter e with cedilla0229 -Ecircaclatin capital letter e with circumflex and acute1EBE -ecircaclatin small letter e with circumflex and acute1EBF -Ecircdblatin capital letter e with circumflex and dot below1EC6 -ecircdblatin small letter e with circumflex and dot below1EC7 -Ecircgrlatin capital letter e with circumflex and grave1EC0 -ecircgrlatin small letter e with circumflex and grave1EC1 -Ecirchalatin capital letter e with circumflex and hook above1EC2 -ecirchalatin small letter e with circumflex and hook above1EC3 -Ecirctilatin capital letter e with circumflex and tilde1EC4 -Ecirclatin capital letter e with circumflex00CA -ecirclatin small letter e with circumflex00EA -Edotblatin capital letter e with dot below1EB8 -edotblatin small letter e with dot below1EB9 -Edotlatin capital letter e with dot above0116 -edotlatin small letter e with dot above0117 -Egravelatin capital letter e with grave00C8 -egravelatin small letter e with grave00E8 -Ehookalatin capital letter e with hook above1EBA -ehookalatin small letter e with hook above1EBB -Emacraclatin capital letter e with macron and acute1E16 -emacraclatin small letter e with macron and acute1E17 -Emacrgrlatin capital letter e with macron and grave1E14 -emacrgrlatin small letter e with macron and grave1E15 -Emacrlatin capital letter e with macron0112 -emacrlatin small letter e with macron0113 -Eogonlatin capital letter e with ogon0118 -eogonlatin small letter e with ogon0119 -ethlatin small letter eth00F0 -Etildelatin capital letter e with tilde1EBC -etildelatin small letter e with tilde1EBD -Eumllatin capital letter e with umlaut00CB -eumllatin small letter e with umlaut00EB -Fdotlatin capital letter f with dot above1E1E -fdotlatin small letter f with dot above1E1F -flatmusical flat sign266D -Gacutelatin capital letter g with acute01F4 -gacutelatin small letter g with acute01F5 -gammagreek small letter gamma03B3 -Gbrevelatin capital letter g with breve011E -gbrevelatin small letter g with breve011F -Gcaronlatin capital letter g with caron01E6 -gcaronlatin small letter g with caron01E7 -Gcedillatin capital letter g with cedilla0122 -gcedillatin small letter g with cedilla0123 -Gcirclatin capital letter g with circumflex011C -gcirclatin small letter g with circumflex011D -Gdotlatin capital letter g with dot above0120 -gdotlatin small letter g with dot above0121 -Gmacrlatin capital letter g with macron1E20 -gmacrlatin small letter g with macron1E21 -gravecombining grave accent0300 -Gstroklatin capital letter g with stroke01E4 -gstroklatin small letter g with stroke01E5 -hardsignmodifier letter double prime02BA -Hbreveblatin capital letter h with breve below1E2A -hbreveblatin small letter h with breve below1E2B -Hcaronlatin capital letter h with caron021E -hcaronlatin small letter h with caron021F -Hcedillatin capital letter h with cedilla1E28 -hcedillatin small letter h with cedilla1E29 -Hcirclatin capital letter h with circumflex0124 -hcirclatin small letter h with circumflex0125 -Hdotblatin capital letter h with dot below1E24 -hdotblatin small letter h with dot below1E25 -Hdotlatin capital letter h with dot above1E22 -hdotlatin small letter h with dot above1E23 -hlowlinelatin small letter h with low line1E96 -hookacombining hook above0309 -Hstrokelatin capital letter h with stroke0126 -hstrokelatin small letter h with stroke0127 -Humllatin capital letter h with diaeresis1E26 -humllatin small letter h with diaeresis1E27 -Iacutelatin capital letter i with acute00CD -iacutelatin small letter i with acute00ED -Ibrevelatin capital letter i with breve012C -ibrevelatin small letter i with breve012D -Icaronlatin capital letter i with caron01CF -icaronlatin small letter i with caron01D0 -Icirclatin capital letter i with circumflex00CE -icirclatin small letter i with circumflex00EE -Idotblatin capital letter i with dot below1ECA -idotblatin small letter i with dot below1ECB -Idotlatin capital letter i with dot above0130 -iexclinverted exclamation mark00A1 -Igravelatin capital letter i with grave00CC -igravelatin small letter i with grave00EC -Ihookalatin capital letter i with hook above1EC8 -ihookalatin small letter i with hook above1EC9 -Imacrlatin capital letter i with macron012A -imacrlatin small letter i with macron012B -inodotlatin small letter dotless i0131 -Iogonlatin capital letter i with ogon012E -iogonlatin small letter i with ogon012F -iquestinverted question mark00BF -Itildelatin capital letter i with tilde0128 -itildelatin small letter i with tilde0129 -Iumlaclatin capital letter i with diaeresis and acute1E2E -iumlaclatin small letter i with diaeresis and acute1E2F -Iumllatin capital letter i with umlaut00CF -iumllatin small letter i with umlaut00EF -jcaronlatin small letter j with caron01F0 -Jcirclatin capital letter j with circumflex0134 -jcirclatin small letter j with circumflex0135 -Kacutelatin capital letter k with acute1E30 -kacutelatin small letter k with acute1E31 -Kcedillatin capital letter k with cedilla0136 -kcedillatin small letter k with cedilla0137 -Kcirclatin capital letter k with circumflex01E8 -kcirclatin small letter k with circumflex01E9 -Kdotblatin capital letter k with dot below1E32 -kdotblatin small letter k with dot below1E33 -Kmacrblatin capital letter k with line below1E34 -kmacrblatin small letter k with line below1E35 -Lacutelatin capital letter l with acute0139 -lacutelatin small letter l with acute013A -Lcaronlatin capital letter l with caron013D -lcaronlatin small letter l with caron013E -Lcedillatin capital letter l with cedilla013B -lcedillatin small letter l with cedilla013C -Lcirclatin capital letter l with circumflex1E3C -lcirclatin small letter l with circumflex1E3D -ldbltilcombining double tilde left halfFE22 -Ldotbmalatin capital letter l with dot below and macron1E38 -ldotbmalatin small letter l with dot below and macron1E39 -Ldotblatin capital letter l with dot below1E36 -ldotblatin small letter l with dot below1E37 -lligcombining ligature left halfFE20 -Lmacrblatin capital letter l with line below1E3A -lmacrblatin small letter l with line below1E3B -Lmidotlatin capital letter l with middle dot013F -lmidotlatin small letter l with middle dot0140 -Lstroklatin capital letter l with stroke0141 -lstroklatin small letter l with stroke0142 -macrcombining macron0304 -Macutelatin capital letter m with acute1E3E -macutelatin small letter m with acute1E3F -Mdotblatin capital letter m with dot below1E42 -mdotblatin small letter m with dot below1E43 -Mdotlatin capital letter m with dot above1E40 -mdotlatin small letter m with dot above1E41 -middotmiddle dot00B7 -mllhringmodifier letter left half ring02BF -mlrhringmodifier letter right half ring02BE -Nacutelatin capital letter n with acute0143 -nacutelatin small letter n with acute0144 -naposlatin small letter n with apostrophe0149 -Ncaronlatin capital letter n with caron0147 -ncaronlatin small letter n with caron0148 -Ncedillatin capital letter n with cedilla0145 -ncedillatin small letter n with cedilla0146 -Ndotblatin capital letter n with dot below1E46 -ndotblatin small letter n with dot below1E47 -Ndotlatin capital letter n with dot above1E44 -ndotlatin small letter n with dot above1E45 -Ngravelatin capital letter n with grave01F8 -ngravelatin small letter n with grave01F9 -Nmacrblatin capital letter n with line below1E48 -nmacrblatin small letter n with line below1E49 -Ntildelatin capital letter n with tilde00D1 -ntildelatin small letter n with tilde00F1 -Oacutelatin capital letter o with acute00D3 -oacutelatin small letter o with acute00F3 -Obrevelatin capital letter o with breve014E -obrevelatin small letter o with breve014F -Ocaronlatin capital letter o with caron01D1 -ocaronlatin small letter o with caron01D2 -Ocircaclatin capital letter o with circumflex and acute1ED0 -ocircaclatin small letter o with circumflex and acute1ED1 -Ocircdblatin capital letter o with circumflex and dot below1ED8 -ocircdblatin small letter o with circumflex and dot below1ED9 -Ocircgrlatin capital letter o with circumflex and grave1ED2 -ocircgrlatin small letter o with circumflex and grave1ED3 -Ocirchalatin capital letter o with circumflex and hook above1ED4 -ocirchalatin small letter o with circumflex and hook above1ED5 -Ocirctilatin capital letter o with circumflex and tilde1ED6 -ocirctilatin small letter o with circumflex and tilde1ED7 -Ocirclatin capital letter o with circumflex00D4 -ocirclatin small letter o with circumflex00F4 -Odblaclatin capital letter o with double acute0150 -odblaclatin small letter o with double acute0151 -Odotamalatin capital letter o with dot above and macron0230 -odotamalatin small letter o with dot above and macron0231 -Odotalatin capital letter o with dot above022E -odotalatin small letter o with dot above022F -Odotblatin capital letter o with dot below1ECC -odotblatin small letter o with dot below1ECD -OEliglatin capital letter oe0152 -oeliglatin small letter oe0153 -ogoncombining ogonek0328 -Ogravelatin capital letter o with grave00D2 -ogravelatin small letter o with grave00F2 -Ohookalatin capital letter o with hook above1ECE -ohookalatin small letter o with hook above1ECF -Ohornaclatin capital letter o with horn and acute1EDA -Ohornaclatin capital letter u with horn and acute1EE8 -ohornaclatin small letter o with horn and acute1EDB -Ohorndblatin capital letter o with horn and dot below1EE2 -ohorndblatin small letter o with horn and dot below1EE3 -Ohorngrlatin capital letter o with horn and grave1EDC -ohorngrlatin small letter o with horn and grave1EDD -Ohornhalatin capital letter o with horn and hook above1EDE -ohornhalatin small letter o with horn and hook above1EDF -Ohorntilatin capital letter o with horn and tilde1EE0 -ohorntilatin small letter o with horn and tilde1EE1 -Ohornlatin capital letter o with horn01A0 -ohornlatin small letter o with horn01A1 -Omacraclatin capital letter o with macron and acute1E52 -omacraclatin small letter o with macron and acute1E53 -Omacrgrlatin capital letter o with macron and grave1E50 -omacrgrlatin small letter o with macron and grave1E51 -Omacrlatin capital letter o with macron014C -omacrlatin small letter o with macron014D -Oogonmalatin capital letter o with ogonek and macron01EC -oogonmalatin small letter o with ogonek and macron01ED -Oogonlatin capital letter o with ogonek01EA -oogonlatin small letter o with ogonek01EB -Oslashalatin capital letter o with stroke and acute01FE -oslashalatin small letter o with stroke and acute01FF -Oslashlatin capital letter o with stroke00D8 -oslashlatin small letter o with stroke00F8 -Otildeaclatin capital letter o with tilde and acute1E4C -otildeaclatin small letter o with tilde and acute1E4D -Otildemalatin capital letter o with tilde and macron022C -otildemalatin small letter o with tilde and macron022D -Otildeumlatin capital letter o with tilde and diaeresis1E4E -otildeumlatin small letter o with tilde and diaeresis1E4F -Otildelatin capital letter o with tilde00D5 -otildelatin small letter o with tilde00F5 -Oumlmalatin capital letter o with diaeresis and macron022A -oumlmalatin small letter o with diaeresis and macron022B -Oumllatin capital letter o with umlaut00D6 -oumllatin small letter o with umlaut00F6 -Pacutelatin capital letter p with acute1E54 -pacutelatin small letter p with acute1E55 -Pdotalatin capital letter p with dot above1E56 -pdotalatin small letter p with dot above1E57 -plusmnplus-minus sign00B1 -poundpound sign00A3 -Racutelatin capital letter r with acute0154 -racutelatin small letter r with acute0155 -Rcaronlatin capital letter r with caron0158 -rcaronlatin small letter r with caron0159 -rcedilcombining left half ring below031C -Rcedillatin capital letter r with cedilla0156 -rcedillatin small letter r with cedilla0157 -rcommaacombining comma above right0315 -rdbltilcombining double tilde right halfFE23 -Rdotalatin capital letter r with dot above1E58 -rdotalatin small letter r with dot above1E59 -Rdotblatin capital letter r with dot below1E5A -rdotblatin small letter r with dot below1E5B -regregistered sign00AE -ringbcombining ring below0325 -ringcombining ring above030A -rligcombining ligature right halfFE21 -Rmacrblatin capital letter r with line below1E5E -rmacrblatin small letter r with line below1E5F -Sacutedalatin capital letter s with acute and dot above1E64 -sacutedalatin small letter s with acute and dot above1E65 -Sacutelatin capital letter s with acute015A -sacutelatin small letter s with acute015B -Scarondalatin capital letter s with caron and dot above1E66 -scarondalatin small letter s with caron and dot above1E67 -Scaronlatin capital letter s with caron0160 -scaronlatin small letter s with caron0161 -Scedillatin capital letter s with cedil015E -scedillatin small letter s with cedil015F -Scirclatin capital letter s with circumflex015C -scirclatin small letter s with circumflex015D -scommablatin capital letter s with comma below0218 -scommablatin small letter s with comma below0219 -scriptlscript small l2113 -Sdotalatin capital letter s with dot above1E60 -sdotalatin small letter s with dot above1E61 -Sdotbdalatin capital letter s with dot below and dot above1E68 -sdotbdalatin small letter s with dot below and dot above1E69 -Sdotblatin capital letter s with dot below1E62 -sdotblatin small letter s with dot below1E63 -sharpsharp266F -softsignmodifier letter prime02B9 -sub0subscript zero2080 -sub1subscript one2081 -sub2subscript two2082 -sub3subscript three2083 -sub4subscript four2084 -sub5subscript five2085 -sub6subscript six2086 -sub7subscript seven2087 -sub8subscript eight2088 -sub9subscript nine2089 -sublparsubscript left parenthesis208D -subminussubscript minus208B -subplussubscript plus sign208A -subrparsubscript right parenthesis208E -sup0superscript zero2070 -sup1superscript one00B9 -sup2superscript two00B2 -sup3superscript three00B3 -sup4superscript four2074 -sup5superscript five2075 -sup6superscript six2076 -sup7superscript seven2077 -sup8superscript eight2078 -sup9superscript nine2079 -suplparsuperscript left parenthesis207D -supminussuperscript minus207B -supplussuperscript plus sign207A -suprparsuperscript right parenthesis207E -Tcaronlatin capital letter t with caron0164 -tcaronlatin small letter t with caron0165 -Tcedillatin capital letter t with cedilla0162 -tcedillatin small letter t with cedilla0163 -tcirctilatin small letter e with circumflex and tilde1EC5 -Tcommablatin capital letter t with comma below021A -tcommablatin small letter t with comma below021B -Tdotblatin capital letter t with dot below1E6C -tdotblatin small letter t with dot below1E6D -Tdotlatin capital letter t with dot above1E6A -tdotlatin small letter t with dot above1E6B -THORNlatin capital letter thorn00DE -thornlatin small letter thorn00FE -tildecombining tilde0303 -Tmacrblatin capital letter t with line below1E6E -tmacrblatin small letter t with line below1E6F -tumllatin small letter t with diaeresis1E97 -Uacutelatin capital letter u with acute00DA -uacutelatin small letter u with acute00FA -Ubrevelatin capital letter u with breve016C -ubrevelatin small letter u with breve016D -ucaronlatin capital letter u with caron01D3 -ucaronlatin small letter u with caron01D4 -Ucirclatin capital letter u with circumflex00DB -ucirclatin small letter u with circumflex00FB -Udblaclatin capital letter u with double acute0170 -udblaclatin small letter u with double acute0171 -udbldblatin small letter u with double dot below1E73 -Udlbdblatin capital letter u with double dot below1E72 -Udotblatin capital letter u with dot below1EE4 -udotblatin small letter u with dot below1EE5 -Ugravelatin capital letter u with grave00D9 -ugravelatin small letter u with grave00F9 -uhookalatin capital letter u with hook above1EE6 -uhookalatin small letter u with hook above1EE7 -uhornaclatin small letter u with horn and acute1EE9 -Uhorndblatin capital letter u with horn and dot below1EF0 -uhorndblatin small letter u with horn and dot below1EF1 -Uhorngrlatin capital letter u with horn and grave1EEA -uhorngrlatin small letter u with horn and grave1EEB -Uhornhalatin capital letter u with horn and hook above1EEC -uhornhalatin small letter u with horn and hook above1EED -Uhorntilatin capital letter u with horn and tilde1EEE -uhorntilatin small letter u with horn and tilde1EEF -Uhornlatin capital letter u with horn01AF -uhornlatin small letter u with horn01B0 -Umacrumlatin capital letter u with macron and diaeresis1E7A -umacrumlatin small letter u with macron and diaeresis1E7B -Umacrlatin capital letter u with macron016A -umacrlatin small letter u with macron016B -umlcombining diaeresis0308 -undercombining low line0332 -Uogonlatin capital letter u with ogon0172 -uogonlatin small letter u with ogon0173 -Uringlatin capital letter u with ring016E -uringlatin small letter u with ring016F -utildeaclatin capital letter u with tilde and acute1E78 -utildeaclatin small letter u with tilde and acute1E79 -Utildelatin capital letter u with tilde0168 -utildelatin small letter u with tilde0169 -Uumlaclatin capital letter u with diaeresis and acute01D7 -uumlaclatin small letter u with diaeresis and acute01D8 -Uumlcalatin capital letter u with diaeresis and caron01D9 -uumlcalatin small letter u with diaresis and caron01DA -Uumlgrlatin capital letter u with diaeresis and grave01DB -uumlgrlatin small letter u with diaeresis and grave01DC -Uumlmalatin capital letter u with diaeresis and macron01D5 -uumlmalatin small letter u with diaeresis and macron01D6 -Uumllatin capital letter u with umlaut00DC -uumllatin small letter u with umlaut00FC -Vdotblatin capital letter v with dot below1E7E -vdotblatin small letter v with dot below1E7F -Vtildelatin capital letter v with tilde1E7C -vtildelatin small letter v with tilde1E7D -Wacutelatin capital letter w with acute1E82 -wacutelatin small letter w with acute1E83 -Wcirclatin capital letter w with circumflex0174 -wcirclatin small letter w with circumflex0175 -wdotblatin capital letter w with dot below1E88 -wdotblatin small letter w with dot below1E89 -Wdotlatin capital letter w with dot above1E86 -wdotlatin small letter w with dot above1E87 -Wgravelatin capital letter w with grave1E80 -wgravelatin small letter w with grave1E81 -wringlatin small letter w with ring1E98 -Wumllatin capital letter w with diaeresis1E84 -wumllatin small letter w with diaeresis1E85 -Xdotlatin capital letter x with dot1E8A -xdotlatin small letter x with dot1E8B -Xumllatin capital letter x with diaeresis1E8C -xumllatin small letter x with diaeresis1E8D -Yacutelatin capital letter y with acute00DD -yacutelatin small letter y with acute00FD -Ycirclatin capital letter y with circumflex0176 -ycirclatin small letter y with circumflex0177 -Ydotblatin capital letter y with dot below1EF4 -ydotblatin small letter y with dot below1EF5 -Ydotlatin capital letter y with dot1E8E -ydotlatin small letter y with dot1E8F -Ygravelatin capital letter y with grave1EF2 -ygravelatin small letter y with grave1EF3 -Yhookalatin capital letter y with hook above1EF6 -yhookalatin small letter y with hook above1EF7 -Ymacrlatin capital letter y with macron0232 -ymacrlatin small letter y with macron0233 -yringlatin small letter y with ring1E99 -Ytildelatin capital letter y with tilde1EF8 -ytildelatin small letter y with tilde1EF9 -Yumllatin capital letter y with umlaut0178 -yumllatin small letter y with umlaut00FF -Zacutelatin capital letter z with acute0179 -zacutelatin small letter z with acute017A -Zcaronlatin capital letter z with caron017D -zcaronlatin small letter z with caron017E -Zcirclatin capital letter z with circumflex1E90 -zcirclatin small letter z with circumflex1E91 -Zdotblatin capital letter z with dot below1E92 -zdotblatin small letter z with dot below1E93 -Zdotlatin capital letter z with dot above017B -zdotlatin small letter z with dot above017C -Zlowlinelatin capital letter z with low line1E94 -zlowlinelatin small letter z with low line1E95 - diff --git a/util/charconv.tcl b/util/charconv.tcl deleted file mode 100755 index e57ac3c..0000000 --- a/util/charconv.tcl +++ /dev/null @@ -1,275 +0,0 @@ -#!/bin/sh -# the next line restats using tclsh \ -exec tclsh "$0" "$@" -# -# $Id: charconv.tcl,v 1.3 2003-06-02 22:17:20 adam Exp $ - -proc usage {} { - puts {charconv.tcl: [-p prefix] [-s split] [-o ofile] file ... } - exit 1 -} - -proc ins_trie {from to} { - global trie - if {![info exists trie(no)]} { - set trie(no) 1 - set trie(size) 0 - } - incr trie(size) - ins_trie_r [split $from] $to 0 -} - -proc split_trie {this} { - global trie - set trie($this,type) d - foreach e $trie($this,content) { - set from [lindex $e 0] - set to [lindex $e 1] - - set ch [lindex $from 0] - set rest [lrange $from 1 end] - - if {[llength $rest]} { - if {![info exist trie($this,ptr,$ch)]} { - set trie($this,ptr,$ch) $trie(no) - incr trie(no) - } - ins_trie_r $rest $to $trie($this,ptr,$ch) - } else { - set trie($this,to,$ch) $to - } - } - set trie($this,content) missing -} - -proc ins_trie_r {from to this} { - global trie - - if {![info exist trie($this,type)]} { - set trie($this,type) f - } - if {$trie($this,type) == "f"} { - lappend trie($this,content) [list $from $to] - - # split ? - if {[llength $trie($this,content)] > $trie(split)} { - split_trie $this - return [ins_trie_r $from $to $this] - } - } else { - set ch [lindex $from 0] - set rest [lrange $from 1 end] - - if {[llength $rest]} { - if {![info exist trie($this,ptr,$ch)]} { - set trie($this,ptr,$ch) $trie(no) - incr trie(no) - } - ins_trie_r $rest $to $trie($this,ptr,$ch) - } else { - set trie($this,to,$ch) $to - } - } -} - -proc dump_trie {ofile} { - global trie - - set f [open $ofile w] - - puts $f "/* TRIE: size $trie(size) */" - puts $f "\#include " - puts $f { - struct yaz_iconv_trie_flat { - char *from; - int to; - }; - struct yaz_iconv_trie_dir { - struct yaz_iconv_trie *ptr; - int to; - }; - - struct yaz_iconv_trie { - struct yaz_iconv_trie_flat *flat; - struct yaz_iconv_trie_dir *dir; - }; - } - - set this $trie(no) - while { [incr this -1] >= 0 } { - puts $f "/* PAGE $this */" - if {$trie($this,type) == "f"} { - puts $f "struct yaz_iconv_trie_flat $trie(prefix)page${this}_flat\[\] = \{" - foreach m $trie($this,content) { - puts -nonewline $f " \{\"" - foreach d [lindex $m 0] { - puts -nonewline $f "\\x$d" - } - puts -nonewline $f "\", 0x[lindex $m 1]" - puts $f "\}," - } - puts $f " \{0, 0\}" - puts $f "\};" - puts $f "struct yaz_iconv_trie $trie(prefix)page${this} = \{" - puts $f " $trie(prefix)page${this}_flat, 0" - puts $f "\};" - } else { - puts $f "struct yaz_iconv_trie_dir $trie(prefix)page${this}_dir\[256\] = \{" - for {set i 0} {$i < 256} {incr i} { - puts -nonewline $f " \{" - set ch [format %02X $i] - set null 1 - if {[info exist trie($this,ptr,$ch)]} { - puts -nonewline $f "&$trie(prefix)page$trie($this,ptr,$ch), " - set null 0 - } else { - puts -nonewline $f "0, " - } - if {[info exist trie($this,to,$ch)]} { - puts -nonewline $f "0x$trie($this,to,$ch)\}" - set null 0 - } else { - puts -nonewline $f "0\}" - } - if {!$null} { - puts -nonewline $f " /* $ch */" - } - if {$i < 255} { - puts $f "," - } else { - puts $f "" - } - } - puts $f "\};" - puts $f "struct yaz_iconv_trie $trie(prefix)page${this} = \{" - puts $f " 0, $trie(prefix)page${this}_dir" - puts $f "\};" - } - } - puts $f { - static unsigned long lookup(struct yaz_iconv_trie *t, unsigned char *inp, - size_t inbytesleft, size_t *no_read) - { - if (!t || inbytesleft < 1) - return 0; - if (t->dir) - { - size_t ch = inp[0] & 0xff; - unsigned long code = - lookup(t->dir[ch].ptr, inp+1, inbytesleft-1, no_read); - if (code) - { - (*no_read)++; - return code; - } - if (t->dir[ch].to) - { - code = t->dir[ch].to; - *no_read = 1; - return code; - } - } - else - { - struct yaz_iconv_trie_flat *flat = t->flat; - while (flat->from) - { - size_t len = strlen(flat->from); - if (len <= inbytesleft) - { - if (memcmp(flat->from, inp, len) == 0) - { - *no_read = len; - return flat->to; - } - } - flat++; - } - } - return 0; - } - - } - puts $f "unsigned long yaz_$trie(prefix)_conv - (unsigned char *inp, size_t inbytesleft, size_t *no_read) - { - unsigned long code; - - code = lookup(&$trie(prefix)page0, inp, inbytesleft, no_read); - if (!code) - { - *no_read = 1; - code = *inp; - } - return code; - } - " - close $f -} - -proc readfile {fname} { - set lineno 0 - set f [open $fname r] - while {1} { - incr lineno - set cnt [gets $f line] - if {$cnt < 0} { - break - } - set hex {} - set uni {} - regexp {([0-9A-Z]*)} $line s hex uni - # puts "$lineno hex=$hex uni=$uni $line" - if {[string length $uni]} { - ins_trie $hex $uni - } - } - close $f -} - -set verbose 0 -set ifile {} -set ofile out.c -set trie(split) 40 -set trie(prefix) {} -# Parse command line -set l [llength $argv] -set i 0 -while {$i < $l} { - set arg [lindex $argv $i] - switch -glob -- $arg { - -v { - incr verbose - } - -s { - if {[string length $arg]} { - set arg [lindex $argv [incr i]] - } - set trie(split) $arg - } - -p { - if {[string length $arg]} { - set arg [lindex $argv [incr i]] - } - set trie(prefix) $arg - } - -o { - if {[string length $arg]} { - set arg [lindex $argv [incr i]] - } - set ofile $arg - } - default { - lappend ifiles $arg - } - } - incr i -} -if {![info exists ifiles]} { - puts "charconv.tcl: missing input file(s)" - usage -} -foreach ifile $ifiles { - readfile $ifile -} -dump_trie $ofile diff --git a/util/charconv_cjk.xml b/util/charconv_cjk.xml deleted file mode 100644 index 494e523..0000000 --- a/util/charconv_cjk.xml +++ /dev/null @@ -1,15730 +0,0 @@ - -3000CJK space in some implementations -3000CJK space per ANSI Z39.64 -FF08Ideographic left parenthesis -FF09Ideographic right parenthesis -FF0DIdeographic hyphen minus -E8D0EACC component character -E8D1EACC component character -E8D2EACC component character -E8D3EACC component character -E8D4EACC component character -E8D5EACC component character -E8D6EACC component character -E8D7EACC component character -E8D8EACC component character -E8D9EACC component character -E8DAEACC component character -E8DBEACC component character -E8DCEACC component character -E8DDEACC component character -E8DEEACC component character -E8DFEACC component character -E8E0EACC component character -E8E1EACC component character -E8E2EACC component character -E8E3EACC component character -E8E4EACC component character -E8E5EACC component character -E8E6EACC component character -E8E7EACC component character -E8E8EACC component character -E8E9EACC component character -E8EAEACC component character -E8EBEACC component character -E8ECEACC component character -E8EDEACC component character -E8EEEACC component character -E8EFEACC component character -E8F0EACC component character -E8F1EACC component character -E8F2EACC component character -3013Ideographic geta symbol -300CIdeographic left corner bracket -300DIdeographic right corner bracket -FF3BIdeographic left square bracket -FF3DIdeographic right square bracket -3002Ideographic full stop -FF0EIdeographic variant full stop -3001Ideographic comma -FF0CIdeographic variant comma -FF1BIdeographic semicolon -FF1AIdeographic colon -FF1FIdeographic question mark -FF01Ideographic exclamation point -FF0FIdeographic solidus -3007Ideographic number zero -4E00East Asian ideograph -4E01East Asian ideograph -4E03East Asian ideograph -4E09East Asian ideograph -4E0BEast Asian ideograph -4E0AEast Asian ideograph -4E08East Asian ideograph -4E10East Asian ideograph -4E0DEast Asian ideograph -4E14East Asian ideograph -4E19East Asian ideograph -4E16East Asian ideograph -4E15East Asian ideograph -4E18East Asian ideograph -4E22East Asian ideograph -4E1EEast Asian ideograph -4E26East Asian ideograph -4E2DEast Asian ideograph -4E32East Asian ideograph -51E1East Asian ideograph -4E38East Asian ideograph -4E39East Asian ideograph -4E3BEast Asian ideograph -4E43East Asian ideograph -4E45East Asian ideograph -4E4BEast Asian ideograph -5C39East Asian ideograph -4E4FEast Asian ideograph -4E4EEast Asian ideograph -4E4DEast Asian ideograph -4E52East Asian ideograph -4E53East Asian ideograph -4E56East Asian ideograph -4E58East Asian ideograph -4E59East Asian ideograph -4E5DEast Asian ideograph -4E5FEast Asian ideograph -4E5EEast Asian ideograph -4E73East Asian ideograph -4E7EEast Asian ideograph -4E82East Asian ideograph -4E8BEast Asian ideograph -4E8CEast Asian ideograph -4E8EEast Asian ideograph -4E95East Asian ideograph -4E94East Asian ideograph -4E92East Asian ideograph -E9304E99Variant of 4B3057 which maps to 4E99 -4E9EEast Asian ideograph -4E9BEast Asian ideograph -4E9FEast Asian ideograph -4EA1East Asian ideograph -4EA6East Asian ideograph -4EA5East Asian ideograph -4EA4East Asian ideograph -4EA8East Asian ideograph -4EABEast Asian ideograph -4EACEast Asian ideograph -4EADEast Asian ideograph -4EAEEast Asian ideograph -4EBAEast Asian ideograph -4ECAEast Asian ideograph -4EC1East Asian ideograph -4EC3East Asian ideograph -4EC4East Asian ideograph -4ECDEast Asian ideograph -4EC7East Asian ideograph -4ECBEast Asian ideograph -4EE4East Asian ideograph -4ED8East Asian ideograph -4ED5East Asian ideograph -4ED6East Asian ideograph -4EDEEast Asian ideograph -4EE3East Asian ideograph -4ED4East Asian ideograph -4ED7East Asian ideograph -4ED9East Asian ideograph -4EE5East Asian ideograph -4EFFEast Asian ideograph -4F09East Asian ideograph -4EFBEast Asian ideograph -4F0AEast Asian ideograph -4F15East Asian ideograph -4F11East Asian ideograph -4F10East Asian ideograph -4F0FEast Asian ideograph -4EF2East Asian ideograph -4F01East Asian ideograph -4EF3East Asian ideograph -4EF6East Asian ideograph -4EF0East Asian ideograph -4F4FEast Asian ideograph -4F4DEast Asian ideograph -4F34East Asian ideograph -4F47East Asian ideograph -4F57East Asian ideograph -4F3AEast Asian ideograph -4F5EEast Asian ideograph -4F5BEast Asian ideograph -4F55East Asian ideograph -4F30East Asian ideograph -4F50East Asian ideograph -4F51East Asian ideograph -4F3DEast Asian ideograph -4F48East Asian ideograph -4F46East Asian ideograph -4F38East Asian ideograph -4F43East Asian ideograph -4F54East Asian ideograph -4F3CEast Asian ideograph -4F63East Asian ideograph -4F5CEast Asian ideograph -4F60East Asian ideograph -4F2FEast Asian ideograph -4F4EEast Asian ideograph -4F5DEast Asian ideograph -4F36East Asian ideograph -4F9DEast Asian ideograph -4F6FEast Asian ideograph -4F75East Asian ideograph -4F8DEast Asian ideograph -4F73East Asian ideograph -4F7FEast Asian ideograph -4F9BEast Asian ideograph -4F86East Asian ideograph -4F6CEast Asian ideograph -4F8BEast Asian ideograph -4F96East Asian ideograph -4F83East Asian ideograph -4F7BEast Asian ideograph -4F88East Asian ideograph -4F69East Asian ideograph -4F8FEast Asian ideograph -4F7EEast Asian ideograph -4FE1East Asian ideograph -4FD1East Asian ideograph -4FB5East Asian ideograph -4FAFEast Asian ideograph -4FBFEast Asian ideograph -4FDEEast Asian ideograph -4FE0East Asian ideograph -4FCFEast Asian ideograph -4FB6East Asian ideograph -4FDAEast Asian ideograph -4FDDEast Asian ideograph -4FC3East Asian ideograph -4FD8East Asian ideograph -4FDFEast Asian ideograph -4FCAEast Asian ideograph -4FAEEast Asian ideograph -4FD0East Asian ideograph -4FC4East Asian ideograph -4FC2East Asian ideograph -4FCEEast Asian ideograph -4FD7East Asian ideograph -5009East Asian ideograph -500DEast Asian ideograph -4FEFEast Asian ideograph -5026East Asian ideograph -500CEast Asian ideograph -5025East Asian ideograph -5011East Asian ideograph -4FF8East Asian ideograph -5028East Asian ideograph -5014East Asian ideograph -5016East Asian ideograph -5029East Asian ideograph -5006East Asian ideograph -5012East Asian ideograph -503CEast Asian ideograph -501AEast Asian ideograph -4FFAEast Asian ideograph -5018East Asian ideograph -4FF1East Asian ideograph -5021East Asian ideograph -500BEast Asian ideograph -5019East Asian ideograph -5000East Asian ideograph -4FEEEast Asian ideograph -4FF3East Asian ideograph -502DEast Asian ideograph -5003East Asian ideograph -4FFEEast Asian ideograph -502AEast Asian ideograph -502BEast Asian ideograph -505CEast Asian ideograph -504FEast Asian ideograph -5065East Asian ideograph -5047East Asian ideograph -505AEast Asian ideograph -5049East Asian ideograph -5043East Asian ideograph -5074East Asian ideograph -5076East Asian ideograph -504EEast Asian ideograph -5075East Asian ideograph -504CEast Asian ideograph -5055East Asian ideograph -500FEast Asian ideograph -5077East Asian ideograph -508DEast Asian ideograph -50A2East Asian ideograph -5085East Asian ideograph -5099East Asian ideograph -5091East Asian ideograph -5080East Asian ideograph -5096East Asian ideograph -5098East Asian ideograph -50ADEast Asian ideograph -50B3East Asian ideograph -50B5East Asian ideograph -50B2East Asian ideograph -50C5East Asian ideograph -50BEEast Asian ideograph -50ACEast Asian ideograph -50B7East Asian ideograph -50AFEast Asian ideograph -50E7East Asian ideograph -50EEEast Asian ideograph -50F1East Asian ideograph -50E5East Asian ideograph -50D6East Asian ideograph -50EDEast Asian ideograph -50DAEast Asian ideograph -50D5East Asian ideograph -507DEast Asian ideograph -50CFEast Asian ideograph -50D1East Asian ideograph -5100East Asian ideograph -5104East Asian ideograph -50FBEast Asian ideograph -50F5East Asian ideograph -50F9East Asian ideograph -5102East Asian ideograph -510DEast Asian ideograph -5108East Asian ideograph -5109East Asian ideograph -5110East Asian ideograph -5118East Asian ideograph -5112East Asian ideograph -5114East Asian ideograph -512AEast Asian ideograph -511FEast Asian ideograph -5121East Asian ideograph -5132East Asian ideograph -5137East Asian ideograph -513CEast Asian ideograph -5140East Asian ideograph -5143East Asian ideograph -5141East Asian ideograph -5145East Asian ideograph -5144East Asian ideograph -5146East Asian ideograph -5149East Asian ideograph -5147East Asian ideograph -5148East Asian ideograph -514CEast Asian ideograph -514DEast Asian ideograph -5155East Asian ideograph -5154East Asian ideograph -5152East Asian ideograph -5157East Asian ideograph -515CEast Asian ideograph -5162East Asian ideograph -5165East Asian ideograph -5167East Asian ideograph -5168East Asian ideograph -5169East Asian ideograph -516BEast Asian ideograph -516DEast Asian ideograph -516EEast Asian ideograph -516CEast Asian ideograph -5171East Asian ideograph -5175East Asian ideograph -5176East Asian ideograph -5177East Asian ideograph -5178East Asian ideograph -517CEast Asian ideograph -5180East Asian ideograph -5189East Asian ideograph -518CEast Asian ideograph -518DEast Asian ideograph -5192East Asian ideograph -5191East Asian ideograph -5195East Asian ideograph -6700East Asian ideograph -5197East Asian ideograph -51A0East Asian ideograph -51A5East Asian ideograph -51B0East Asian ideograph -51B6East Asian ideograph -51B7East Asian ideograph -51CDEast Asian ideograph -51CCEast Asian ideograph -51DCEast Asian ideograph -51DDEast Asian ideograph -51F0East Asian ideograph -51F1East Asian ideograph -51F3East Asian ideograph -51FAEast Asian ideograph -51F9East Asian ideograph -51F8East Asian ideograph -51FDEast Asian ideograph -5200East Asian ideograph -5201East Asian ideograph -5203East Asian ideograph -5207East Asian ideograph -5206East Asian ideograph -5208East Asian ideograph -520AEast Asian ideograph -5211East Asian ideograph -5217East Asian ideograph -520EEast Asian ideograph -5224East Asian ideograph -5225East Asian ideograph -5220East Asian ideograph -5228East Asian ideograph -5229East Asian ideograph -5238East Asian ideograph -523BEast Asian ideograph -5237East Asian ideograph -5230East Asian ideograph -523AEast Asian ideograph -5241East Asian ideograph -5239East Asian ideograph -5243East Asian ideograph -524DEast Asian ideograph -524CEast Asian ideograph -524BEast Asian ideograph -524AEast Asian ideograph -5247East Asian ideograph -525CEast Asian ideograph -5256East Asian ideograph -525BEast Asian ideograph -5254East Asian ideograph -525DEast Asian ideograph -526AEast Asian ideograph -526FEast Asian ideograph -5272East Asian ideograph -5274East Asian ideograph -5269East Asian ideograph -5275East Asian ideograph -527DEast Asian ideograph -527FEast Asian ideograph -5283East Asian ideograph -5288East Asian ideograph -5287East Asian ideograph -528DEast Asian ideograph -5289East Asian ideograph -5291East Asian ideograph -529BEast Asian ideograph -529FEast Asian ideograph -52A0East Asian ideograph -52A3East Asian ideograph -52ABEast Asian ideograph -52A9East Asian ideograph -52ACEast Asian ideograph -52AAEast Asian ideograph -52BEEast Asian ideograph -52C7East Asian ideograph -52C3East Asian ideograph -52C1East Asian ideograph -52C9East Asian ideograph -52D8East Asian ideograph -52D2East Asian ideograph -52D9East Asian ideograph -52D5East Asian ideograph -52DEEast Asian ideograph -52DBEast Asian ideograph -52DDEast Asian ideograph -52E2East Asian ideograph -52E4East Asian ideograph -52DFEast Asian ideograph -52F5East Asian ideograph -52F8East Asian ideograph -52FBEast Asian ideograph -52FFEast Asian ideograph -5305East Asian ideograph -5306East Asian ideograph -5308East Asian ideograph -530DEast Asian ideograph -5310East Asian ideograph -530FEast Asian ideograph -5315East Asian ideograph -5316East Asian ideograph -5317East Asian ideograph -5319East Asian ideograph -53F5East Asian ideograph -531DEast Asian ideograph -5321East Asian ideograph -5320East Asian ideograph -5323East Asian ideograph -532AEast Asian ideograph -532FEast Asian ideograph -5331East Asian ideograph -5339East Asian ideograph -533EEast Asian ideograph -5340East Asian ideograph -533FEast Asian ideograph -5341East Asian ideograph -5343East Asian ideograph -5345East Asian ideograph -5348East Asian ideograph -5347East Asian ideograph -534AEast Asian ideograph -E9315349Variant of 2D345D which maps to 5349 -5352East Asian ideograph -5354East Asian ideograph -5353East Asian ideograph -5351East Asian ideograph -5357East Asian ideograph -535AEast Asian ideograph -535EEast Asian ideograph -5361East Asian ideograph -5366East Asian ideograph -536FEast Asian ideograph -536EEast Asian ideograph -5370East Asian ideograph -5371East Asian ideograph -537DEast Asian ideograph -5375East Asian ideograph -5378East Asian ideograph -537BEast Asian ideograph -537FEast Asian ideograph -5384East Asian ideograph -539AEast Asian ideograph -539DEast Asian ideograph -539FEast Asian ideograph -53A5East Asian ideograph -53ADEast Asian ideograph -53B2East Asian ideograph -53BBEast Asian ideograph -53C3East Asian ideograph -53C8East Asian ideograph -53C9East Asian ideograph -53CBEast Asian ideograph -53CAEast Asian ideograph -53CDEast Asian ideograph -53D6East Asian ideograph -53D4East Asian ideograph -53D7East Asian ideograph -53DBEast Asian ideograph -53DFEast Asian ideograph -66FCEast Asian ideograph -53E2East Asian ideograph -53E3East Asian ideograph -53F8East Asian ideograph -53E4East Asian ideograph -53EEEast Asian ideograph -53EFEast Asian ideograph -53E9East Asian ideograph -53F3East Asian ideograph -53FCEast Asian ideograph -53E8East Asian ideograph -53E6East Asian ideograph -53ECEast Asian ideograph -53EBEast Asian ideograph -E900Duplicate simplified ideograph -53E5East Asian ideograph -53F1East Asian ideograph -53EDEast Asian ideograph -53EAEast Asian ideograph -53F2East Asian ideograph -540BEast Asian ideograph -5409East Asian ideograph -5410East Asian ideograph -540FEast Asian ideograph -540CEast Asian ideograph -540AEast Asian ideograph -540DEast Asian ideograph -5404East Asian ideograph -5403East Asian ideograph -5412East Asian ideograph -E9E0East Asian ideograph not in Unicode -542DEast Asian ideograph -541DEast Asian ideograph -541EEast Asian ideograph -541BEast Asian ideograph -544EEast Asian ideograph -543EEast Asian ideograph -5427East Asian ideograph -5440East Asian ideograph -5431East Asian ideograph -5446East Asian ideograph -543CEast Asian ideograph -5443East Asian ideograph -5426East Asian ideograph -5420East Asian ideograph -5436East Asian ideograph -5433East Asian ideograph -5435East Asian ideograph -542EEast Asian ideograph -544AEast Asian ideograph -5448East Asian ideograph -543BEast Asian ideograph -5438East Asian ideograph -5439East Asian ideograph -5442East Asian ideograph -542BEast Asian ideograph -541FEast Asian ideograph -5429East Asian ideograph -5473East Asian ideograph -5462East Asian ideograph -5475East Asian ideograph -5495East Asian ideograph -5478East Asian ideograph -5496East Asian ideograph -5477East Asian ideograph -547BEast Asian ideograph -5492East Asian ideograph -5484East Asian ideograph -547CEast Asian ideograph -5468East Asian ideograph -5486East Asian ideograph -548BEast Asian ideograph -548CEast Asian ideograph -5490East Asian ideograph -547DEast Asian ideograph -5476East Asian ideograph -5471East Asian ideograph -549AEast Asian ideograph -548EEast Asian ideograph -54A9East Asian ideograph -54AAEast Asian ideograph -54A8East Asian ideograph -54ACEast Asian ideograph -54C0East Asian ideograph -54B3East Asian ideograph -54A6East Asian ideograph -54ABEast Asian ideograph -54C7East Asian ideograph -54C9East Asian ideograph -54C4East Asian ideograph -54C2East Asian ideograph -54C1East Asian ideograph -54CEEast Asian ideograph -54B1East Asian ideograph -54BBEast Asian ideograph -54AFEast Asian ideograph -54C8East Asian ideograph -5501East Asian ideograph -54FCEast Asian ideograph -5510East Asian ideograph -54EAEast Asian ideograph -5514East Asian ideograph -54FAEast Asian ideograph -54E5East Asian ideograph -54EEEast Asian ideograph -54F2East Asian ideograph -54E8East Asian ideograph -54E1East Asian ideograph -54E9East Asian ideograph -54EDEast Asian ideograph -5506East Asian ideograph -5509East Asian ideograph -54E6East Asian ideograph -5556East Asian ideograph -5533East Asian ideograph -5546East Asian ideograph -554FEast Asian ideograph -555EEast Asian ideograph -5566East Asian ideograph -556AEast Asian ideograph -554AEast Asian ideograph -5544East Asian ideograph -555CEast Asian ideograph -5531East Asian ideograph -5543East Asian ideograph -552CEast Asian ideograph -5561East Asian ideograph -553EEast Asian ideograph -5563East Asian ideograph -5555East Asian ideograph -552FEast Asian ideograph -552EEast Asian ideograph -5564East Asian ideograph -5538East Asian ideograph -55A7East Asian ideograph -5580East Asian ideograph -557BEast Asian ideograph -557CEast Asian ideograph -5527East Asian ideograph -5594East Asian ideograph -5587East Asian ideograph -559CEast Asian ideograph -558BEast Asian ideograph -55AAEast Asian ideograph -55B3East Asian ideograph -558AEast Asian ideograph -5583East Asian ideograph -55B1East Asian ideograph -55AEEast Asian ideograph -5582East Asian ideograph -559FEast Asian ideograph -559DEast Asian ideograph -5598East Asian ideograph -559AEast Asian ideograph -557EEast Asian ideograph -55ACEast Asian ideograph -5589East Asian ideograph -55B2East Asian ideograph -55BBEast Asian ideograph -55E8East Asian ideograph -55DFEast Asian ideograph -55D1East Asian ideograph -55DCEast Asian ideograph -55E6East Asian ideograph -55C7East Asian ideograph -55D3East Asian ideograph -55CEEast Asian ideograph -55E3East Asian ideograph -55EFEast Asian ideograph -55E4East Asian ideograph -55C5East Asian ideograph -55DAEast Asian ideograph -55C6East Asian ideograph -55E1East Asian ideograph -5600East Asian ideograph -561BEast Asian ideograph -55FEEast Asian ideograph -5616East Asian ideograph -55F7East Asian ideograph -5608East Asian ideograph -561FEast Asian ideograph -55FDEast Asian ideograph -E9325606Variant of 4B372C which maps to 5606 -5609East Asian ideograph -5614East Asian ideograph -560EEast Asian ideograph -5617East Asian ideograph -560DEast Asian ideograph -562EEast Asian ideograph -562FEast Asian ideograph -564EEast Asian ideograph -5636East Asian ideograph -5632East Asian ideograph -563BEast Asian ideograph -5639East Asian ideograph -5657East Asian ideograph -5653East Asian ideograph -563FEast Asian ideograph -5634East Asian ideograph -5637East Asian ideograph -5659East Asian ideograph -5630East Asian ideograph -566BEast Asian ideograph -5664East Asian ideograph -5669East Asian ideograph -5678East Asian ideograph -5674East Asian ideograph -5679East Asian ideograph -5665East Asian ideograph -566AEast Asian ideograph -5668East Asian ideograph -5671East Asian ideograph -566FEast Asian ideograph -E9335662Variant of 4B374C which maps to 5662 -566CEast Asian ideograph -5680East Asian ideograph -568EEast Asian ideograph -5685East Asian ideograph -5687East Asian ideograph -5690East Asian ideograph -568FEast Asian ideograph -5695East Asian ideograph -E93456AEVariant of 453755 which maps to 56AE -56A8East Asian ideograph -56B0East Asian ideograph -56A5East Asian ideograph -56B7East Asian ideograph -56B4East Asian ideograph -56B6East Asian ideograph -56C0East Asian ideograph -56C1East Asian ideograph -56C2East Asian ideograph -56BCEast Asian ideograph -56CAEast Asian ideograph -56C9East Asian ideograph -56C8East Asian ideograph -56D1East Asian ideograph -56DBEast Asian ideograph -56DAEast Asian ideograph -56E0East Asian ideograph -56DEEast Asian ideograph -56E4East Asian ideograph -56F1East Asian ideograph -56FAEast Asian ideograph -5703East Asian ideograph -5708East Asian ideograph -570BEast Asian ideograph -570DEast Asian ideograph -5712East Asian ideograph -5713East Asian ideograph -5718East Asian ideograph -5716East Asian ideograph -571FEast Asian ideograph -572DEast Asian ideograph -572FEast Asian ideograph -5730East Asian ideograph -5728East Asian ideograph -5733East Asian ideograph -5751East Asian ideograph -574AEast Asian ideograph -5740East Asian ideograph -5747East Asian ideograph -574DEast Asian ideograph -573EEast Asian ideograph -574EEast Asian ideograph -5783East Asian ideograph -576AEast Asian ideograph -5769East Asian ideograph -5777East Asian ideograph -5761East Asian ideograph -5764East Asian ideograph -5766East Asian ideograph -5782East Asian ideograph -577CEast Asian ideograph -57A0East Asian ideograph -578BEast Asian ideograph -57A3East Asian ideograph -57AEEast Asian ideograph -57A2East Asian ideograph -57D4East Asian ideograph -57C2East Asian ideograph -57CEEast Asian ideograph -57CBEast Asian ideograph -57C3East Asian ideograph -57F9East Asian ideograph -57F7East Asian ideograph -57FAEast Asian ideograph -57DFEast Asian ideograph -580AEast Asian ideograph -5805East Asian ideograph -5802East Asian ideograph -5806East Asian ideograph -57E4East Asian ideograph -57E0East Asian ideograph -5831East Asian ideograph -582FEast Asian ideograph -5835East Asian ideograph -582AEast Asian ideograph -5830East Asian ideograph -5824East Asian ideograph -5834East Asian ideograph -5821East Asian ideograph -585EEast Asian ideograph -5857East Asian ideograph -5858East Asian ideograph -5851East Asian ideograph -586BEast Asian ideograph -584CEast Asian ideograph -585AEast Asian ideograph -586DEast Asian ideograph -5854East Asian ideograph -5862East Asian ideograph -584AEast Asian ideograph -5883East Asian ideograph -587EEast Asian ideograph -5875East Asian ideograph -588AEast Asian ideograph -5879East Asian ideograph -5885East Asian ideograph -5893East Asian ideograph -589EEast Asian ideograph -5880East Asian ideograph -58B3East Asian ideograph -589CEast Asian ideograph -58AEEast Asian ideograph -589FEast Asian ideograph -E93558C7Variant of 4B3864 which maps to 58C7 -58C5East Asian ideograph -58C1East Asian ideograph -58BEEast Asian ideograph -58D5East Asian ideograph -58D3East Asian ideograph -58D1East Asian ideograph -58D9East Asian ideograph -58D8East Asian ideograph -58DFEast Asian ideograph -58DEEast Asian ideograph -58E2East Asian ideograph -58E4East Asian ideograph -58E9East Asian ideograph -58EBEast Asian ideograph -58ECEast Asian ideograph -58EFEast Asian ideograph -58FAEast Asian ideograph -58FDEast Asian ideograph -590FEast Asian ideograph -5914East Asian ideograph -5915East Asian ideograph -5916East Asian ideograph -5919East Asian ideograph -591AEast Asian ideograph -591CEast Asian ideograph -5920East Asian ideograph -5924East Asian ideograph -5925East Asian ideograph -5922East Asian ideograph -5927East Asian ideograph -592AEast Asian ideograph -592BEast Asian ideograph -5929East Asian ideograph -592DEast Asian ideograph -592EEast Asian ideograph -5931East Asian ideograph -5937East Asian ideograph -593EEast Asian ideograph -5954East Asian ideograph -5949East Asian ideograph -5948East Asian ideograph -5947East Asian ideograph -5944East Asian ideograph -5955East Asian ideograph -5951East Asian ideograph -594EEast Asian ideograph -594FEast Asian ideograph -5950East Asian ideograph -5957East Asian ideograph -5958East Asian ideograph -595AEast Asian ideograph -5960East Asian ideograph -5962East Asian ideograph -5967East Asian ideograph -5969East Asian ideograph -596AEast Asian ideograph -596EEast Asian ideograph -5973East Asian ideograph -5974East Asian ideograph -5976East Asian ideograph -5984East Asian ideograph -5983East Asian ideograph -5978East Asian ideograph -597DEast Asian ideograph -5979East Asian ideograph -5982East Asian ideograph -5981East Asian ideograph -59A8East Asian ideograph -5992East Asian ideograph -59A4East Asian ideograph -59A3East Asian ideograph -5993East Asian ideograph -599EEast Asian ideograph -599DEast Asian ideograph -5999East Asian ideograph -59A5East Asian ideograph -598AEast Asian ideograph -5996East Asian ideograph -59BEEast Asian ideograph -59BBEast Asian ideograph -59AEEast Asian ideograph -59D1East Asian ideograph -59B9East Asian ideograph -59C6East Asian ideograph -59D0East Asian ideograph -59D7East Asian ideograph -59AFEast Asian ideograph -59D2East Asian ideograph -59D3East Asian ideograph -59CAEast Asian ideograph -59CBEast Asian ideograph -59D4East Asian ideograph -59E3East Asian ideograph -59FFEast Asian ideograph -59D8East Asian ideograph -5A03East Asian ideograph -59E8East Asian ideograph -59E5East Asian ideograph -59EAEast Asian ideograph -5A01East Asian ideograph -59FBEast Asian ideograph -59E6East Asian ideograph -59DAEast Asian ideograph -5A11East Asian ideograph -5A18East Asian ideograph -5A23East Asian ideograph -5A1CEast Asian ideograph -5A13East Asian ideograph -59ECEast Asian ideograph -5A20East Asian ideograph -5A1FEast Asian ideograph -5A1BEast Asian ideograph -5A0CEast Asian ideograph -5A29East Asian ideograph -5A25East Asian ideograph -5A46East Asian ideograph -5A49East Asian ideograph -5A6AEast Asian ideograph -5A36East Asian ideograph -5A4AEast Asian ideograph -5A40East Asian ideograph -5A66East Asian ideograph -5A41East Asian ideograph -5A3CEast Asian ideograph -5A62East Asian ideograph -5A5AEast Asian ideograph -5A77East Asian ideograph -5A9AEast Asian ideograph -5A92East Asian ideograph -5A7FEast Asian ideograph -5ABCEast Asian ideograph -5A9BEast Asian ideograph -5ACCEast Asian ideograph -5AC1East Asian ideograph -5AC9East Asian ideograph -5ABEEast Asian ideograph -5ABDEast Asian ideograph -5AB2East Asian ideograph -5AC2East Asian ideograph -5AB3East Asian ideograph -5AE1East Asian ideograph -5AD7East Asian ideograph -5AD6East Asian ideograph -5AE3East Asian ideograph -5AE9East Asian ideograph -5AD8East Asian ideograph -5AE6East Asian ideograph -5AFBEast Asian ideograph -5B09East Asian ideograph -5B0BEast Asian ideograph -5B0CEast Asian ideograph -5AF5East Asian ideograph -5B34East Asian ideograph -5B1DEast Asian ideograph -5B2AEast Asian ideograph -5B24East Asian ideograph -5B30East Asian ideograph -5B38East Asian ideograph -5B40East Asian ideograph -5B50East Asian ideograph -5B51East Asian ideograph -5B53East Asian ideograph -5B54East Asian ideograph -5B55East Asian ideograph -5B57East Asian ideograph -5B58East Asian ideograph -5B5DEast Asian ideograph -5B5CEast Asian ideograph -5B5FEast Asian ideograph -5B63East Asian ideograph -5B64East Asian ideograph -5B69East Asian ideograph -5B6BEast Asian ideograph -5B70East Asian ideograph -5B73East Asian ideograph -5B71East Asian ideograph -5B75East Asian ideograph -5B78East Asian ideograph -5B7AEast Asian ideograph -5B7DEast Asian ideograph -5B7FEast Asian ideograph -5B87East Asian ideograph -5B88East Asian ideograph -5B89East Asian ideograph -5B85East Asian ideograph -5B8CEast Asian ideograph -5B8BEast Asian ideograph -5B8FEast Asian ideograph -5B97East Asian ideograph -5B9AEast Asian ideograph -5B9CEast Asian ideograph -5B98East Asian ideograph -5B99East Asian ideograph -5B9BEast Asian ideograph -5BA5East Asian ideograph -5BA3East Asian ideograph -5BA6East Asian ideograph -5BA4East Asian ideograph -5BA2East Asian ideograph -5BB0East Asian ideograph -5BB8East Asian ideograph -5BB5East Asian ideograph -5BB4East Asian ideograph -5BAEEast Asian ideograph -5BB9East Asian ideograph -5BB3East Asian ideograph -5BC6East Asian ideograph -5BC7East Asian ideograph -5BC5East Asian ideograph -5BC4East Asian ideograph -5BC2East Asian ideograph -5BBFEast Asian ideograph -5BCCEast Asian ideograph -5BD2East Asian ideograph -5BD0East Asian ideograph -5BD3East Asian ideograph -5BE1East Asian ideograph -5BE5East Asian ideograph -5BE8East Asian ideograph -5BE2East Asian ideograph -5BE4East Asian ideograph -5BDEEast Asian ideograph -5BE6East Asian ideograph -5BE7East Asian ideograph -5BDFEast Asian ideograph -5BEEEast Asian ideograph -5BECEast Asian ideograph -5BE9East Asian ideograph -5BEBEast Asian ideograph -5BF5East Asian ideograph -5BF6East Asian ideograph -5BF8East Asian ideograph -5BFAEast Asian ideograph -5C01East Asian ideograph -5C04East Asian ideograph -5C09East Asian ideograph -5C08East Asian ideograph -5C07East Asian ideograph -5C0AEast Asian ideograph -5C0BEast Asian ideograph -5C0DEast Asian ideograph -5C0EEast Asian ideograph -5C0FEast Asian ideograph -5C11East Asian ideograph -5C16East Asian ideograph -5C1AEast Asian ideograph -5C24East Asian ideograph -5C2CEast Asian ideograph -5C31East Asian ideograph -5C37East Asian ideograph -5C38East Asian ideograph -5C3AEast Asian ideograph -5C3CEast Asian ideograph -5C40East Asian ideograph -5C41East Asian ideograph -5C3FEast Asian ideograph -5C3EEast Asian ideograph -5C46East Asian ideograph -5C45East Asian ideograph -5C48East Asian ideograph -5C4EEast Asian ideograph -5C4BEast Asian ideograph -5C4DEast Asian ideograph -5C55East Asian ideograph -5C51East Asian ideograph -5C50East Asian ideograph -E9E1East Asian ideograph not in Unicode -5C60East Asian ideograph -5C5CEast Asian ideograph -5C62East Asian ideograph -E9365C64Variant of 4B3B61 which maps to 5C64 -5C65East Asian ideograph -5C6CEast Asian ideograph -5C6FEast Asian ideograph -5C71East Asian ideograph -5C79East Asian ideograph -5C90East Asian ideograph -5C8CEast Asian ideograph -5C91East Asian ideograph -5C94East Asian ideograph -5CB7East Asian ideograph -5CB8East Asian ideograph -5CA1East Asian ideograph -5CABEast Asian ideograph -5CB1East Asian ideograph -5CD9East Asian ideograph -5D01East Asian ideograph -5CFDEast Asian ideograph -5CEDEast Asian ideograph -5CFBEast Asian ideograph -5CE8East Asian ideograph -5CF0East Asian ideograph -5CF6East Asian ideograph -5CEAEast Asian ideograph -5D07East Asian ideograph -5D06East Asian ideograph -5D1BEast Asian ideograph -5D16East Asian ideograph -5D0EEast Asian ideograph -5D11East Asian ideograph -5D22East Asian ideograph -5D29East Asian ideograph -5D14East Asian ideograph -5D19East Asian ideograph -5D4CEast Asian ideograph -5D50East Asian ideograph -5D69East Asian ideograph -5D84East Asian ideograph -5D87East Asian ideograph -5D9DEast Asian ideograph -5DBCEast Asian ideograph -5DBDEast Asian ideograph -E9375DBAVariant of 4B3C2F which maps to 5DBA -5DCDEast Asian ideograph -5DD2East Asian ideograph -5DD4East Asian ideograph -5DD6East Asian ideograph -5DDDEast Asian ideograph -5DDEEast Asian ideograph -5DE2East Asian ideograph -5DE5East Asian ideograph -5DE8East Asian ideograph -5DE7East Asian ideograph -5DE6East Asian ideograph -5DEBEast Asian ideograph -5DEEEast Asian ideograph -5DF1East Asian ideograph -5DF2East Asian ideograph -5DF3East Asian ideograph -5DF4East Asian ideograph -5DF7East Asian ideograph -5DFDEast Asian ideograph -5DFEEast Asian ideograph -5E02East Asian ideograph -5E06East Asian ideograph -5E1AEast Asian ideograph -5E16East Asian ideograph -5E15East Asian ideograph -5E1BEast Asian ideograph -5E11East Asian ideograph -5E1DEast Asian ideograph -5E25East Asian ideograph -5E2BEast Asian ideograph -5E33East Asian ideograph -5E36East Asian ideograph -5E38East Asian ideograph -5E37East Asian ideograph -5E45East Asian ideograph -5E3DEast Asian ideograph -5E40East Asian ideograph -5E4CEast Asian ideograph -5E5BEast Asian ideograph -5E54East Asian ideograph -5E57East Asian ideograph -5E55East Asian ideograph -5E63East Asian ideograph -5E62East Asian ideograph -5E5FEast Asian ideograph -5E6BEast Asian ideograph -5E73East Asian ideograph -5E74East Asian ideograph -5E7BEast Asian ideograph -5E7CEast Asian ideograph -5E7DEast Asian ideograph -5E7EEast Asian ideograph -5E8FEast Asian ideograph -5E87East Asian ideograph -5E8AEast Asian ideograph -5E9AEast Asian ideograph -5E97East Asian ideograph -5E96East Asian ideograph -5E9CEast Asian ideograph -5E95East Asian ideograph -5EA0East Asian ideograph -5EA6East Asian ideograph -5EABEast Asian ideograph -5EA7East Asian ideograph -5EADEast Asian ideograph -5EB7East Asian ideograph -5EB8East Asian ideograph -5EB6East Asian ideograph -5EB5East Asian ideograph -5EC2East Asian ideograph -5EC1East Asian ideograph -5EBEEast Asian ideograph -5ECAEast Asian ideograph -5EC9East Asian ideograph -5EC8East Asian ideograph -5ED3East Asian ideograph -5ED6East Asian ideograph -5EE2East Asian ideograph -5EDAEast Asian ideograph -5EDDEast Asian ideograph -E9385EE3Variant of 4B3D2A which maps to 5EE3 -5EDFEast Asian ideograph -5EE0East Asian ideograph -9F90East Asian ideograph -5EECEast Asian ideograph -5EF3East Asian ideograph -5EF7East Asian ideograph -5EF6East Asian ideograph -5EFAEast Asian ideograph -5EFFEast Asian ideograph -5F04East Asian ideograph -5F08East Asian ideograph -5F0AEast Asian ideograph -5F0FEast Asian ideograph -5F12East Asian ideograph -5F13East Asian ideograph -5F15East Asian ideograph -5F14East Asian ideograph -5F18East Asian ideograph -5F17East Asian ideograph -5F1BEast Asian ideograph -5F1FEast Asian ideograph -5F26East Asian ideograph -5F27East Asian ideograph -5F29East Asian ideograph -5F2DEast Asian ideograph -5F31East Asian ideograph -5F35East Asian ideograph -5F37East Asian ideograph -5F3CEast Asian ideograph -5F46East Asian ideograph -5F48East Asian ideograph -5F4CEast Asian ideograph -5F4EEast Asian ideograph -5F57East Asian ideograph -5F59East Asian ideograph -5F5DEast Asian ideograph -5F62East Asian ideograph -5F64East Asian ideograph -5F65East Asian ideograph -5F6CEast Asian ideograph -5F69East Asian ideograph -5F6DEast Asian ideograph -5F70East Asian ideograph -5F71East Asian ideograph -5F79East Asian ideograph -5F80East Asian ideograph -5F7FEast Asian ideograph -5F7CEast Asian ideograph -5F85East Asian ideograph -5F88East Asian ideograph -5F8BEast Asian ideograph -5F8AEast Asian ideograph -5F87East Asian ideograph -5F8CEast Asian ideograph -5F92East Asian ideograph -5F91East Asian ideograph -5F90East Asian ideograph -5F98East Asian ideograph -5F97East Asian ideograph -5F99East Asian ideograph -5F9EEast Asian ideograph -5FA9East Asian ideograph -5FAAEast Asian ideograph -5FACEast Asian ideograph -5FAEEast Asian ideograph -5FB9East Asian ideograph -5FB7East Asian ideograph -5FB5East Asian ideograph -5FBDEast Asian ideograph -5FC3East Asian ideograph -5FC5East Asian ideograph -5FD9East Asian ideograph -5FD8East Asian ideograph -5FCCEast Asian ideograph -5FD6East Asian ideograph -5FCDEast Asian ideograph -5FEBEast Asian ideograph -5FE0East Asian ideograph -5FF1East Asian ideograph -5FFDEast Asian ideograph -5FDDEast Asian ideograph -5FF5East Asian ideograph -5FFFEast Asian ideograph -6014East Asian ideograph -E9396035Variant of 4B3E2A which maps to 6035 -602AEast Asian ideograph -602FEast Asian ideograph -6016East Asian ideograph -601DEast Asian ideograph -600FEast Asian ideograph -6021East Asian ideograph -6020East Asian ideograph -6028East Asian ideograph -6025East Asian ideograph -6027East Asian ideograph -600EEast Asian ideograph -6015East Asian ideograph -6012East Asian ideograph -6059East Asian ideograph -6063East Asian ideograph -6068East Asian ideograph -6043East Asian ideograph -6065East Asian ideograph -6050East Asian ideograph -606DEast Asian ideograph -6062East Asian ideograph -E93A6046Variant of 4B3E40 which maps to 6046 -604DEast Asian ideograph -606BEast Asian ideograph -6069East Asian ideograph -606CEast Asian ideograph -606FEast Asian ideograph -606AEast Asian ideograph -6064East Asian ideograph -6070East Asian ideograph -6055East Asian ideograph -608CEast Asian ideograph -60A6East Asian ideograph -607FEast Asian ideograph -609FEast Asian ideograph -609AEast Asian ideograph -6096East Asian ideograph -6084East Asian ideograph -608DEast Asian ideograph -60A3East Asian ideograph -6089East Asian ideograph -6094East Asian ideograph -60A0East Asian ideograph -60A8East Asian ideograph -60B4East Asian ideograph -60E6East Asian ideograph -60CBEast Asian ideograph -E93B60C5Variant of 4B3E5B which maps to 60C5 -60B6East Asian ideograph -60D1East Asian ideograph -60B5East Asian ideograph -60BBEast Asian ideograph -60E0East Asian ideograph -60E1East Asian ideograph -60DCEast Asian ideograph -60D8East Asian ideograph -60D5East Asian ideograph -60BCEast Asian ideograph -60B2East Asian ideograph -60C6East Asian ideograph -60B8East Asian ideograph -60DAEast Asian ideograph -60DFEast Asian ideograph -610FEast Asian ideograph -611CEast Asian ideograph -60F3East Asian ideograph -611FEast Asian ideograph -60F0East Asian ideograph -60FBEast Asian ideograph -60FAEast Asian ideograph -611AEast Asian ideograph -6115East Asian ideograph -60F9East Asian ideograph -6123East Asian ideograph -60F4East Asian ideograph -611BEast Asian ideograph -610EEast Asian ideograph -6100East Asian ideograph -6101East Asian ideograph -60F6East Asian ideograph -6109East Asian ideograph -6108East Asian ideograph -60F1East Asian ideograph -6148East Asian ideograph -6168East Asian ideograph -613CEast Asian ideograph -614CEast Asian ideograph -614DEast Asian ideograph -614BEast Asian ideograph -613EEast Asian ideograph -6127East Asian ideograph -6134East Asian ideograph -6147East Asian ideograph -6177East Asian ideograph -6176East Asian ideograph -6167East Asian ideograph -6170East Asian ideograph -615AEast Asian ideograph -615DEast Asian ideograph -6182East Asian ideograph -617CEast Asian ideograph -6162East Asian ideograph -616EEast Asian ideograph -6155East Asian ideograph -6158East Asian ideograph -6163East Asian ideograph -615FEast Asian ideograph -616BEast Asian ideograph -617EEast Asian ideograph -61A7East Asian ideograph -61B2East Asian ideograph -6191East Asian ideograph -618EEast Asian ideograph -61ABEast Asian ideograph -61A4East Asian ideograph -61ACEast Asian ideograph -619AEast Asian ideograph -61A9East Asian ideograph -6194East Asian ideograph -618AEast Asian ideograph -61B6East Asian ideograph -61CDEast Asian ideograph -61C9East Asian ideograph -6190East Asian ideograph -61BEEast Asian ideograph -61C2East Asian ideograph -61C7East Asian ideograph -61C8East Asian ideograph -61CAEast Asian ideograph -61E3East Asian ideograph -61E6East Asian ideograph -E93C61F2Variant of 4B3F53 which maps to 61F2 -61F7East Asian ideograph -61F6East Asian ideograph -61F8East Asian ideograph -61F5East Asian ideograph -61FAEast Asian ideograph -61FEEast Asian ideograph -61FFEast Asian ideograph -61FCEast Asian ideograph -6200East Asian ideograph -6208East Asian ideograph -620AEast Asian ideograph -620EEast Asian ideograph -620DEast Asian ideograph -620CEast Asian ideograph -6210East Asian ideograph -6212East Asian ideograph -6211East Asian ideograph -6216East Asian ideograph -6215East Asian ideograph -621BEast Asian ideograph -621AEast Asian ideograph -621FEast Asian ideograph -6221East Asian ideograph -6222East Asian ideograph -622AEast Asian ideograph -622EEast Asian ideograph -6230East Asian ideograph -6232East Asian ideograph -6234East Asian ideograph -6233East Asian ideograph -6236East Asian ideograph -623FEast Asian ideograph -623EEast Asian ideograph -6240East Asian ideograph -6241East Asian ideograph -6248East Asian ideograph -6249East Asian ideograph -624BEast Asian ideograph -6253East Asian ideograph -6254East Asian ideograph -6252East Asian ideograph -625BEast Asian ideograph -6263East Asian ideograph -6258East Asian ideograph -6296East Asian ideograph -6297East Asian ideograph -6292East Asian ideograph -6276East Asian ideograph -6289East Asian ideograph -627FEast Asian ideograph -6279East Asian ideograph -6280East Asian ideograph -628AEast Asian ideograph -626DEast Asian ideograph -627CEast Asian ideograph -627EEast Asian ideograph -626FEast Asian ideograph -6284East Asian ideograph -6295East Asian ideograph -6291East Asian ideograph -6298East Asian ideograph -626EEast Asian ideograph -6273East Asian ideograph -6293East Asian ideograph -62C9East Asian ideograph -62C4East Asian ideograph -62CCEast Asian ideograph -62A8East Asian ideograph -62DCEast Asian ideograph -62BFEast Asian ideograph -62C2East Asian ideograph -62B9East Asian ideograph -62D2East Asian ideograph -62D3East Asian ideograph -62DBEast Asian ideograph -62ABEast Asian ideograph -62CBEast Asian ideograph -62D4East Asian ideograph -62BDEast Asian ideograph -62BCEast Asian ideograph -E93D62D0Variant of 4B4049 which maps to 62D0 -62C8East Asian ideograph -62D9East Asian ideograph -62DAEast Asian ideograph -62ACEast Asian ideograph -62C7East Asian ideograph -62B1East Asian ideograph -62D6East Asian ideograph -62D8East Asian ideograph -62CDEast Asian ideograph -62B5East Asian ideograph -62CEEast Asian ideograph -62D7East Asian ideograph -62C6East Asian ideograph -6309East Asian ideograph -6316East Asian ideograph -62FCEast Asian ideograph -62F3East Asian ideograph -6308East Asian ideograph -62EDEast Asian ideograph -6301East Asian ideograph -62EEEast Asian ideograph -62EFEast Asian ideograph -62F7East Asian ideograph -6307East Asian ideograph -62F1East Asian ideograph -62FDEast Asian ideograph -6311East Asian ideograph -62ECEast Asian ideograph -E93E62F4Variant of 4B4066 which maps to 62F4 -62FFEast Asian ideograph -6342East Asian ideograph -632AEast Asian ideograph -6355East Asian ideograph -633EEast Asian ideograph -632FEast Asian ideograph -634EEast Asian ideograph -634FEast Asian ideograph -6350East Asian ideograph -6349East Asian ideograph -632BEast Asian ideograph -6328East Asian ideograph -633AEast Asian ideograph -63A5East Asian ideograph -6369East Asian ideograph -63A0East Asian ideograph -6396East Asian ideograph -63A7East Asian ideograph -6372East Asian ideograph -6377East Asian ideograph -6383East Asian ideograph -636BEast Asian ideograph -6367East Asian ideograph -6398East Asian ideograph -639BEast Asian ideograph -63AAEast Asian ideograph -6371East Asian ideograph -63A9East Asian ideograph -638CEast Asian ideograph -6389East Asian ideograph -63A2East Asian ideograph -6399East Asian ideograph -63A1East Asian ideograph -6388East Asian ideograph -63ACEast Asian ideograph -633DEast Asian ideograph -6392East Asian ideograph -63A3East Asian ideograph -6376East Asian ideograph -638FEast Asian ideograph -63A8East Asian ideograph -637BEast Asian ideograph -E93F6368Variant of 4B4135 which maps to 6368 -6384East Asian ideograph -6380East Asian ideograph -63C6East Asian ideograph -63C9East Asian ideograph -63CDEast Asian ideograph -63E1East Asian ideograph -63C0East Asian ideograph -63E9East Asian ideograph -63D0East Asian ideograph -63DAEast Asian ideograph -63D6East Asian ideograph -63EDEast Asian ideograph -63EEEast Asian ideograph -63CFEast Asian ideograph -63E3East Asian ideograph -63F4East Asian ideograph -E94063DBVariant of 454146 which maps to 63DB -63D2East Asian ideograph -63EAEast Asian ideograph -641EEast Asian ideograph -642AEast Asian ideograph -643EEast Asian ideograph -6413East Asian ideograph -640FEast Asian ideograph -6414East Asian ideograph -640DEast Asian ideograph -642DEast Asian ideograph -643DEast Asian ideograph -6416East Asian ideograph -6417East Asian ideograph -641CEast Asian ideograph -6436East Asian ideograph -642CEast Asian ideograph -6458East Asian ideograph -6469East Asian ideograph -6454East Asian ideograph -6452East Asian ideograph -646FEast Asian ideograph -6478East Asian ideograph -6479East Asian ideograph -647AEast Asian ideograph -645FEast Asian ideograph -6451East Asian ideograph -6467East Asian ideograph -649EEast Asian ideograph -64A4East Asian ideograph -6487East Asian ideograph -6488East Asian ideograph -64A5East Asian ideograph -64B0East Asian ideograph -6493East Asian ideograph -6495East Asian ideograph -6492East Asian ideograph -64A9East Asian ideograph -6491East Asian ideograph -64AEEast Asian ideograph -64B2East Asian ideograph -64ADEast Asian ideograph -649AEast Asian ideograph -64ABEast Asian ideograph -64ACEast Asian ideograph -64C5East Asian ideograph -64C1East Asian ideograph -64D8East Asian ideograph -64CAEast Asian ideograph -64BBEast Asian ideograph -64C2East Asian ideograph -64BCEast Asian ideograph -64CBEast Asian ideograph -64CDEast Asian ideograph -64DAEast Asian ideograph -64C4East Asian ideograph -64C7East Asian ideograph -64CEEast Asian ideograph -64D4East Asian ideograph -64D2East Asian ideograph -64BFEast Asian ideograph -64E0East Asian ideograph -64F0East Asian ideograph -64E6East Asian ideograph -64ECEast Asian ideograph -64F1East Asian ideograph -64F4East Asian ideograph -64F2East Asian ideograph -6506East Asian ideograph -6500East Asian ideograph -64FEEast Asian ideograph -64FBEast Asian ideograph -64FAEast Asian ideograph -650FEast Asian ideograph -6518East Asian ideograph -6514East Asian ideograph -6519East Asian ideograph -651DEast Asian ideograph -651CEast Asian ideograph -6523East Asian ideograph -6524East Asian ideograph -652BEast Asian ideograph -652AEast Asian ideograph -652CEast Asian ideograph -652FEast Asian ideograph -6536East Asian ideograph -6539East Asian ideograph -653BEast Asian ideograph -653EEast Asian ideograph -653FEast Asian ideograph -6545East Asian ideograph -6548East Asian ideograph -654EEast Asian ideograph -6556East Asian ideograph -6551East Asian ideograph -6557East Asian ideograph -655DEast Asian ideograph -6558East Asian ideograph -654FEast Asian ideograph -6566East Asian ideograph -6562East Asian ideograph -6563East Asian ideograph -655EEast Asian ideograph -5553East Asian ideograph -656CEast Asian ideograph -6572East Asian ideograph -6575East Asian ideograph -6577East Asian ideograph -6578East Asian ideograph -6574East Asian ideograph -6582East Asian ideograph -6583East Asian ideograph -6587East Asian ideograph -6591East Asian ideograph -6590East Asian ideograph -6599East Asian ideograph -659CEast Asian ideograph -659FEast Asian ideograph -65A1East Asian ideograph -65A4East Asian ideograph -65A5East Asian ideograph -65A7East Asian ideograph -65ACEast Asian ideograph -65AFEast Asian ideograph -65B0East Asian ideograph -65B7East Asian ideograph -65B9East Asian ideograph -65BDEast Asian ideograph -65C1East Asian ideograph -65C5East Asian ideograph -65CEEast Asian ideograph -65CBEast Asian ideograph -65CCEast Asian ideograph -65CFEast Asian ideograph -65D7East Asian ideograph -65D6East Asian ideograph -65E2East Asian ideograph -65E5East Asian ideograph -65E9East Asian ideograph -65ECEast Asian ideograph -65EDEast Asian ideograph -65E8East Asian ideograph -65F1East Asian ideograph -65FAEast Asian ideograph -6606East Asian ideograph -6614East Asian ideograph -660CEast Asian ideograph -6600East Asian ideograph -660EEast Asian ideograph -6613East Asian ideograph -6602East Asian ideograph -660FEast Asian ideograph -6625East Asian ideograph -6627East Asian ideograph -662FEast Asian ideograph -662DEast Asian ideograph -6620East Asian ideograph -661FEast Asian ideograph -6628East Asian ideograph -664FEast Asian ideograph -6642East Asian ideograph -6652East Asian ideograph -6649East Asian ideograph -6643East Asian ideograph -664CEast Asian ideograph -665DEast Asian ideograph -6664East Asian ideograph -6668East Asian ideograph -6666East Asian ideograph -665AEast Asian ideograph -666FEast Asian ideograph -666EEast Asian ideograph -FA12East Asian ideograph -6691East Asian ideograph -6670East Asian ideograph -6676East Asian ideograph -667AEast Asian ideograph -6697East Asian ideograph -6687East Asian ideograph -6689East Asian ideograph -6688East Asian ideograph -6696East Asian ideograph -66A2East Asian ideograph -66ABEast Asian ideograph -66B4East Asian ideograph -66AEEast Asian ideograph -66C1East Asian ideograph -66C9East Asian ideograph -66C6East Asian ideograph -66B9East Asian ideograph -66D6East Asian ideograph -66D9East Asian ideograph -66E0East Asian ideograph -66DDEast Asian ideograph -66E6East Asian ideograph -66F0East Asian ideograph -66F2East Asian ideograph -66F3East Asian ideograph -66F4East Asian ideograph -66F7East Asian ideograph -66F8East Asian ideograph -66F9East Asian ideograph -52D7East Asian ideograph -66FEEast Asian ideograph -66FFEast Asian ideograph -6703East Asian ideograph -6708East Asian ideograph -6709East Asian ideograph -670DEast Asian ideograph -670BEast Asian ideograph -6717East Asian ideograph -6715East Asian ideograph -6714East Asian ideograph -671BEast Asian ideograph -671DEast Asian ideograph -671FEast Asian ideograph -6727East Asian ideograph -6728East Asian ideograph -672CEast Asian ideograph -672BEast Asian ideograph -672AEast Asian ideograph -673DEast Asian ideograph -6731East Asian ideograph -6735East Asian ideograph -675EEast Asian ideograph -6751East Asian ideograph -674EEast Asian ideograph -675CEast Asian ideograph -6750East Asian ideograph -6756East Asian ideograph -675FEast Asian ideograph -674FEast Asian ideograph -6749East Asian ideograph -676DEast Asian ideograph -678BEast Asian ideograph -6795East Asian ideograph -6789East Asian ideograph -6787East Asian ideograph -6777East Asian ideograph -679DEast Asian ideograph -6797East Asian ideograph -676FEast Asian ideograph -6771East Asian ideograph -6773East Asian ideograph -679CEast Asian ideograph -6775East Asian ideograph -679AEast Asian ideograph -6790East Asian ideograph -677EEast Asian ideograph -67D3East Asian ideograph -67F1East Asian ideograph -67FFEast Asian ideograph -67D4East Asian ideograph -67C4East Asian ideograph -67AFEast Asian ideograph -67D0East Asian ideograph -67D1East Asian ideograph -67EFEast Asian ideograph -67E9East Asian ideograph -67B6East Asian ideograph -67ECEast Asian ideograph -67E5East Asian ideograph -67FAEast Asian ideograph -67DAEast Asian ideograph -6805East Asian ideograph -67DEEast Asian ideograph -67B8East Asian ideograph -67CFEast Asian ideograph -67F3East Asian ideograph -6848East Asian ideograph -6821East Asian ideograph -6838East Asian ideograph -6853East Asian ideograph -6846East Asian ideograph -6842East Asian ideograph -6854East Asian ideograph -6817East Asian ideograph -683DEast Asian ideograph -6851East Asian ideograph -6829East Asian ideograph -6850East Asian ideograph -6839East Asian ideograph -67F4East Asian ideograph -6843East Asian ideograph -6840East Asian ideograph -682AEast Asian ideograph -6845East Asian ideograph -683CEast Asian ideograph -E9416813Variant of 4B4456 which maps to 6813 -6881East Asian ideograph -6893East Asian ideograph -68AFEast Asian ideograph -6876East Asian ideograph -68B0East Asian ideograph -68A7East Asian ideograph -6897East Asian ideograph -68B5East Asian ideograph -68B3East Asian ideograph -68A2East Asian ideograph -687FEast Asian ideograph -68B1East Asian ideograph -689DEast Asian ideograph -68ADEast Asian ideograph -6886East Asian ideograph -6885East Asian ideograph -68A8East Asian ideograph -689FEast Asian ideograph -6894East Asian ideograph -6883East Asian ideograph -68D5East Asian ideograph -68FAEast Asian ideograph -68C4East Asian ideograph -68F2East Asian ideograph -68D2East Asian ideograph -68E3East Asian ideograph -68DFEast Asian ideograph -68CBEast Asian ideograph -68EEEast Asian ideograph -690DEast Asian ideograph -6905East Asian ideograph -68E7East Asian ideograph -68E0East Asian ideograph -68F5East Asian ideograph -68CDEast Asian ideograph -68D7East Asian ideograph -68D8East Asian ideograph -6912East Asian ideograph -68F9East Asian ideograph -68DAEast Asian ideograph -690EEast Asian ideograph -68C9East Asian ideograph -6954East Asian ideograph -6930East Asian ideograph -6977East Asian ideograph -6975East Asian ideograph -695AEast Asian ideograph -6960East Asian ideograph -696BEast Asian ideograph -694AEast Asian ideograph -6968East Asian ideograph -695EEast Asian ideograph -696DEast Asian ideograph -6979East Asian ideograph -6953East Asian ideograph -6986East Asian ideograph -69A8East Asian ideograph -6995East Asian ideograph -699CEast Asian ideograph -6994East Asian ideograph -69C1East Asian ideograph -69B7East Asian ideograph -69AEEast Asian ideograph -699BEast Asian ideograph -69CBEast Asian ideograph -69D3East Asian ideograph -69BBEast Asian ideograph -69ABEast Asian ideograph -69CCEast Asian ideograph -69ADEast Asian ideograph -69D0East Asian ideograph -69CDEast Asian ideograph -69B4East Asian ideograph -6A1FEast Asian ideograph -69E8East Asian ideograph -6A23East Asian ideograph -69EAEast Asian ideograph -6A01East Asian ideograph -6A19East Asian ideograph -69FDEast Asian ideograph -6A1EEast Asian ideograph -6A13East Asian ideograph -6A21East Asian ideograph -69F3East Asian ideograph -6A0AEast Asian ideograph -6A02East Asian ideograph -6A05East Asian ideograph -6A3DEast Asian ideograph -6A58East Asian ideograph -6A59East Asian ideograph -6A62East Asian ideograph -6A44East Asian ideograph -6A39East Asian ideograph -6A6BEast Asian ideograph -6A3AEast Asian ideograph -6A38East Asian ideograph -6A47East Asian ideograph -6A61East Asian ideograph -6A4BEast Asian ideograph -6A35East Asian ideograph -6A5FEast Asian ideograph -6A80East Asian ideograph -6A94East Asian ideograph -6A84East Asian ideograph -6AA2East Asian ideograph -6A9CEast Asian ideograph -6AB8East Asian ideograph -6AB3East Asian ideograph -6AC3East Asian ideograph -6ABBEast Asian ideograph -6AACEast Asian ideograph -6AE5East Asian ideograph -6ADAEast Asian ideograph -6ADDEast Asian ideograph -6ADBEast Asian ideograph -6AD3East Asian ideograph -6B04East Asian ideograph -6AFBEast Asian ideograph -6B0AEast Asian ideograph -6B16East Asian ideograph -6B21East Asian ideograph -6B23East Asian ideograph -6B3EEast Asian ideograph -6B3AEast Asian ideograph -6B3DEast Asian ideograph -6B47East Asian ideograph -6B49East Asian ideograph -6B4CEast Asian ideograph -6B50East Asian ideograph -6B59East Asian ideograph -6B5FEast Asian ideograph -6B61East Asian ideograph -6B63East Asian ideograph -6B64East Asian ideograph -6B65East Asian ideograph -6B66East Asian ideograph -6B6AEast Asian ideograph -6B72East Asian ideograph -6B77East Asian ideograph -6B78East Asian ideograph -6B79East Asian ideograph -6B7BEast Asian ideograph -6B7FEast Asian ideograph -6B83East Asian ideograph -6B86East Asian ideograph -6B8AEast Asian ideograph -6B89East Asian ideograph -6B98East Asian ideograph -6B96East Asian ideograph -6BA4East Asian ideograph -6BAEEast Asian ideograph -6BAFEast Asian ideograph -6BB2East Asian ideograph -6BB5East Asian ideograph -6BB7East Asian ideograph -6BBAEast Asian ideograph -6BBCEast Asian ideograph -6BC0East Asian ideograph -6BBFEast Asian ideograph -6BC5East Asian ideograph -6BC6East Asian ideograph -6BCBEast Asian ideograph -6BCDEast Asian ideograph -6BCFEast Asian ideograph -6BD2East Asian ideograph -6BD4East Asian ideograph -6BD7East Asian ideograph -6BDBEast Asian ideograph -6BEBEast Asian ideograph -6BEFEast Asian ideograph -6BFDEast Asian ideograph -6C0FEast Asian ideograph -6C11East Asian ideograph -6C10East Asian ideograph -6C13East Asian ideograph -6C16East Asian ideograph -6C1BEast Asian ideograph -6C1FEast Asian ideograph -6C27East Asian ideograph -6C26East Asian ideograph -6C23East Asian ideograph -6C28East Asian ideograph -6C24East Asian ideograph -6C2BEast Asian ideograph -6C2EEast Asian ideograph -6C33East Asian ideograph -E9426C2FVariant of 45465B which maps to 6C2F -6C34East Asian ideograph -6C38East Asian ideograph -6C41East Asian ideograph -6C40East Asian ideograph -6C42East Asian ideograph -6C5EEast Asian ideograph -6C57East Asian ideograph -6C5FEast Asian ideograph -6C59East Asian ideograph -6C60East Asian ideograph -6C55East Asian ideograph -6C50East Asian ideograph -6C5DEast Asian ideograph -6C9BEast Asian ideograph -6C81East Asian ideograph -6C7AEast Asian ideograph -6C6AEast Asian ideograph -6C8CEast Asian ideograph -6C90East Asian ideograph -6C72East Asian ideograph -6C70East Asian ideograph -6C68East Asian ideograph -6C96East Asian ideograph -E9436C89Variant of 4B4676 which maps to 6C89 -6C99East Asian ideograph -6C7EEast Asian ideograph -6C7DEast Asian ideograph -6C92East Asian ideograph -6C83East Asian ideograph -6CB1East Asian ideograph -6CF3East Asian ideograph -6CE3East Asian ideograph -6CF0East Asian ideograph -6CB8East Asian ideograph -6CD3East Asian ideograph -6CABEast Asian ideograph -6CE5East Asian ideograph -6CBDEast Asian ideograph -6CB3East Asian ideograph -6CC4East Asian ideograph -6CD5East Asian ideograph -6CE2East Asian ideograph -6CBCEast Asian ideograph -6CAEEast Asian ideograph -6CB9East Asian ideograph -6CF1East Asian ideograph -6CC1East Asian ideograph -6CBEEast Asian ideograph -6CC5East Asian ideograph -6CD7East Asian ideograph -6CBBEast Asian ideograph -6CDBEast Asian ideograph -6CE1East Asian ideograph -6CBFEast Asian ideograph -6CCAEast Asian ideograph -6CCCEast Asian ideograph -6CC9East Asian ideograph -6D41East Asian ideograph -6D0BEast Asian ideograph -6D32East Asian ideograph -6D25East Asian ideograph -6D31East Asian ideograph -6D2AEast Asian ideograph -6D0CEast Asian ideograph -6D1EEast Asian ideograph -6D17East Asian ideograph -6D3BEast Asian ideograph -6D1BEast Asian ideograph -6D36East Asian ideograph -6D3DEast Asian ideograph -6D3EEast Asian ideograph -6D6AEast Asian ideograph -6D95East Asian ideograph -6D78East Asian ideograph -6D66East Asian ideograph -6D59East Asian ideograph -6D87East Asian ideograph -6D88East Asian ideograph -6D6CEast Asian ideograph -6D93East Asian ideograph -6D89East Asian ideograph -6D6EEast Asian ideograph -6D74East Asian ideograph -6D5AEast Asian ideograph -6D69East Asian ideograph -6D77East Asian ideograph -6DD9East Asian ideograph -6DDAEast Asian ideograph -6DF3East Asian ideograph -6DBCEast Asian ideograph -6DE4East Asian ideograph -6DB2East Asian ideograph -6DE1East Asian ideograph -6DD2East Asian ideograph -6DAEEast Asian ideograph -6DF8East Asian ideograph -6DC7East Asian ideograph -6DCBEast Asian ideograph -6DC5East Asian ideograph -6DDEEast Asian ideograph -6DAFEast Asian ideograph -6DB5East Asian ideograph -6DFAEast Asian ideograph -6DF9East Asian ideograph -6DCCEast Asian ideograph -6DF7East Asian ideograph -6DB8East Asian ideograph -6DD1East Asian ideograph -6DF1East Asian ideograph -6DE8East Asian ideograph -6DEBEast Asian ideograph -6DD8East Asian ideograph -6DFBEast Asian ideograph -6DEEEast Asian ideograph -6DF5East Asian ideograph -6D8EEast Asian ideograph -6DC6East Asian ideograph -6DEAEast Asian ideograph -6DC4East Asian ideograph -6E54East Asian ideograph -6E21East Asian ideograph -6E38East Asian ideograph -6E32East Asian ideograph -6E67East Asian ideograph -6E20East Asian ideograph -6E5BEast Asian ideograph -6E1AEast Asian ideograph -6E56East Asian ideograph -6E2FEast Asian ideograph -6E6EEast Asian ideograph -6E58East Asian ideograph -6E23East Asian ideograph -6E24East Asian ideograph -6E1BEast Asian ideograph -6E25East Asian ideograph -6E4AEast Asian ideograph -6E3AEast Asian ideograph -6E6FEast Asian ideograph -6E2DEast Asian ideograph -6E34East Asian ideograph -6E2CEast Asian ideograph -6E26East Asian ideograph -6E4DEast Asian ideograph -6E3EEast Asian ideograph -6E43East Asian ideograph -6E19East Asian ideograph -6E1DEast Asian ideograph -6ED3East Asian ideograph -6EB6East Asian ideograph -6EC2East Asian ideograph -6EAFEast Asian ideograph -6EA2East Asian ideograph -6E9DEast Asian ideograph -6EA5East Asian ideograph -6E98East Asian ideograph -6E90East Asian ideograph -6EC5East Asian ideograph -6EC7East Asian ideograph -6EBCEast Asian ideograph -6EABEast Asian ideograph -6ED1East Asian ideograph -6ECBEast Asian ideograph -6EC4East Asian ideograph -6ED4East Asian ideograph -6EAAEast Asian ideograph -6E96East Asian ideograph -6E9CEast Asian ideograph -6F33East Asian ideograph -6EF4East Asian ideograph -6EECEast Asian ideograph -6EFEEast Asian ideograph -6F29East Asian ideograph -6F14East Asian ideograph -6F3EEast Asian ideograph -6F2CEast Asian ideograph -6F32East Asian ideograph -6F0FEast Asian ideograph -E9446F22Variant of 4B4857 which maps to 6F22 -6EFFEast Asian ideograph -6F23East Asian ideograph -6F38East Asian ideograph -6F15East Asian ideograph -6F31East Asian ideograph -6F02East Asian ideograph -6F06East Asian ideograph -6EEFEast Asian ideograph -6F2BEast Asian ideograph -6F2FEast Asian ideograph -6F20East Asian ideograph -6F3FEast Asian ideograph -6EF2East Asian ideograph -6F01East Asian ideograph -6F11East Asian ideograph -6ECCEast Asian ideograph -6F2AEast Asian ideograph -6F7CEast Asian ideograph -6F88East Asian ideograph -6F84East Asian ideograph -6F51East Asian ideograph -6F64East Asian ideograph -6F97East Asian ideograph -6F54East Asian ideograph -6F7AEast Asian ideograph -6F86East Asian ideograph -6F8EEast Asian ideograph -6F6DEast Asian ideograph -6F5BEast Asian ideograph -6F6EEast Asian ideograph -6F78East Asian ideograph -6F66East Asian ideograph -6F70East Asian ideograph -6F58East Asian ideograph -6FC2East Asian ideograph -6FB1East Asian ideograph -6FC3East Asian ideograph -6FA7East Asian ideograph -6FA1East Asian ideograph -6FA4East Asian ideograph -6FC1East Asian ideograph -6FC0East Asian ideograph -6FB3East Asian ideograph -6FDFEast Asian ideograph -6FD8East Asian ideograph -6FF1East Asian ideograph -6FE0East Asian ideograph -6FEFEast Asian ideograph -E9456FEBVariant of 4B492B which maps to 6FEB -6FE1East Asian ideograph -6FE4East Asian ideograph -6F80East Asian ideograph -700BEast Asian ideograph -7009East Asian ideograph -7006East Asian ideograph -6FFAEast Asian ideograph -7011East Asian ideograph -6FFEEast Asian ideograph -700FEast Asian ideograph -701BEast Asian ideograph -701AEast Asian ideograph -7028East Asian ideograph -701DEast Asian ideograph -7015East Asian ideograph -701FEast Asian ideograph -703EEast Asian ideograph -704CEast Asian ideograph -7051East Asian ideograph -7058East Asian ideograph -7063East Asian ideograph -7064East Asian ideograph -706BEast Asian ideograph -7070East Asian ideograph -7076East Asian ideograph -707CEast Asian ideograph -7078East Asian ideograph -707DEast Asian ideograph -7095East Asian ideograph -708EEast Asian ideograph -7092East Asian ideograph -7099East Asian ideograph -708AEast Asian ideograph -70ABEast Asian ideograph -70BAEast Asian ideograph -70ACEast Asian ideograph -70B3East Asian ideograph -70AFEast Asian ideograph -70ADEast Asian ideograph -70AEEast Asian ideograph -70B8East Asian ideograph -70CAEast Asian ideograph -70E4East Asian ideograph -70D8East Asian ideograph -70C8East Asian ideograph -70D9East Asian ideograph -70CFEast Asian ideograph -70F9East Asian ideograph -7109East Asian ideograph -710AEast Asian ideograph -70FDEast Asian ideograph -7119East Asian ideograph -716EEast Asian ideograph -711AEast Asian ideograph -7136East Asian ideograph -7121East Asian ideograph -7130East Asian ideograph -7126East Asian ideograph -714EEast Asian ideograph -7149East Asian ideograph -7159East Asian ideograph -7164East Asian ideograph -7169East Asian ideograph -715CEast Asian ideograph -716CEast Asian ideograph -7166East Asian ideograph -7167East Asian ideograph -715EEast Asian ideograph -7165East Asian ideograph -714CEast Asian ideograph -717DEast Asian ideograph -7199East Asian ideograph -718AEast Asian ideograph -7184East Asian ideograph -719FEast Asian ideograph -71A8East Asian ideograph -71ACEast Asian ideograph -71B1East Asian ideograph -71D9East Asian ideograph -71BEEast Asian ideograph -71C9East Asian ideograph -71D0East Asian ideograph -71C8East Asian ideograph -71DCEast Asian ideograph -71D2East Asian ideograph -71B9East Asian ideograph -71D5East Asian ideograph -71CEEast Asian ideograph -71C3East Asian ideograph -71C4East Asian ideograph -71EEEast Asian ideograph -71E7East Asian ideograph -71DFEast Asian ideograph -71E5East Asian ideograph -71EDEast Asian ideograph -71E6East Asian ideograph -71ECEast Asian ideograph -71F4East Asian ideograph -71FBEast Asian ideograph -7206East Asian ideograph -720DEast Asian ideograph -7210East Asian ideograph -721BEast Asian ideograph -7228East Asian ideograph -722AEast Asian ideograph -722DEast Asian ideograph -722CEast Asian ideograph -7230East Asian ideograph -E9467235Variant of 4B4A3E which maps to 7235 -7236East Asian ideograph -7238East Asian ideograph -7239East Asian ideograph -723AEast Asian ideograph -723BEast Asian ideograph -723DEast Asian ideograph -723EEast Asian ideograph -7246East Asian ideograph -7247East Asian ideograph -7248East Asian ideograph -724CEast Asian ideograph -7252East Asian ideograph -7256East Asian ideograph -7258East Asian ideograph -7259East Asian ideograph -725BEast Asian ideograph -725FEast Asian ideograph -725DEast Asian ideograph -7262East Asian ideograph -7261East Asian ideograph -7260East Asian ideograph -7267East Asian ideograph -7269East Asian ideograph -726FEast Asian ideograph -7272East Asian ideograph -7274East Asian ideograph -7279East Asian ideograph -727DEast Asian ideograph -7281East Asian ideograph -7280East Asian ideograph -7284East Asian ideograph -7296East Asian ideograph -7292East Asian ideograph -729BEast Asian ideograph -72A2East Asian ideograph -72A7East Asian ideograph -72ACEast Asian ideograph -72AFEast Asian ideograph -72C4East Asian ideograph -72C2East Asian ideograph -72D9East Asian ideograph -72C0East Asian ideograph -72CEEast Asian ideograph -72D7East Asian ideograph -72D0East Asian ideograph -72E1East Asian ideograph -72E9East Asian ideograph -72E0East Asian ideograph -72FCEast Asian ideograph -72F9East Asian ideograph -72FDEast Asian ideograph -72F7East Asian ideograph -731CEast Asian ideograph -731BEast Asian ideograph -7313East Asian ideograph -7316East Asian ideograph -7319East Asian ideograph -7336East Asian ideograph -7337East Asian ideograph -7329East Asian ideograph -7325East Asian ideograph -7334East Asian ideograph -7344East Asian ideograph -733FEast Asian ideograph -733EEast Asian ideograph -7345East Asian ideograph -7350East Asian ideograph -7357East Asian ideograph -7368East Asian ideograph -7370East Asian ideograph -7372East Asian ideograph -7377East Asian ideograph -7378East Asian ideograph -7375East Asian ideograph -737AEast Asian ideograph -737BEast Asian ideograph -7380East Asian ideograph -7384East Asian ideograph -7387East Asian ideograph -7389East Asian ideograph -738BEast Asian ideograph -7396East Asian ideograph -739FEast Asian ideograph -73A8East Asian ideograph -73A9East Asian ideograph -73ABEast Asian ideograph -73BBEast Asian ideograph -73CAEast Asian ideograph -73B7East Asian ideograph -73C0East Asian ideograph -73B2East Asian ideograph -73CDEast Asian ideograph -73EDEast Asian ideograph -73EEEast Asian ideograph -73E0East Asian ideograph -7405East Asian ideograph -7409East Asian ideograph -7403East Asian ideograph -740AEast Asian ideograph -73FEEast Asian ideograph -7406East Asian ideograph -740DEast Asian ideograph -743AEast Asian ideograph -7435East Asian ideograph -7436East Asian ideograph -7434East Asian ideograph -742AEast Asian ideograph -7433East Asian ideograph -7422East Asian ideograph -7425East Asian ideograph -7455East Asian ideograph -745FEast Asian ideograph -745AEast Asian ideograph -7441East Asian ideograph -743FEast Asian ideograph -745BEast Asian ideograph -745EEast Asian ideograph -745CEast Asian ideograph -7459East Asian ideograph -7483East Asian ideograph -7469East Asian ideograph -746AEast Asian ideograph -7463East Asian ideograph -7464East Asian ideograph -7470East Asian ideograph -748BEast Asian ideograph -E947749CVariant of 4B4B63 which maps to 749C -74A3East Asian ideograph -74A7East Asian ideograph -74A9East Asian ideograph -74B0East Asian ideograph -74A6East Asian ideograph -74BDEast Asian ideograph -74CAEast Asian ideograph -74CFEast Asian ideograph -74DCEast Asian ideograph -74E0East Asian ideograph -74E2East Asian ideograph -74E3East Asian ideograph -74E6East Asian ideograph -74F6East Asian ideograph -74F7East Asian ideograph -7504East Asian ideograph -750CEast Asian ideograph -7515East Asian ideograph -7518East Asian ideograph -751AEast Asian ideograph -751CEast Asian ideograph -751FEast Asian ideograph -7522East Asian ideograph -7526East Asian ideograph -7525East Asian ideograph -7528East Asian ideograph -7529East Asian ideograph -752CEast Asian ideograph -752BEast Asian ideograph -752DEast Asian ideograph -7530East Asian ideograph -7532East Asian ideograph -7531East Asian ideograph -7533East Asian ideograph -7537East Asian ideograph -7538East Asian ideograph -753DEast Asian ideograph -754FEast Asian ideograph -754CEast Asian ideograph -755DEast Asian ideograph -755CEast Asian ideograph -7554East Asian ideograph -755AEast Asian ideograph -7559East Asian ideograph -7566East Asian ideograph -7562East Asian ideograph -7570East Asian ideograph -7565East Asian ideograph -756BEast Asian ideograph -756AEast Asian ideograph -7578East Asian ideograph -7576East Asian ideograph -7586East Asian ideograph -7587East Asian ideograph -758AEast Asian ideograph -758FEast Asian ideograph -7591East Asian ideograph -759DEast Asian ideograph -7599East Asian ideograph -759AEast Asian ideograph -75A4East Asian ideograph -75ABEast Asian ideograph -75A5East Asian ideograph -75C7East Asian ideograph -75C5East Asian ideograph -75B3East Asian ideograph -75B2East Asian ideograph -75BDEast Asian ideograph -75BEEast Asian ideograph -75BCEast Asian ideograph -75B9East Asian ideograph -75D5East Asian ideograph -75D4East Asian ideograph -75B5East Asian ideograph -E94875CAVariant of 4B4C51 which maps to 75CA -75DBEast Asian ideograph -75E3East Asian ideograph -75D8East Asian ideograph -75DEEast Asian ideograph -75D9East Asian ideograph -75E2East Asian ideograph -7601East Asian ideograph -7600East Asian ideograph -75F0East Asian ideograph -75F2East Asian ideograph -75F1East Asian ideograph -75F4East Asian ideograph -75FFEast Asian ideograph -75FAEast Asian ideograph -760DEast Asian ideograph -7627East Asian ideograph -7613East Asian ideograph -760BEast Asian ideograph -7620East Asian ideograph -7629East Asian ideograph -761FEast Asian ideograph -7624East Asian ideograph -7626East Asian ideograph -7621East Asian ideograph -7634East Asian ideograph -7638East Asian ideograph -7646East Asian ideograph -7642East Asian ideograph -764CEast Asian ideograph -7656East Asian ideograph -7658East Asian ideograph -7662East Asian ideograph -7665East Asian ideograph -7669East Asian ideograph -766EEast Asian ideograph -766CEast Asian ideograph -7671East Asian ideograph -E9497672Variant of 4B4C79 which maps to 7672 -7678East Asian ideograph -767CEast Asian ideograph -767BEast Asian ideograph -767DEast Asian ideograph -767EEast Asian ideograph -7682East Asian ideograph -7684East Asian ideograph -7687East Asian ideograph -7686East Asian ideograph -768EEast Asian ideograph -7696East Asian ideograph -7693East Asian ideograph -769AEast Asian ideograph -76AEEast Asian ideograph -76B0East Asian ideograph -76B4East Asian ideograph -76BAEast Asian ideograph -76BFEast Asian ideograph -76C2East Asian ideograph -76C8East Asian ideograph -76C6East Asian ideograph -76CAEast Asian ideograph -76CDEast Asian ideograph -76CEEast Asian ideograph -76D4East Asian ideograph -76D2East Asian ideograph -76DCEast Asian ideograph -76DBEast Asian ideograph -76DEEast Asian ideograph -76DFEast Asian ideograph -76E1East Asian ideograph -76E3East Asian ideograph -76E4East Asian ideograph -76E7East Asian ideograph -76E5East Asian ideograph -76EAEast Asian ideograph -76EEEast Asian ideograph -76EFEast Asian ideograph -76F2East Asian ideograph -76F4East Asian ideograph -7709East Asian ideograph -76F9East Asian ideograph -76F8East Asian ideograph -7701East Asian ideograph -770BEast Asian ideograph -76FCEast Asian ideograph -76FEEast Asian ideograph -7729East Asian ideograph -7720East Asian ideograph -771EEast Asian ideograph -7728East Asian ideograph -7737East Asian ideograph -773CEast Asian ideograph -7736East Asian ideograph -7738East Asian ideograph -773AEast Asian ideograph -773EEast Asian ideograph -774FEast Asian ideograph -776BEast Asian ideograph -775BEast Asian ideograph -776AEast Asian ideograph -7766East Asian ideograph -7779East Asian ideograph -775EEast Asian ideograph -7763East Asian ideograph -775CEast Asian ideograph -776CEast Asian ideograph -7768East Asian ideograph -7765East Asian ideograph -777DEast Asian ideograph -7771East Asian ideograph -777FEast Asian ideograph -7784East Asian ideograph -7761East Asian ideograph -7787East Asian ideograph -778EEast Asian ideograph -778CEast Asian ideograph -7791East Asian ideograph -779FEast Asian ideograph -779EEast Asian ideograph -77A0East Asian ideograph -77A5East Asian ideograph -77B3East Asian ideograph -77AAEast Asian ideograph -77B0East Asian ideograph -77ADEast Asian ideograph -77ACEast Asian ideograph -77A7East Asian ideograph -77BDEast Asian ideograph -77BFEast Asian ideograph -77BBEast Asian ideograph -77D3East Asian ideograph -77D7East Asian ideograph -77DAEast Asian ideograph -77DBEast Asian ideograph -77DCEast Asian ideograph -77E2East Asian ideograph -77E3East Asian ideograph -77E5East Asian ideograph -77E9East Asian ideograph -77EDEast Asian ideograph -77EEEast Asian ideograph -77EFEast Asian ideograph -77F3East Asian ideograph -77FDEast Asian ideograph -7802East Asian ideograph -780DEast Asian ideograph -780CEast Asian ideograph -65ABEast Asian ideograph -7830East Asian ideograph -781DEast Asian ideograph -7834East Asian ideograph -7838East Asian ideograph -7837East Asian ideograph -7827East Asian ideograph -782DEast Asian ideograph -7825East Asian ideograph -786BEast Asian ideograph -784FEast Asian ideograph -7843East Asian ideograph -786CEast Asian ideograph -785DEast Asian ideograph -786FEast Asian ideograph -78B0East Asian ideograph -7897East Asian ideograph -788EEast Asian ideograph -7898East Asian ideograph -7889East Asian ideograph -7891East Asian ideograph -787CEast Asian ideograph -788CEast Asian ideograph -78A7East Asian ideograph -78A9East Asian ideograph -789FEast Asian ideograph -78B3East Asian ideograph -78CBEast Asian ideograph -78BAEast Asian ideograph -78C1East Asian ideograph -78C5East Asian ideograph -78BCEast Asian ideograph -78D5East Asian ideograph -78BEEast Asian ideograph -78CAEast Asian ideograph -78D0East Asian ideograph -78E8East Asian ideograph -78ECEast Asian ideograph -78DAEast Asian ideograph -78F7East Asian ideograph -78F4East Asian ideograph -E94A78FAVariant of 4B4E56 which maps to 78FA -7901East Asian ideograph -78EFEast Asian ideograph -790EEast Asian ideograph -7919East Asian ideograph -7926East Asian ideograph -792CEast Asian ideograph -792AEast Asian ideograph -792BEast Asian ideograph -793AEast Asian ideograph -7940East Asian ideograph -793EEast Asian ideograph -7941East Asian ideograph -7945East Asian ideograph -7949East Asian ideograph -7948East Asian ideograph -7947East Asian ideograph -7955East Asian ideograph -7960East Asian ideograph -7950East Asian ideograph -7956East Asian ideograph -795EEast Asian ideograph -795DEast Asian ideograph -795FEast Asian ideograph -795AEast Asian ideograph -7957East Asian ideograph -7965East Asian ideograph -7968East Asian ideograph -796DEast Asian ideograph -797AEast Asian ideograph -7981East Asian ideograph -797FEast Asian ideograph -798FEast Asian ideograph -798DEast Asian ideograph -798EEast Asian ideograph -79A6East Asian ideograph -79A7East Asian ideograph -79AAEast Asian ideograph -79AEEast Asian ideograph -79B1East Asian ideograph -79B9East Asian ideograph -79BDEast Asian ideograph -842CEast Asian ideograph -79BEEast Asian ideograph -79C0East Asian ideograph -79C1East Asian ideograph -79BFEast Asian ideograph -79C9East Asian ideograph -79D1East Asian ideograph -79CBEast Asian ideograph -79D2East Asian ideograph -79E4East Asian ideograph -79E6East Asian ideograph -79E3East Asian ideograph -79DFEast Asian ideograph -79E7East Asian ideograph -79E9East Asian ideograph -79FBEast Asian ideograph -7A05East Asian ideograph -7A0DEast Asian ideograph -7A08East Asian ideograph -7A0BEast Asian ideograph -7A00East Asian ideograph -7A1FEast Asian ideograph -7A20East Asian ideograph -7A1AEast Asian ideograph -7A14East Asian ideograph -7A31East Asian ideograph -7A2EEast Asian ideograph -7A3FEast Asian ideograph -7A3CEast Asian ideograph -7A40East Asian ideograph -7A3DEast Asian ideograph -7A37East Asian ideograph -7A3BEast Asian ideograph -7A4DEast Asian ideograph -7A4EEast Asian ideograph -7A4CEast Asian ideograph -7A46East Asian ideograph -7A57East Asian ideograph -7A61East Asian ideograph -7A62East Asian ideograph -7A6BEast Asian ideograph -7A69East Asian ideograph -7A74East Asian ideograph -7A76East Asian ideograph -7A79East Asian ideograph -7A7AEast Asian ideograph -7A7FEast Asian ideograph -7A81East Asian ideograph -7A84East Asian ideograph -7A88East Asian ideograph -7A92East Asian ideograph -7A95East Asian ideograph -7A98East Asian ideograph -7A96East Asian ideograph -7A97East Asian ideograph -7A9FEast Asian ideograph -7AA0East Asian ideograph -7AAAEast Asian ideograph -7AA9East Asian ideograph -7AAFEast Asian ideograph -7AAEEast Asian ideograph -7ABAEast Asian ideograph -7AC5East Asian ideograph -7AC4East Asian ideograph -7AC7East Asian ideograph -7ACAEast Asian ideograph -7ACBEast Asian ideograph -7AD9East Asian ideograph -7AE5East Asian ideograph -7AE3East Asian ideograph -7AEDEast Asian ideograph -7AEFEast Asian ideograph -7AF6East Asian ideograph -7AF9East Asian ideograph -7AFAEast Asian ideograph -7AFFEast Asian ideograph -7AFDEast Asian ideograph -7B06East Asian ideograph -7B11East Asian ideograph -7B20East Asian ideograph -7B2CEast Asian ideograph -7B28East Asian ideograph -7B1BEast Asian ideograph -7B1EEast Asian ideograph -7B19East Asian ideograph -7B26East Asian ideograph -7B46East Asian ideograph -7B49East Asian ideograph -7B50East Asian ideograph -7B56East Asian ideograph -7B52East Asian ideograph -7B4BEast Asian ideograph -7B4DEast Asian ideograph -7B4FEast Asian ideograph -7B54East Asian ideograph -7B60East Asian ideograph -7B77East Asian ideograph -7B75East Asian ideograph -7BA1East Asian ideograph -7B94East Asian ideograph -7B95East Asian ideograph -7B9DEast Asian ideograph -7B8BEast Asian ideograph -7B97East Asian ideograph -7B8FEast Asian ideograph -7BC7East Asian ideograph -7BADEast Asian ideograph -7BC4East Asian ideograph -7BB1East Asian ideograph -7BB4East Asian ideograph -7BC0East Asian ideograph -7BC6East Asian ideograph -7BC1East Asian ideograph -7C11East Asian ideograph -7BD9East Asian ideograph -7BDBEast Asian ideograph -7BE4East Asian ideograph -7BC9East Asian ideograph -7BE1East Asian ideograph -7BE9East Asian ideograph -7C07East Asian ideograph -7C0DEast Asian ideograph -7BFEEast Asian ideograph -7BF7East Asian ideograph -7C21East Asian ideograph -7C2BEast Asian ideograph -7C2AEast Asian ideograph -7C27East Asian ideograph -7C1EEast Asian ideograph -7C23East Asian ideograph -7C3FEast Asian ideograph -7C3EEast Asian ideograph -7C38East Asian ideograph -7C37East Asian ideograph -7C3DEast Asian ideograph -7C43East Asian ideograph -7C4CEast Asian ideograph -7C4DEast Asian ideograph -7C50East Asian ideograph -7C60East Asian ideograph -7C5FEast Asian ideograph -7C64East Asian ideograph -7C6CEast Asian ideograph -7C6EEast Asian ideograph -7C72East Asian ideograph -7C73East Asian ideograph -7C89East Asian ideograph -7C92East Asian ideograph -7C97East Asian ideograph -7C9FEast Asian ideograph -7CA5East Asian ideograph -7CA4East Asian ideograph -7CB1East Asian ideograph -7CB3East Asian ideograph -7CBDEast Asian ideograph -7CB9East Asian ideograph -FA1DEast Asian ideograph -7CCAEast Asian ideograph -7CD6East Asian ideograph -7CD5East Asian ideograph -7CE0East Asian ideograph -7CDCEast Asian ideograph -7CDFEast Asian ideograph -7CDEEast Asian ideograph -7CE2East Asian ideograph -7CD9East Asian ideograph -7CE7East Asian ideograph -7CEFEast Asian ideograph -7CFBEast Asian ideograph -7CFEEast Asian ideograph -7D00East Asian ideograph -7D02East Asian ideograph -7D05East Asian ideograph -7D09East Asian ideograph -7D04East Asian ideograph -7D07East Asian ideograph -7D21East Asian ideograph -7D0BEast Asian ideograph -7D0AEast Asian ideograph -7D20East Asian ideograph -7D1CEast Asian ideograph -7D22East Asian ideograph -7D15East Asian ideograph -7D14East Asian ideograph -7D10East Asian ideograph -7D17East Asian ideograph -E94B7D0DVariant of 455122 which maps to 7D0D -7D1AEast Asian ideograph -7D19East Asian ideograph -7D1BEast Asian ideograph -7D46East Asian ideograph -7D3CEast Asian ideograph -7D2EEast Asian ideograph -7D39East Asian ideograph -7D44East Asian ideograph -7D30East Asian ideograph -7D33East Asian ideograph -7D2FEast Asian ideograph -7D40East Asian ideograph -7D42East Asian ideograph -7D71East Asian ideograph -7D5EEast Asian ideograph -7D68East Asian ideograph -7D50East Asian ideograph -7D2BEast Asian ideograph -7D62East Asian ideograph -7D76East Asian ideograph -7D61East Asian ideograph -7D66East Asian ideograph -7D6EEast Asian ideograph -7D72East Asian ideograph -7D93East Asian ideograph -7D91East Asian ideograph -7D79East Asian ideograph -7D8FEast Asian ideograph -7D81East Asian ideograph -7D9CEast Asian ideograph -7DBBEast Asian ideograph -7DB0East Asian ideograph -7DCAEast Asian ideograph -7DBEEast Asian ideograph -7DB4East Asian ideograph -7DBAEast Asian ideograph -7DB2East Asian ideograph -7DB1East Asian ideograph -7DBDEast Asian ideograph -7DB5East Asian ideograph -7DA0East Asian ideograph -7DA2East Asian ideograph -7DADEast Asian ideograph -7DBFEast Asian ideograph -7DB8East Asian ideograph -7DC7East Asian ideograph -7DE0East Asian ideograph -7DEFEast Asian ideograph -E94C7DF4Variant of 4B5154 which maps to 7DF4 -7DD6East Asian ideograph -7DD8East Asian ideograph -7DECEast Asian ideograph -7DDDEast Asian ideograph -7DE9East Asian ideograph -7DE3East Asian ideograph -7DE8East Asian ideograph -7DDAEast Asian ideograph -7D9EEast Asian ideograph -7DDEEast Asian ideograph -7E11East Asian ideograph -7E0AEast Asian ideograph -7E08East Asian ideograph -7E1BEast Asian ideograph -7DFBEast Asian ideograph -7E23East Asian ideograph -7E2EEast Asian ideograph -7E3EEast Asian ideograph -7E46East Asian ideograph -7E37East Asian ideograph -7E32East Asian ideograph -7E43East Asian ideograph -7E41East Asian ideograph -7E2BEast Asian ideograph -7E3DEast Asian ideograph -7E31East Asian ideograph -7E45East Asian ideograph -7E55East Asian ideograph -7E54East Asian ideograph -7E61East Asian ideograph -7E5EEast Asian ideograph -7E5AEast Asian ideograph -7E6BEast Asian ideograph -7E69East Asian ideograph -7E6DEast Asian ideograph -7E79East Asian ideograph -7E6AEast Asian ideograph -8FAEEast Asian ideograph -7E7DEast Asian ideograph -7E82East Asian ideograph -7E7CEast Asian ideograph -7E8FEast Asian ideograph -7E8CEast Asian ideograph -7E93East Asian ideograph -7E96East Asian ideograph -7E9CEast Asian ideograph -7F38East Asian ideograph -7F3AEast Asian ideograph -7F3DEast Asian ideograph -7F44East Asian ideograph -7F50East Asian ideograph -7F55East Asian ideograph -7F54East Asian ideograph -7F5FEast Asian ideograph -7F72East Asian ideograph -7F6EEast Asian ideograph -7F69East Asian ideograph -7F6AEast Asian ideograph -7F70East Asian ideograph -7F75East Asian ideograph -7F77East Asian ideograph -7F79East Asian ideograph -7F85East Asian ideograph -7F88East Asian ideograph -7F8AEast Asian ideograph -7F8CEast Asian ideograph -7F8EEast Asian ideograph -7F94East Asian ideograph -7F9EEast Asian ideograph -7F9AEast Asian ideograph -5584East Asian ideograph -7FA8East Asian ideograph -7FA4East Asian ideograph -7FA9East Asian ideograph -7FAFEast Asian ideograph -7FB2East Asian ideograph -7FB6East Asian ideograph -7FB8East Asian ideograph -7FB9East Asian ideograph -7FBDEast Asian ideograph -7FBFEast Asian ideograph -7FC5East Asian ideograph -7FC1East Asian ideograph -7FCCEast Asian ideograph -7FD2East Asian ideograph -E94D7FCEVariant of 4B524E which maps to 7FCE -7FD4East Asian ideograph -7FD5East Asian ideograph -7FE0East Asian ideograph -7FE1East Asian ideograph -7FDFEast Asian ideograph -7FE9East Asian ideograph -7FF0East Asian ideograph -7FF3East Asian ideograph -7FFCEast Asian ideograph -7FF9East Asian ideograph -7FFBEast Asian ideograph -7FF1East Asian ideograph -8000East Asian ideograph -8001East Asian ideograph -8003East Asian ideograph -8006East Asian ideograph -8005East Asian ideograph -800CEast Asian ideograph -8010East Asian ideograph -800DEast Asian ideograph -8012East Asian ideograph -8015East Asian ideograph -8018East Asian ideograph -8019East Asian ideograph -8017East Asian ideograph -801CEast Asian ideograph -8033East Asian ideograph -8036East Asian ideograph -803FEast Asian ideograph -803DEast Asian ideograph -804AEast Asian ideograph -8046East Asian ideograph -8056East Asian ideograph -8058East Asian ideograph -805EEast Asian ideograph -805AEast Asian ideograph -8071East Asian ideograph -8072East Asian ideograph -8073East Asian ideograph -8070East Asian ideograph -806FEast Asian ideograph -8077East Asian ideograph -8076East Asian ideograph -807EEast Asian ideograph -807DEast Asian ideograph -807FEast Asian ideograph -8084East Asian ideograph -8085East Asian ideograph -8087East Asian ideograph -8089East Asian ideograph -808BEast Asian ideograph -808CEast Asian ideograph -8093East Asian ideograph -809DEast Asian ideograph -8098East Asian ideograph -809BEast Asian ideograph -809AEast Asian ideograph -8096East Asian ideograph -80B2East Asian ideograph -80AAEast Asian ideograph -80BAEast Asian ideograph -80A5East Asian ideograph -80A2East Asian ideograph -80ABEast Asian ideograph -80B1East Asian ideograph -80AFEast Asian ideograph -80A1East Asian ideograph -80A9East Asian ideograph -80B4East Asian ideograph -80D6East Asian ideograph -80CCEast Asian ideograph -80E5East Asian ideograph -80DAEast Asian ideograph -80E1East Asian ideograph -80C3East Asian ideograph -80DBEast Asian ideograph -80C4East Asian ideograph -80CEEast Asian ideograph -80DEEast Asian ideograph -80E4East Asian ideograph -80F0East Asian ideograph -8102East Asian ideograph -8105East Asian ideograph -80F1East Asian ideograph -80F4East Asian ideograph -80EDEast Asian ideograph -80FDEast Asian ideograph -8106East Asian ideograph -80F3East Asian ideograph -80F8East Asian ideograph -810AEast Asian ideograph -8108East Asian ideograph -812BEast Asian ideograph -812FEast Asian ideograph -8116East Asian ideograph -8129East Asian ideograph -8155East Asian ideograph -8154East Asian ideograph -814BEast Asian ideograph -8151East Asian ideograph -8150East Asian ideograph -814EEast Asian ideograph -8139East Asian ideograph -8146East Asian ideograph -813EEast Asian ideograph -8171East Asian ideograph -8170East Asian ideograph -8178East Asian ideograph -8165East Asian ideograph -816EEast Asian ideograph -8173East Asian ideograph -816BEast Asian ideograph -8179East Asian ideograph -817AEast Asian ideograph -8166East Asian ideograph -8180East Asian ideograph -818FEast Asian ideograph -817FEast Asian ideograph -818AEast Asian ideograph -8188East Asian ideograph -819DEast Asian ideograph -81A0East Asian ideograph -819BEast Asian ideograph -819AEast Asian ideograph -819CEast Asian ideograph -81B3East Asian ideograph -81A9East Asian ideograph -81A8East Asian ideograph -81C6East Asian ideograph -81BAEast Asian ideograph -81C3East Asian ideograph -81C0East Asian ideograph -81C2East Asian ideograph -81BFEast Asian ideograph -81BDEast Asian ideograph -81C9East Asian ideograph -81BEEast Asian ideograph -81CDEast Asian ideograph -81CFEast Asian ideograph -81D8East Asian ideograph -81DAEast Asian ideograph -81DFEast Asian ideograph -81E3East Asian ideograph -81E5East Asian ideograph -81E8East Asian ideograph -81EAEast Asian ideograph -81ECEast Asian ideograph -81EDEast Asian ideograph -81F3East Asian ideograph -81FAEast Asian ideograph -81FBEast Asian ideograph -81FCEast Asian ideograph -81FEEast Asian ideograph -8200East Asian ideograph -8202East Asian ideograph -8205East Asian ideograph -8207East Asian ideograph -8208East Asian ideograph -8209East Asian ideograph -820AEast Asian ideograph -820CEast Asian ideograph -820DEast Asian ideograph -8210East Asian ideograph -8212East Asian ideograph -8214East Asian ideograph -821BEast Asian ideograph -821CEast Asian ideograph -821EEast Asian ideograph -821FEast Asian ideograph -8222East Asian ideograph -822AEast Asian ideograph -822BEast Asian ideograph -822CEast Asian ideograph -8228East Asian ideograph -8237East Asian ideograph -8235East Asian ideograph -8239East Asian ideograph -8236East Asian ideograph -8247East Asian ideograph -8258East Asian ideograph -8259East Asian ideograph -8266East Asian ideograph -826EEast Asian ideograph -826FEast Asian ideograph -8271East Asian ideograph -8272East Asian ideograph -827EEast Asian ideograph -8292East Asian ideograph -828BEast Asian ideograph -828DEast Asian ideograph -82B3East Asian ideograph -829DEast Asian ideograph -8299East Asian ideograph -82BDEast Asian ideograph -82ADEast Asian ideograph -82ACEast Asian ideograph -82A5East Asian ideograph -829FEast Asian ideograph -82BBEast Asian ideograph -82B1East Asian ideograph -82B9East Asian ideograph -82E7East Asian ideograph -8305East Asian ideograph -8309East Asian ideograph -82E3East Asian ideograph -82DBEast Asian ideograph -82E6East Asian ideograph -8304East Asian ideograph -82E5East Asian ideograph -8302East Asian ideograph -82DCEast Asian ideograph -82D7East Asian ideograph -82F1East Asian ideograph -8301East Asian ideograph -82D3East Asian ideograph -82D4East Asian ideograph -82D1East Asian ideograph -82DEEast Asian ideograph -82DFEast Asian ideograph -832BEast Asian ideograph -8352East Asian ideograph -834AEast Asian ideograph -8338East Asian ideograph -8354East Asian ideograph -8350East Asian ideograph -8349East Asian ideograph -8335East Asian ideograph -8334East Asian ideograph -8336East Asian ideograph -8331East Asian ideograph -8340East Asian ideograph -8317East Asian ideograph -5179East Asian ideograph -834FEast Asian ideograph -8339East Asian ideograph -838EEast Asian ideograph -8398East Asian ideograph -839EEast Asian ideograph -8378East Asian ideograph -83A2East Asian ideograph -8396East Asian ideograph -83A7East Asian ideograph -83ABEast Asian ideograph -E94E8392Variant of 4B552C which maps to 8392 -838AEast Asian ideograph -8393East Asian ideograph -83A0East Asian ideograph -8389East Asian ideograph -8377East Asian ideograph -837CEast Asian ideograph -837BEast Asian ideograph -840DEast Asian ideograph -83E0East Asian ideograph -83E9East Asian ideograph -8403East Asian ideograph -83C5East Asian ideograph -83C1East Asian ideograph -840BEast Asian ideograph -83EFEast Asian ideograph -83F1East Asian ideograph -83BDEast Asian ideograph -840AEast Asian ideograph -840CEast Asian ideograph -83CCEast Asian ideograph -83DCEast Asian ideograph -83CAEast Asian ideograph -83F2East Asian ideograph -840EEast Asian ideograph -8404East Asian ideograph -843DEast Asian ideograph -8482East Asian ideograph -8431East Asian ideograph -8475East Asian ideograph -8466East Asian ideograph -8457East Asian ideograph -8449East Asian ideograph -846CEast Asian ideograph -846BEast Asian ideograph -845BEast Asian ideograph -8477East Asian ideograph -843CEast Asian ideograph -8435East Asian ideograph -8461East Asian ideograph -8463East Asian ideograph -8469East Asian ideograph -8438East Asian ideograph -84B2East Asian ideograph -849EEast Asian ideograph -84BFEast Asian ideograph -84C6East Asian ideograph -84C4East Asian ideograph -84C9East Asian ideograph -849CEast Asian ideograph -84CBEast Asian ideograph -84B8East Asian ideograph -84C0East Asian ideograph -8499East Asian ideograph -84D3East Asian ideograph -8490East Asian ideograph -84BCEast Asian ideograph -853DEast Asian ideograph -84FFEast Asian ideograph -8517East Asian ideograph -851AEast Asian ideograph -84EEEast Asian ideograph -852CEast Asian ideograph -852DEast Asian ideograph -8513East Asian ideograph -8523East Asian ideograph -8521East Asian ideograph -8514East Asian ideograph -84ECEast Asian ideograph -8525East Asian ideograph -8569East Asian ideograph -854AEast Asian ideograph -8559East Asian ideograph -8548East Asian ideograph -8568East Asian ideograph -8543East Asian ideograph -856AEast Asian ideograph -8549East Asian ideograph -8584East Asian ideograph -85AAEast Asian ideograph -856DEast Asian ideograph -859BEast Asian ideograph -8591East Asian ideograph -857EEast Asian ideograph -8594East Asian ideograph -859CEast Asian ideograph -8587East Asian ideograph -E94F85CDVariant of 4B5629 which maps to 85CD -85A9East Asian ideograph -85CFEast Asian ideograph -85AFEast Asian ideograph -85D0East Asian ideograph -85C9East Asian ideograph -85B0East Asian ideograph -85E9East Asian ideograph -85DDEast Asian ideograph -85EAEast Asian ideograph -85E4East Asian ideograph -85D5East Asian ideograph -85E5East Asian ideograph -85FBEast Asian ideograph -85F9East Asian ideograph -8611East Asian ideograph -85FAEast Asian ideograph -8606East Asian ideograph -860BEast Asian ideograph -8607East Asian ideograph -860AEast Asian ideograph -862DEast Asian ideograph -8617East Asian ideograph -861AEast Asian ideograph -8638East Asian ideograph -863FEast Asian ideograph -864EEast Asian ideograph -8650East Asian ideograph -8654East Asian ideograph -5F6AEast Asian ideograph -8655East Asian ideograph -865CEast Asian ideograph -865BEast Asian ideograph -865FEast Asian ideograph -865EEast Asian ideograph -8667East Asian ideograph -8679East Asian ideograph -86A9East Asian ideograph -86AAEast Asian ideograph -868AEast Asian ideograph -8693East Asian ideograph -86A4East Asian ideograph -868CEast Asian ideograph -86A3East Asian ideograph -86C0East Asian ideograph -86C7East Asian ideograph -86B5East Asian ideograph -86CBEast Asian ideograph -86B6East Asian ideograph -86C4East Asian ideograph -86C6East Asian ideograph -86B1East Asian ideograph -86AFEast Asian ideograph -86DFEast Asian ideograph -86D9East Asian ideograph -86EDEast Asian ideograph -86D4East Asian ideograph -86DBEast Asian ideograph -86E4East Asian ideograph -86FBEast Asian ideograph -86F9East Asian ideograph -8707East Asian ideograph -8703East Asian ideograph -8708East Asian ideograph -8700East Asian ideograph -86FEEast Asian ideograph -8713East Asian ideograph -8702East Asian ideograph -871CEast Asian ideograph -873FEast Asian ideograph -873BEast Asian ideograph -8722East Asian ideograph -8725East Asian ideograph -8734East Asian ideograph -8718East Asian ideograph -8755East Asian ideograph -8760East Asian ideograph -8776East Asian ideograph -8774East Asian ideograph -8766East Asian ideograph -8778East Asian ideograph -8768East Asian ideograph -874CEast Asian ideograph -8757East Asian ideograph -8759East Asian ideograph -8783East Asian ideograph -8782East Asian ideograph -87A2East Asian ideograph -879EEast Asian ideograph -878DEast Asian ideograph -879FEast Asian ideograph -87D1East Asian ideograph -87C0East Asian ideograph -87ABEast Asian ideograph -87B3East Asian ideograph -87BBEast Asian ideograph -87C8East Asian ideograph -87D2East Asian ideograph -87BAEast Asian ideograph -87C6East Asian ideograph -87CBEast Asian ideograph -87EFEast Asian ideograph -87F2East Asian ideograph -87ECEast Asian ideograph -87FBEast Asian ideograph -8805East Asian ideograph -880DEast Asian ideograph -87F9East Asian ideograph -8814East Asian ideograph -8815East Asian ideograph -8822East Asian ideograph -8823East Asian ideograph -8821East Asian ideograph -881FEast Asian ideograph -8831East Asian ideograph -8839East Asian ideograph -8836East Asian ideograph -883BEast Asian ideograph -8840East Asian ideograph -884CEast Asian ideograph -884DEast Asian ideograph -E9508853Variant of 4B5746 which maps to 8853 -8857East Asian ideograph -8859East Asian ideograph -885BEast Asian ideograph -885DEast Asian ideograph -8861East Asian ideograph -8862East Asian ideograph -8863East Asian ideograph -521DEast Asian ideograph -8868East Asian ideograph -886BEast Asian ideograph -8882East Asian ideograph -8881East Asian ideograph -8870East Asian ideograph -8877East Asian ideograph -8888East Asian ideograph -88ABEast Asian ideograph -8892East Asian ideograph -8896East Asian ideograph -888DEast Asian ideograph -888BEast Asian ideograph -889EEast Asian ideograph -88C1East Asian ideograph -88C2East Asian ideograph -88B1East Asian ideograph -88DFEast Asian ideograph -88D9East Asian ideograph -88D8East Asian ideograph -88DCEast Asian ideograph -88CFEast Asian ideograph -88D4East Asian ideograph -88DDEast Asian ideograph -88D5East Asian ideograph -8902East Asian ideograph -88F3East Asian ideograph -88F8East Asian ideograph -88F9East Asian ideograph -88F4East Asian ideograph -88FDEast Asian ideograph -88E8East Asian ideograph -891AEast Asian ideograph -8910East Asian ideograph -8913East Asian ideograph -8912East Asian ideograph -8932East Asian ideograph -892AEast Asian ideograph -8925East Asian ideograph -892BEast Asian ideograph -893BEast Asian ideograph -8936East Asian ideograph -8938East Asian ideograph -8944East Asian ideograph -895FEast Asian ideograph -8960East Asian ideograph -8956East Asian ideograph -8964East Asian ideograph -896AEast Asian ideograph -896FEast Asian ideograph -8972East Asian ideograph -897FEast Asian ideograph -8981East Asian ideograph -8983East Asian ideograph -898BEast Asian ideograph -898FEast Asian ideograph -8993East Asian ideograph -8996East Asian ideograph -89AAEast Asian ideograph -89A6East Asian ideograph -89ACEast Asian ideograph -89B2East Asian ideograph -89BAEast Asian ideograph -89BDEast Asian ideograph -89C0East Asian ideograph -89D2East Asian ideograph -89E3East Asian ideograph -89F4East Asian ideograph -89F8East Asian ideograph -8A00East Asian ideograph -8A08East Asian ideograph -8A02East Asian ideograph -8A03East Asian ideograph -8A10East Asian ideograph -8A18East Asian ideograph -8A0EEast Asian ideograph -8A0CEast Asian ideograph -8A15East Asian ideograph -8A0AEast Asian ideograph -8A16East Asian ideograph -8A17East Asian ideograph -8A13East Asian ideograph -8A2AEast Asian ideograph -8A23East Asian ideograph -8A1DEast Asian ideograph -8A25East Asian ideograph -8A31East Asian ideograph -8A2DEast Asian ideograph -8A1BEast Asian ideograph -8A1FEast Asian ideograph -8A3BEast Asian ideograph -8A60East Asian ideograph -8A55East Asian ideograph -8A5EEast Asian ideograph -8A41East Asian ideograph -8A54East Asian ideograph -8A5BEast Asian ideograph -8A50East Asian ideograph -8A46East Asian ideograph -8A34East Asian ideograph -8A3AEast Asian ideograph -8A6BEast Asian ideograph -8A72East Asian ideograph -8A73East Asian ideograph -8A66East Asian ideograph -8A69East Asian ideograph -8A70East Asian ideograph -8A63East Asian ideograph -8A7CEast Asian ideograph -8AA0East Asian ideograph -8A87East Asian ideograph -8A85East Asian ideograph -8A6DEast Asian ideograph -8A79East Asian ideograph -8A62East Asian ideograph -8A71East Asian ideograph -8A6EEast Asian ideograph -8A6CEast Asian ideograph -8AAAEast Asian ideograph -8AA6East Asian ideograph -8AA1East Asian ideograph -8A9EEast Asian ideograph -8A8CEast Asian ideograph -8A93East Asian ideograph -8AA3East Asian ideograph -8A8DEast Asian ideograph -E9518AA4Variant of 4B5871 which maps to 8AA4 -8AA8East Asian ideograph -8AA5East Asian ideograph -8A98East Asian ideograph -8A91East Asian ideograph -8ABCEast Asian ideograph -8AC4East Asian ideograph -8AD2East Asian ideograph -8AC7East Asian ideograph -E9528ACBVariant of 4B587A which maps to 8ACB -8AF8East Asian ideograph -8AB2East Asian ideograph -8ABFEast Asian ideograph -8AC9East Asian ideograph -8AC2East Asian ideograph -8AB0East Asian ideograph -8A95East Asian ideograph -8AD6East Asian ideograph -8AE6East Asian ideograph -8AFAEast Asian ideograph -8AEBEast Asian ideograph -8AF1East Asian ideograph -8AE7East Asian ideograph -8ADCEast Asian ideograph -8B00East Asian ideograph -E9538B01Variant of 2D592C which maps to 8B01 -8B02East Asian ideograph -8AFEEast Asian ideograph -8AF7East Asian ideograph -8AEDEast Asian ideograph -8B17East Asian ideograph -8B19East Asian ideograph -8B0EEast Asian ideograph -8B1BEast Asian ideograph -8B0AEast Asian ideograph -8B21East Asian ideograph -8B04East Asian ideograph -8B1DEast Asian ideograph -8B39East Asian ideograph -8B2CEast Asian ideograph -8B28East Asian ideograph -8B58East Asian ideograph -8B5CEast Asian ideograph -8B4EEast Asian ideograph -8B49East Asian ideograph -8B5AEast Asian ideograph -8B41East Asian ideograph -8B4FEast Asian ideograph -8B70East Asian ideograph -8B6CEast Asian ideograph -8B66East Asian ideograph -8B6FEast Asian ideograph -8B74East Asian ideograph -8B77East Asian ideograph -8B7DEast Asian ideograph -8B80East Asian ideograph -8B8AEast Asian ideograph -8B93East Asian ideograph -8B96East Asian ideograph -8B92East Asian ideograph -8B9AEast Asian ideograph -8C41East Asian ideograph -8C3FEast Asian ideograph -8C46East Asian ideograph -8C48East Asian ideograph -8C49East Asian ideograph -8C4CEast Asian ideograph -8C4EEast Asian ideograph -8C50East Asian ideograph -8C54East Asian ideograph -8C5AEast Asian ideograph -8C62East Asian ideograph -8C6AEast Asian ideograph -8C6BEast Asian ideograph -8C6CEast Asian ideograph -8C7AEast Asian ideograph -8C79East Asian ideograph -8C82East Asian ideograph -8C8AEast Asian ideograph -8C89East Asian ideograph -8C8DEast Asian ideograph -8C8CEast Asian ideograph -8C93East Asian ideograph -8C9DEast Asian ideograph -8C9EEast Asian ideograph -8CA0East Asian ideograph -8CA2East Asian ideograph -8CA1East Asian ideograph -8CACEast Asian ideograph -8CABEast Asian ideograph -8CA8East Asian ideograph -8CAAEast Asian ideograph -8CA7East Asian ideograph -8CA9East Asian ideograph -8CAFEast Asian ideograph -8CBBEast Asian ideograph -8CC1East Asian ideograph -8CC0East Asian ideograph -8CB4East Asian ideograph -8CBCEast Asian ideograph -8CB7East Asian ideograph -8CB6East Asian ideograph -8CBDEast Asian ideograph -8CB8East Asian ideograph -8CBFEast Asian ideograph -8CC5East Asian ideograph -8CC7East Asian ideograph -8CCAEast Asian ideograph -8CC8East Asian ideograph -8CC4East Asian ideograph -8CB2East Asian ideograph -8CC3East Asian ideograph -8CC2East Asian ideograph -8CD3East Asian ideograph -8CD1East Asian ideograph -8CD2East Asian ideograph -8CE0East Asian ideograph -8CE6East Asian ideograph -8CE3East Asian ideograph -8CE2East Asian ideograph -8CE4East Asian ideograph -8CDEEast Asian ideograph -8CDCEast Asian ideograph -8CEAEast Asian ideograph -8CEDEast Asian ideograph -8CF4East Asian ideograph -8CFDEast Asian ideograph -8CFAEast Asian ideograph -8D05East Asian ideograph -8CFCEast Asian ideograph -E9548D08Variant of 4B5A3B which maps to 8D08 -8D0BEast Asian ideograph -8D0AEast Asian ideograph -8D0FEast Asian ideograph -8D0DEast Asian ideograph -8D13East Asian ideograph -8D16East Asian ideograph -8D1BEast Asian ideograph -8D64East Asian ideograph -8D67East Asian ideograph -8D66East Asian ideograph -8D6BEast Asian ideograph -8D6DEast Asian ideograph -8D70East Asian ideograph -8D74East Asian ideograph -8D73East Asian ideograph -8D77East Asian ideograph -8D85East Asian ideograph -8D8AEast Asian ideograph -8D81East Asian ideograph -8D99East Asian ideograph -8D95East Asian ideograph -8DA3East Asian ideograph -8D9FEast Asian ideograph -8DA8East Asian ideograph -8DB3East Asian ideograph -8DB4East Asian ideograph -8DBEEast Asian ideograph -8DCEEast Asian ideograph -8DDDEast Asian ideograph -8DDBEast Asian ideograph -8DCBEast Asian ideograph -8DDAEast Asian ideograph -8DC6East Asian ideograph -8DD1East Asian ideograph -8DCCEast Asian ideograph -8DE1East Asian ideograph -8DDFEast Asian ideograph -8DE8East Asian ideograph -8DF3East Asian ideograph -8DFAEast Asian ideograph -8DEAEast Asian ideograph -8DEFEast Asian ideograph -8DFCEast Asian ideograph -8E2BEast Asian ideograph -8E10East Asian ideograph -8E22East Asian ideograph -8E1DEast Asian ideograph -8E0FEast Asian ideograph -8E29East Asian ideograph -8E1FEast Asian ideograph -8E44East Asian ideograph -8E31East Asian ideograph -8E42East Asian ideograph -8E34East Asian ideograph -8E39East Asian ideograph -8E35East Asian ideograph -8E49East Asian ideograph -8E4BEast Asian ideograph -8E48East Asian ideograph -8E4AEast Asian ideograph -8E63East Asian ideograph -8E59East Asian ideograph -8E66East Asian ideograph -8E64East Asian ideograph -8E72East Asian ideograph -8E6CEast Asian ideograph -8E7AEast Asian ideograph -8E76East Asian ideograph -8E7CEast Asian ideograph -8E82East Asian ideograph -8E81East Asian ideograph -8E87East Asian ideograph -8E89East Asian ideograph -8E85East Asian ideograph -8E8AEast Asian ideograph -E9558E8DVariant of 4B5B29 which maps to 8E8D -8E91East Asian ideograph -8EA1East Asian ideograph -8EAAEast Asian ideograph -8EABEast Asian ideograph -8EACEast Asian ideograph -8EB2East Asian ideograph -8EBAEast Asian ideograph -8EC0East Asian ideograph -8ECAEast Asian ideograph -8ECBEast Asian ideograph -8ECDEast Asian ideograph -8ECCEast Asian ideograph -8ED2East Asian ideograph -8ED4East Asian ideograph -8EDFEast Asian ideograph -8EDBEast Asian ideograph -8EFBEast Asian ideograph -8EF8East Asian ideograph -8EFCEast Asian ideograph -8F03East Asian ideograph -8EFEEast Asian ideograph -8F09East Asian ideograph -8F0AEast Asian ideograph -8F14East Asian ideograph -8F12East Asian ideograph -8F15East Asian ideograph -8F13East Asian ideograph -8F26East Asian ideograph -8F1BEast Asian ideograph -8F1FEast Asian ideograph -8F1DEast Asian ideograph -8F29East Asian ideograph -8F2AEast Asian ideograph -8F1CEast Asian ideograph -8F3BEast Asian ideograph -8F2FEast Asian ideograph -8F38East Asian ideograph -8F44East Asian ideograph -8F3EEast Asian ideograph -8F45East Asian ideograph -E9568F42Variant of 4B5B52 which maps to 8F42 -8F3FEast Asian ideograph -8F4DEast Asian ideograph -8F49East Asian ideograph -8F54East Asian ideograph -8F4EEast Asian ideograph -8F5FEast Asian ideograph -8F61East Asian ideograph -8F9BEast Asian ideograph -8F9CEast Asian ideograph -8F9FEast Asian ideograph -8FA3East Asian ideograph -8FA8East Asian ideograph -8FA6East Asian ideograph -8FADEast Asian ideograph -8FAFEast Asian ideograph -8FB0East Asian ideograph -8FB1East Asian ideograph -8FB2East Asian ideograph -8FC6East Asian ideograph -8FC5East Asian ideograph -8FC4East Asian ideograph -5DE1East Asian ideograph -8FCEEast Asian ideograph -8FD1East Asian ideograph -8FD4East Asian ideograph -E9578FF0Variant of 275B6D which maps to 8FF0 -8FE6East Asian ideograph -8FE2East Asian ideograph -8FEAEast Asian ideograph -8FE5East Asian ideograph -8FEBEast Asian ideograph -9001East Asian ideograph -9006East Asian ideograph -8FF7East Asian ideograph -9000East Asian ideograph -9003East Asian ideograph -8FFDEast Asian ideograph -9005East Asian ideograph -9019East Asian ideograph -9023East Asian ideograph -901FEast Asian ideograph -9017East Asian ideograph -901DEast Asian ideograph -9010East Asian ideograph -900DEast Asian ideograph -901EEast Asian ideograph -901AEast Asian ideograph -9020East Asian ideograph -900FEast Asian ideograph -9022East Asian ideograph -9016East Asian ideograph -901BEast Asian ideograph -9014East Asian ideograph -902EEast Asian ideograph -9035East Asian ideograph -9031East Asian ideograph -FA25East Asian ideograph -9032East Asian ideograph -904BEast Asian ideograph -9053East Asian ideograph -9042East Asian ideograph -9050East Asian ideograph -9054East Asian ideograph -9055East Asian ideograph -903CEast Asian ideograph -9047East Asian ideograph -904FEast Asian ideograph -904EEast Asian ideograph -904DEast Asian ideograph -9051East Asian ideograph -9041East Asian ideograph -903EEast Asian ideograph -9058East Asian ideograph -9060East Asian ideograph -905CEast Asian ideograph -9063East Asian ideograph -9065East Asian ideograph -905EEast Asian ideograph -9069East Asian ideograph -906EEast Asian ideograph -9068East Asian ideograph -906DEast Asian ideograph -9075East Asian ideograph -9074East Asian ideograph -9078East Asian ideograph -9072East Asian ideograph -9077East Asian ideograph -907CEast Asian ideograph -907AEast Asian ideograph -907FEast Asian ideograph -907DEast Asian ideograph -9081East Asian ideograph -9084East Asian ideograph -9082East Asian ideograph -9080East Asian ideograph -9087East Asian ideograph -908AEast Asian ideograph -9090East Asian ideograph -908FEast Asian ideograph -9091East Asian ideograph -9095East Asian ideograph -90A3East Asian ideograph -90A2East Asian ideograph -90AAEast Asian ideograph -90A6East Asian ideograph -90B5East Asian ideograph -90B1East Asian ideograph -90B8East Asian ideograph -90CEEast Asian ideograph -90CAEast Asian ideograph -90E1East Asian ideograph -90E8East Asian ideograph -90EDEast Asian ideograph -90F5East Asian ideograph -90FDEast Asian ideograph -9102East Asian ideograph -9109East Asian ideograph -9112East Asian ideograph -9119East Asian ideograph -912DEast Asian ideograph -9130East Asian ideograph -9127East Asian ideograph -9131East Asian ideograph -E9589139Variant of 4B5C77 which maps to 9139 -9149East Asian ideograph -914BEast Asian ideograph -914AEast Asian ideograph -9152East Asian ideograph -914DEast Asian ideograph -914CEast Asian ideograph -9157East Asian ideograph -9163East Asian ideograph -9165East Asian ideograph -916CEast Asian ideograph -9169East Asian ideograph -916AEast Asian ideograph -9175East Asian ideograph -9178East Asian ideograph -9177East Asian ideograph -9187East Asian ideograph -9189East Asian ideograph -918BEast Asian ideograph -9183East Asian ideograph -9192East Asian ideograph -91A3East Asian ideograph -919EEast Asian ideograph -919CEast Asian ideograph -91ABEast Asian ideograph -91ACEast Asian ideograph -91BAEast Asian ideograph -91C0East Asian ideograph -91C1East Asian ideograph -91C7East Asian ideograph -91C9East Asian ideograph -91CBEast Asian ideograph -91CDEast Asian ideograph -91CEEast Asian ideograph -91CFEast Asian ideograph -91D0East Asian ideograph -91D1East Asian ideograph -91DDEast Asian ideograph -91D8East Asian ideograph -91D7East Asian ideograph -91DCEast Asian ideograph -91F5East Asian ideograph -91E6East Asian ideograph -91E3East Asian ideograph -91E7East Asian ideograph -9223East Asian ideograph -920DEast Asian ideograph -9215East Asian ideograph -9209East Asian ideograph -9214East Asian ideograph -921EEast Asian ideograph -9210East Asian ideograph -9237East Asian ideograph -9238East Asian ideograph -923DEast Asian ideograph -923EEast Asian ideograph -9240East Asian ideograph -924BEast Asian ideograph -925BEast Asian ideograph -9264East Asian ideograph -9251East Asian ideograph -E9599234Variant of 4B5D58 which maps to 9234 -9278East Asian ideograph -9280East Asian ideograph -92ACEast Asian ideograph -9285East Asian ideograph -9298East Asian ideograph -9296East Asian ideograph -927BEast Asian ideograph -9293East Asian ideograph -929CEast Asian ideograph -92C5East Asian ideograph -92BBEast Asian ideograph -92B3East Asian ideograph -92EAEast Asian ideograph -92B7East Asian ideograph -92C1East Asian ideograph -92E4East Asian ideograph -92BCEast Asian ideograph -92D2East Asian ideograph -9320East Asian ideograph -9336East Asian ideograph -92F8East Asian ideograph -9333East Asian ideograph -932FEast Asian ideograph -9322East Asian ideograph -92FCEast Asian ideograph -932BEast Asian ideograph -931AEast Asian ideograph -9304East Asian ideograph -9310East Asian ideograph -9326East Asian ideograph -934DEast Asian ideograph -9382East Asian ideograph -9375East Asian ideograph -9365East Asian ideograph -934BEast Asian ideograph -9328East Asian ideograph -9370East Asian ideograph -937EEast Asian ideograph -9318East Asian ideograph -936CEast Asian ideograph -935BEast Asian ideograph -938AEast Asian ideograph -9394East Asian ideograph -93AEEast Asian ideograph -9396East Asian ideograph -93A2East Asian ideograph -93B3East Asian ideograph -93E1East Asian ideograph -93D1East Asian ideograph -93D6East Asian ideograph -93C3East Asian ideograph -93DFEast Asian ideograph -93D7East Asian ideograph -93C8East Asian ideograph -93E2East Asian ideograph -93DCEast Asian ideograph -93E4East Asian ideograph -93DDEast Asian ideograph -93CDEast Asian ideograph -93D8East Asian ideograph -9403East Asian ideograph -942EEast Asian ideograph -93FDEast Asian ideograph -9433East Asian ideograph -9435East Asian ideograph -943AEast Asian ideograph -9438East Asian ideograph -9432East Asian ideograph -9451East Asian ideograph -9444East Asian ideograph -9463East Asian ideograph -9460East Asian ideograph -9472East Asian ideograph -9470East Asian ideograph -947EEast Asian ideograph -947CEast Asian ideograph -947DEast Asian ideograph -947FEast Asian ideograph -9577East Asian ideograph -9580East Asian ideograph -9582East Asian ideograph -9583East Asian ideograph -9589East Asian ideograph -9594East Asian ideograph -958FEast Asian ideograph -958BEast Asian ideograph -9591East Asian ideograph -9593East Asian ideograph -9592East Asian ideograph -9598East Asian ideograph -95A1East Asian ideograph -95A8East Asian ideograph -95A9East Asian ideograph -95A3East Asian ideograph -95A5East Asian ideograph -95A4East Asian ideograph -95B1East Asian ideograph -95ADEast Asian ideograph -95BBEast Asian ideograph -95CAEast Asian ideograph -95CBEast Asian ideograph -95CCEast Asian ideograph -95C8East Asian ideograph -95C6East Asian ideograph -95D6East Asian ideograph -95D0East Asian ideograph -95DCEast Asian ideograph -95E1East Asian ideograph -95E2East Asian ideograph -961CEast Asian ideograph -9621East Asian ideograph -9632East Asian ideograph -9631East Asian ideograph -962EEast Asian ideograph -962AEast Asian ideograph -9640East Asian ideograph -963FEast Asian ideograph -963BEast Asian ideograph -9644East Asian ideograph -9650East Asian ideograph -964CEast Asian ideograph -964BEast Asian ideograph -964DEast Asian ideograph -9662East Asian ideograph -9663East Asian ideograph -965BEast Asian ideograph -9661East Asian ideograph -965DEast Asian ideograph -9664East Asian ideograph -966AEast Asian ideograph -9673East Asian ideograph -9678East Asian ideograph -9675East Asian ideograph -9672East Asian ideograph -9676East Asian ideograph -9677East Asian ideograph -9674East Asian ideograph -9670East Asian ideograph -968AEast Asian ideograph -968EEast Asian ideograph -968BEast Asian ideograph -967DEast Asian ideograph -9685East Asian ideograph -9686East Asian ideograph -968DEast Asian ideograph -9698East Asian ideograph -9694East Asian ideograph -9699East Asian ideograph -9695East Asian ideograph -969CEast Asian ideograph -969BEast Asian ideograph -96A7East Asian ideograph -96A8East Asian ideograph -96AAEast Asian ideograph -96B1East Asian ideograph -96B4East Asian ideograph -96B8East Asian ideograph -96BBEast Asian ideograph -96C0East Asian ideograph -96C7East Asian ideograph -96C6East Asian ideograph -96C4East Asian ideograph -96C1East Asian ideograph -96C5East Asian ideograph -96CDEast Asian ideograph -96CBEast Asian ideograph -96C9East Asian ideograph -96CCEast Asian ideograph -96D5East Asian ideograph -96D6East Asian ideograph -96DCEast Asian ideograph -96DEEast Asian ideograph -96DBEast Asian ideograph -96D9East Asian ideograph -96E2East Asian ideograph -E95A96E3Variant of 4B5F50 which maps to 96E3 -96E8East Asian ideograph -96EAEast Asian ideograph -96EFEast Asian ideograph -96F2East Asian ideograph -96FBEast Asian ideograph -96F7East Asian ideograph -96F9East Asian ideograph -96F6East Asian ideograph -9700East Asian ideograph -9707East Asian ideograph -9704East Asian ideograph -9709East Asian ideograph -9706East Asian ideograph -9711East Asian ideograph -970EEast Asian ideograph -9716East Asian ideograph -970FEast Asian ideograph -970DEast Asian ideograph -9713East Asian ideograph -971CEast Asian ideograph -971EEast Asian ideograph -972AEast Asian ideograph -9727East Asian ideograph -9738East Asian ideograph -9739East Asian ideograph -9732East Asian ideograph -973DEast Asian ideograph -973EEast Asian ideograph -9744East Asian ideograph -9742East Asian ideograph -9748East Asian ideograph -9751East Asian ideograph -FA1CEast Asian ideograph -E95B975BVariant of 4B5F72 which maps to 975B -975CEast Asian ideograph -975EEast Asian ideograph -9760East Asian ideograph -9761East Asian ideograph -9766East Asian ideograph -9768East Asian ideograph -9769East Asian ideograph -9776East Asian ideograph -9774East Asian ideograph -977CEast Asian ideograph -9785East Asian ideograph -978DEast Asian ideograph -978BEast Asian ideograph -978FEast Asian ideograph -9798East Asian ideograph -97A0East Asian ideograph -97A3East Asian ideograph -97A6East Asian ideograph -97ADEast Asian ideograph -97C3East Asian ideograph -97C1East Asian ideograph -97C6East Asian ideograph -97CBEast Asian ideograph -97CCEast Asian ideograph -97D3East Asian ideograph -97DCEast Asian ideograph -97EDEast Asian ideograph -97F3East Asian ideograph -7AE0East Asian ideograph -7ADFEast Asian ideograph -97F6East Asian ideograph -97FBEast Asian ideograph -E95C97FFVariant of 456036 which maps to 97FF -9801East Asian ideograph -9802East Asian ideograph -9803East Asian ideograph -9805East Asian ideograph -9806East Asian ideograph -9808East Asian ideograph -9810East Asian ideograph -980AEast Asian ideograph -9811East Asian ideograph -9813East Asian ideograph -9812East Asian ideograph -980CEast Asian ideograph -9817East Asian ideograph -E95D9818Variant of 4B6044 which maps to 9818 -9821East Asian ideograph -982DEast Asian ideograph -9830East Asian ideograph -9838East Asian ideograph -983BEast Asian ideograph -9839East Asian ideograph -9837East Asian ideograph -9824East Asian ideograph -9846East Asian ideograph -9854East Asian ideograph -984DEast Asian ideograph -984CEast Asian ideograph -984EEast Asian ideograph -9853East Asian ideograph -E95E985EVariant of 4B6053 which maps to 985E -985AEast Asian ideograph -9858East Asian ideograph -9867East Asian ideograph -986BEast Asian ideograph -986FEast Asian ideograph -9871East Asian ideograph -9870East Asian ideograph -98A8East Asian ideograph -98AFEast Asian ideograph -98B1East Asian ideograph -98B3East Asian ideograph -98B6East Asian ideograph -98BAEast Asian ideograph -98BCEast Asian ideograph -98C4East Asian ideograph -98DBEast Asian ideograph -98DFEast Asian ideograph -98E2East Asian ideograph -98E7East Asian ideograph -98E9East Asian ideograph -98EDEast Asian ideograph -98EAEast Asian ideograph -98EEEast Asian ideograph -98EFEast Asian ideograph -98FCEast Asian ideograph -98F4East Asian ideograph -98FDEast Asian ideograph -98FEEast Asian ideograph -9903East Asian ideograph -990AEast Asian ideograph -990CEast Asian ideograph -9909East Asian ideograph -9910East Asian ideograph -9912East Asian ideograph -9918East Asian ideograph -9913East Asian ideograph -9905East Asian ideograph -9928East Asian ideograph -991EEast Asian ideograph -991BEast Asian ideograph -9921East Asian ideograph -9935East Asian ideograph -993EEast Asian ideograph -993FEast Asian ideograph -993DEast Asian ideograph -9945East Asian ideograph -9952East Asian ideograph -9951East Asian ideograph -995CEast Asian ideograph -995EEast Asian ideograph -9996East Asian ideograph -9999East Asian ideograph -99A5East Asian ideograph -99A8East Asian ideograph -99ACEast Asian ideograph -99AEEast Asian ideograph -99ADEast Asian ideograph -99B3East Asian ideograph -99B1East Asian ideograph -99B4East Asian ideograph -99C1East Asian ideograph -99D0East Asian ideograph -99DDEast Asian ideograph -99D5East Asian ideograph -99DFEast Asian ideograph -99DBEast Asian ideograph -99D2East Asian ideograph -99D9East Asian ideograph -99D1East Asian ideograph -99EDEast Asian ideograph -99F1East Asian ideograph -9A01East Asian ideograph -99FFEast Asian ideograph -99E2East Asian ideograph -9A0EEast Asian ideograph -9A19East Asian ideograph -9A16East Asian ideograph -9A2BEast Asian ideograph -9A30East Asian ideograph -9A37East Asian ideograph -9A43East Asian ideograph -9A45East Asian ideograph -9A40East Asian ideograph -9A3EEast Asian ideograph -9A55East Asian ideograph -9A5AEast Asian ideograph -9A5BEast Asian ideograph -9A57East Asian ideograph -9A5FEast Asian ideograph -9A62East Asian ideograph -9A65East Asian ideograph -9A6AEast Asian ideograph -9AA8East Asian ideograph -9AAFEast Asian ideograph -9AB0East Asian ideograph -9AB7East Asian ideograph -9AB8East Asian ideograph -9ABCEast Asian ideograph -9ACFEast Asian ideograph -9AD3East Asian ideograph -9AD4East Asian ideograph -9AD2East Asian ideograph -9AD8East Asian ideograph -9AE5East Asian ideograph -9AEEEast Asian ideograph -9AFBEast Asian ideograph -9AEDEast Asian ideograph -9B03East Asian ideograph -9B06East Asian ideograph -9B0DEast Asian ideograph -9B1AEast Asian ideograph -9B22East Asian ideograph -9B25East Asian ideograph -9B27East Asian ideograph -9B31East Asian ideograph -9B32East Asian ideograph -9B3CEast Asian ideograph -9B41East Asian ideograph -9B42East Asian ideograph -9B45East Asian ideograph -9B44East Asian ideograph -9B4FEast Asian ideograph -9B54East Asian ideograph -9B58East Asian ideograph -9B5AEast Asian ideograph -9B77East Asian ideograph -9B6FEast Asian ideograph -9B91East Asian ideograph -9BABEast Asian ideograph -9BAEEast Asian ideograph -9BAAEast Asian ideograph -9BCAEast Asian ideograph -9BC9East Asian ideograph -9BE8East Asian ideograph -9BE7East Asian ideograph -9C13East Asian ideograph -9C0DEast Asian ideograph -9BFDEast Asian ideograph -9C2DEast Asian ideograph -9C25East Asian ideograph -9C31East Asian ideograph -9C3EEast Asian ideograph -9C3BEast Asian ideograph -9C54East Asian ideograph -9C57East Asian ideograph -9C56East Asian ideograph -9C49East Asian ideograph -9C77East Asian ideograph -9C78East Asian ideograph -9CE5East Asian ideograph -9CE9East Asian ideograph -9CF6East Asian ideograph -9CF4East Asian ideograph -9CF3East Asian ideograph -9D06East Asian ideograph -9D09East Asian ideograph -9D15East Asian ideograph -9D23East Asian ideograph -9D28East Asian ideograph -9D26East Asian ideograph -9D1BEast Asian ideograph -E95F9D12Variant of 4B623B which maps to 9D12 -9D3BEast Asian ideograph -9D3FEast Asian ideograph -9D61East Asian ideograph -9D51East Asian ideograph -9D60East Asian ideograph -9D5DEast Asian ideograph -9D89East Asian ideograph -9D72East Asian ideograph -9D6AEast Asian ideograph -9D6CEast Asian ideograph -9DB4East Asian ideograph -9DAFEast Asian ideograph -9DC2East Asian ideograph -9DD3East Asian ideograph -9DD7East Asian ideograph -9DE5East Asian ideograph -9DF9East Asian ideograph -9DFAEast Asian ideograph -9E1AEast Asian ideograph -9E1EEast Asian ideograph -9E79East Asian ideograph -9E7DEast Asian ideograph -9E7CEast Asian ideograph -9E7FEast Asian ideograph -9E82East Asian ideograph -9E8BEast Asian ideograph -9E97East Asian ideograph -9E92East Asian ideograph -9E93East Asian ideograph -9E9DEast Asian ideograph -9E9FEast Asian ideograph -9EA5East Asian ideograph -9EA9East Asian ideograph -9EB4East Asian ideograph -9EB5East Asian ideograph -9EBBEast Asian ideograph -9EBCEast Asian ideograph -9EBEEast Asian ideograph -9EC3East Asian ideograph -9ECDEast Asian ideograph -9ECEEast Asian ideograph -9ECFEast Asian ideograph -9ED1East Asian ideograph -58A8East Asian ideograph -9ED8East Asian ideograph -9ED4East Asian ideograph -9EDEEast Asian ideograph -9EDCEast Asian ideograph -9EDBEast Asian ideograph -9EDDEast Asian ideograph -9EE0East Asian ideograph -9EE8East Asian ideograph -9EEFEast Asian ideograph -9EF4East Asian ideograph -9EF7East Asian ideograph -9F07East Asian ideograph -9F0EEast Asian ideograph -9F13East Asian ideograph -9F15East Asian ideograph -9F19East Asian ideograph -9F20East Asian ideograph -9F2CEast Asian ideograph -9F34East Asian ideograph -9F3BEast Asian ideograph -9F3EEast Asian ideograph -9F4AEast Asian ideograph -9F4BEast Asian ideograph -9F52East Asian ideograph -9F5FEast Asian ideograph -9F63East Asian ideograph -E9609F61Variant of 456324 which maps to 9F61 -9F66East Asian ideograph -9F5CEast Asian ideograph -9F6CEast Asian ideograph -9F6AEast Asian ideograph -9F77East Asian ideograph -9F72East Asian ideograph -9F8DEast Asian ideograph -9F94East Asian ideograph -9F9CEast Asian ideograph -8288East Asian ideograph -4E0FEast Asian ideograph -5187East Asian ideograph -4E28East Asian ideograph -4E31East Asian ideograph -4E36East Asian ideograph -4E3FEast Asian ideograph -4E42East Asian ideograph -738DEast Asian ideograph -4E5CEast Asian ideograph -6C39East Asian ideograph -4E85East Asian ideograph -4EA0East Asian ideograph -4EA2East Asian ideograph -4EB3East Asian ideograph -E9614EB6Variant of 4B6455 which maps to 4EB6 -4EB9East Asian ideograph -4EBCEast Asian ideograph -4EC9East Asian ideograph -4EC8East Asian ideograph -E9E2East Asian ideograph not in Unicode -4EE8East Asian ideograph -4EE1East Asian ideograph -4F08East Asian ideograph -4F0EEast Asian ideograph -4F03East Asian ideograph -4F22East Asian ideograph -4EF5East Asian ideograph -4F07East Asian ideograph -4F00East Asian ideograph -4F0BEast Asian ideograph -4F3BEast Asian ideograph -4F58East Asian ideograph -4F62East Asian ideograph -4F64East Asian ideograph -4F49East Asian ideograph -4F3EEast Asian ideograph -4F66East Asian ideograph -4F67East Asian ideograph -4F68East Asian ideograph -4F5AEast Asian ideograph -4F5FEast Asian ideograph -4F82East Asian ideograph -4F7CEast Asian ideograph -4F98East Asian ideograph -4F92East Asian ideograph -4F7DEast Asian ideograph -4F80East Asian ideograph -4F74East Asian ideograph -4F76East Asian ideograph -4FA2East Asian ideograph -4F91East Asian ideograph -4F95East Asian ideograph -4F4CEast Asian ideograph -4F97East Asian ideograph -4F94East Asian ideograph -4F79East Asian ideograph -4F9AEast Asian ideograph -4F81East Asian ideograph -4F78East Asian ideograph -4F9CEast Asian ideograph -4F90East Asian ideograph -4F7AEast Asian ideograph -4FCDEast Asian ideograph -4FE4East Asian ideograph -4FB7East Asian ideograph -4FC5East Asian ideograph -4FC9East Asian ideograph -4FE5East Asian ideograph -4FE7East Asian ideograph -4FDCEast Asian ideograph -4FD4East Asian ideograph -4FC1East Asian ideograph -4FDBEast Asian ideograph -4FC6East Asian ideograph -4FB9East Asian ideograph -501EEast Asian ideograph -503FEast Asian ideograph -5005East Asian ideograph -5007East Asian ideograph -5013East Asian ideograph -5022East Asian ideograph -4FF5East Asian ideograph -4FF4East Asian ideograph -5037East Asian ideograph -502EEast Asian ideograph -4FF6East Asian ideograph -501CEast Asian ideograph -502CEast Asian ideograph -5010East Asian ideograph -503DEast Asian ideograph -506FEast Asian ideograph -5050East Asian ideograph -5070East Asian ideograph -5053East Asian ideograph -506AEast Asian ideograph -5056East Asian ideograph -506DEast Asian ideograph -505DEast Asian ideograph -5048East Asian ideograph -5058East Asian ideograph -5072East Asian ideograph -5041East Asian ideograph -5015East Asian ideograph -507AEast Asian ideograph -506CEast Asian ideograph -505FEast Asian ideograph -506BEast Asian ideograph -5094East Asian ideograph -509EEast Asian ideograph -509BEast Asian ideograph -509AEast Asian ideograph -50A3East Asian ideograph -508CEast Asian ideograph -5088East Asian ideograph -508EEast Asian ideograph -5095East Asian ideograph -50A6East Asian ideograph -5092East Asian ideograph -509CEast Asian ideograph -50C7East Asian ideograph -50C9East Asian ideograph -50CAEast Asian ideograph -50B4East Asian ideograph -50C2East Asian ideograph -50BAEast Asian ideograph -50CDEast Asian ideograph -50D4East Asian ideograph -50EFEast Asian ideograph -50E6East Asian ideograph -50F4East Asian ideograph -50CEEast Asian ideograph -50DDEast Asian ideograph -50F3East Asian ideograph -50E8East Asian ideograph -50F0East Asian ideograph -50D9East Asian ideograph -50ECEast Asian ideograph -510EEast Asian ideograph -5105East Asian ideograph -50FCEast Asian ideograph -5106East Asian ideograph -5107East Asian ideograph -510FEast Asian ideograph -50FEEast Asian ideograph -510BEast Asian ideograph -50FDEast Asian ideograph -5101East Asian ideograph -5115East Asian ideograph -5113East Asian ideograph -511AEast Asian ideograph -9797East Asian ideograph -5126East Asian ideograph -5124East Asian ideograph -5129East Asian ideograph -5131East Asian ideograph -5135East Asian ideograph -5133East Asian ideograph -513AEast Asian ideograph -5139East Asian ideograph -513BEast Asian ideograph -5159East Asian ideograph -515BEast Asian ideograph -515DEast Asian ideograph -515EEast Asian ideograph -515FEast Asian ideograph -5161East Asian ideograph -5163East Asian ideograph -5182East Asian ideograph -5184East Asian ideograph -518FEast Asian ideograph -5194East Asian ideograph -5193East Asian ideograph -5196East Asian ideograph -51A1East Asian ideograph -51A3East Asian ideograph -51AAEast Asian ideograph -51ABEast Asian ideograph -51B1East Asian ideograph -51BCEast Asian ideograph -51CAEast Asian ideograph -51C7East Asian ideograph -51D1East Asian ideograph -51D0East Asian ideograph -51D3East Asian ideograph -51D9East Asian ideograph -51DFEast Asian ideograph -51E2East Asian ideograph -5160East Asian ideograph -51F5East Asian ideograph -51F7East Asian ideograph -5213East Asian ideograph -5216East Asian ideograph -521CEast Asian ideograph -5231East Asian ideograph -5235East Asian ideograph -5232East Asian ideograph -5233East Asian ideograph -5244East Asian ideograph -5249East Asian ideograph -5260East Asian ideograph -525AEast Asian ideograph -5252East Asian ideograph -525EEast Asian ideograph -525FEast Asian ideograph -5255East Asian ideograph -526EEast Asian ideograph -5268East Asian ideograph -7B9AEast Asian ideograph -5278East Asian ideograph -5282East Asian ideograph -5281East Asian ideograph -528CEast Asian ideograph -528AEast Asian ideograph -5290East Asian ideograph -5293East Asian ideograph -5296East Asian ideograph -5298East Asian ideograph -529AEast Asian ideograph -5299East Asian ideograph -52A6East Asian ideograph -52ADEast Asian ideograph -52AEEast Asian ideograph -52BBEast Asian ideograph -52BCEast Asian ideograph -52CAEast Asian ideograph -52CDEast Asian ideograph -52D0East Asian ideograph -52D1East Asian ideograph -52D4East Asian ideograph -52D6East Asian ideograph -52E3East Asian ideograph -52E1East Asian ideograph -55E7East Asian ideograph -52E9East Asian ideograph -52F0East Asian ideograph -52F1East Asian ideograph -52F7East Asian ideograph -52F9East Asian ideograph -52FAEast Asian ideograph -52FCEast Asian ideograph -5307East Asian ideograph -5303East Asian ideograph -E9E3East Asian ideograph not in Unicode -530AEast Asian ideograph -530BEast Asian ideograph -5311East Asian ideograph -6706East Asian ideograph -531AEast Asian ideograph -531CEast Asian ideograph -531FEast Asian ideograph -532DEast Asian ideograph -5330East Asian ideograph -5335East Asian ideograph -5338East Asian ideograph -533DEast Asian ideograph -534CEast Asian ideograph -534DEast Asian ideograph -535DEast Asian ideograph -5363East Asian ideograph -E9E4East Asian ideograph not in Unicode -536CEast Asian ideograph -5372East Asian ideograph -537AEast Asian ideograph -5380East Asian ideograph -538EEast Asian ideograph -5393East Asian ideograph -5394East Asian ideograph -5399East Asian ideograph -8652East Asian ideograph -53A4East Asian ideograph -53ABEast Asian ideograph -53B5East Asian ideograph -53B9East Asian ideograph -53D0East Asian ideograph -53DAEast Asian ideograph -53FBEast Asian ideograph -535FEast Asian ideograph -5414East Asian ideograph -5406East Asian ideograph -544CEast Asian ideograph -5445East Asian ideograph -541AEast Asian ideograph -5432East Asian ideograph -5421East Asian ideograph -5430East Asian ideograph -5454East Asian ideograph -543DEast Asian ideograph -544FEast Asian ideograph -542AEast Asian ideograph -5422East Asian ideograph -5423East Asian ideograph -545FEast Asian ideograph -549CEast Asian ideograph -5488East Asian ideograph -547FEast Asian ideograph -5482East Asian ideograph -546DEast Asian ideograph -5491East Asian ideograph -5494East Asian ideograph -546BEast Asian ideograph -548DEast Asian ideograph -5463East Asian ideograph -5474East Asian ideograph -5466East Asian ideograph -5464East Asian ideograph -54A4East Asian ideograph -54A1East Asian ideograph -54ADEast Asian ideograph -54BAEast Asian ideograph -54CFEast Asian ideograph -54BEEast Asian ideograph -54A5East Asian ideograph -54A7East Asian ideograph -54B5East Asian ideograph -54A2East Asian ideograph -5472East Asian ideograph -5470East Asian ideograph -54BCEast Asian ideograph -54B7East Asian ideograph -54DEEast Asian ideograph -54D6East Asian ideograph -54AEEast Asian ideograph -54BFEast Asian ideograph -54C6East Asian ideograph -551AEast Asian ideograph -54E2East Asian ideograph -5507East Asian ideograph -5517East Asian ideograph -54FDEast Asian ideograph -54E7East Asian ideograph -54F3East Asian ideograph -54E4East Asian ideograph -550AEast Asian ideograph -54FFEast Asian ideograph -5518East Asian ideograph -5504East Asian ideograph -54EFEast Asian ideograph -5508East Asian ideograph -54F6East Asian ideograph -54F7East Asian ideograph -550EEast Asian ideograph -5523East Asian ideograph -550FEast Asian ideograph -5511East Asian ideograph -5575East Asian ideograph -5573East Asian ideograph -554CEast Asian ideograph -5576East Asian ideograph -554DEast Asian ideograph -555AEast Asian ideograph -553CEast Asian ideograph -5550East Asian ideograph -5539East Asian ideograph -5548East Asian ideograph -552DEast Asian ideograph -5551East Asian ideograph -552AEast Asian ideograph -5562East Asian ideograph -5536East Asian ideograph -5549East Asian ideograph -5530East Asian ideograph -5540East Asian ideograph -5535East Asian ideograph -5545East Asian ideograph -553FEast Asian ideograph -5541East Asian ideograph -5565East Asian ideograph -5591East Asian ideograph -5577East Asian ideograph -55A8East Asian ideograph -55ADEast Asian ideograph -5605East Asian ideograph -5593East Asian ideograph -5586East Asian ideograph -5588East Asian ideograph -55B4East Asian ideograph -E96255E2Variant of 2D7143 which maps to 55E2 -5581East Asian ideograph -558EEast Asian ideograph -55B5East Asian ideograph -558FEast Asian ideograph -5559East Asian ideograph -55A4East Asian ideograph -5592East Asian ideograph -5599East Asian ideograph -55F4East Asian ideograph -55CCEast Asian ideograph -55D0East Asian ideograph -55DBEast Asian ideograph -55CDEast Asian ideograph -55DEEast Asian ideograph -55D9East Asian ideograph -55C3East Asian ideograph -55C9East Asian ideograph -55CAEast Asian ideograph -55DDEast Asian ideograph -55D4East Asian ideograph -55C4East Asian ideograph -55E9East Asian ideograph -55CFEast Asian ideograph -55D2East Asian ideograph -55E5East Asian ideograph -55D6East Asian ideograph -55C1East Asian ideograph -55F2East Asian ideograph -5627East Asian ideograph -55FBEast Asian ideograph -5612East Asian ideograph -55F8East Asian ideograph -560FEast Asian ideograph -55F9East Asian ideograph -561EEast Asian ideograph -560CEast Asian ideograph -561CEast Asian ideograph -5610East Asian ideograph -5601East Asian ideograph -5613East Asian ideograph -55F6East Asian ideograph -5602East Asian ideograph -561DEast Asian ideograph -55FFEast Asian ideograph -5642East Asian ideograph -564CEast Asian ideograph -564BEast Asian ideograph -5640East Asian ideograph -5635East Asian ideograph -5649East Asian ideograph -5641East Asian ideograph -5658East Asian ideograph -5620East Asian ideograph -5654East Asian ideograph -562AEast Asian ideograph -563DEast Asian ideograph -562CEast Asian ideograph -5638East Asian ideograph -564DEast Asian ideograph -562BEast Asian ideograph -564FEast Asian ideograph -5670East Asian ideograph -565FEast Asian ideograph -567CEast Asian ideograph -5660East Asian ideograph -5676East Asian ideograph -5666East Asian ideograph -5673East Asian ideograph -566DEast Asian ideograph -5672East Asian ideograph -5693East Asian ideograph -568CEast Asian ideograph -56BAEast Asian ideograph -5686East Asian ideograph -5684East Asian ideograph -5691East Asian ideograph -568AEast Asian ideograph -569EEast Asian ideograph -569CEast Asian ideograph -569AEast Asian ideograph -5699East Asian ideograph -56ADEast Asian ideograph -56A6East Asian ideograph -56ACEast Asian ideograph -56B2East Asian ideograph -56B3East Asian ideograph -56C3East Asian ideograph -56C5East Asian ideograph -56CFEast Asian ideograph -56CDEast Asian ideograph -56D4East Asian ideograph -56D7East Asian ideograph -56DDEast Asian ideograph -56E1East Asian ideograph -56DFEast Asian ideograph -56EBEast Asian ideograph -56EEEast Asian ideograph -56E7East Asian ideograph -56FBEast Asian ideograph -56F7East Asian ideograph -56F9East Asian ideograph -56FFEast Asian ideograph -5705East Asian ideograph -5704East Asian ideograph -5702East Asian ideograph -570AEast Asian ideograph -5709East Asian ideograph -5707East Asian ideograph -570CEast Asian ideograph -5715East Asian ideograph -5714East Asian ideograph -571AEast Asian ideograph -571BEast Asian ideograph -571CEast Asian ideograph -571DEast Asian ideograph -571EEast Asian ideograph -5724East Asian ideograph -572EEast Asian ideograph -5729East Asian ideograph -5738East Asian ideograph -572AEast Asian ideograph -5749East Asian ideograph -5745East Asian ideograph -574BEast Asian ideograph -574CEast Asian ideograph -573FEast Asian ideograph -5768East Asian ideograph -578AEast Asian ideograph -576DEast Asian ideograph -5774East Asian ideograph -5767East Asian ideograph -5770East Asian ideograph -5771East Asian ideograph -576EEast Asian ideograph -5776East Asian ideograph -5789East Asian ideograph -577FEast Asian ideograph -5775East Asian ideograph -577BEast Asian ideograph -5788East Asian ideograph -5773East Asian ideograph -579FEast Asian ideograph -5790East Asian ideograph -5793East Asian ideograph -579EEast Asian ideograph -57B5East Asian ideograph -579AEast Asian ideograph -5794East Asian ideograph -57A4East Asian ideograph -5799East Asian ideograph -578CEast Asian ideograph -5797East Asian ideograph -579DEast Asian ideograph -579CEast Asian ideograph -57A7East Asian ideograph -57A1East Asian ideograph -EA00East Asian ideograph not found in unified han -5795East Asian ideograph -57B8East Asian ideograph -57C7East Asian ideograph -5809East Asian ideograph -57BEEast Asian ideograph -57DBEast Asian ideograph -57D5East Asian ideograph -57D2East Asian ideograph -57C6East Asian ideograph -57C4East Asian ideograph -70FEEast Asian ideograph -57E3East Asian ideograph -57FBEast Asian ideograph -5803East Asian ideograph -57F6East Asian ideograph -57E6East Asian ideograph -57EDEast Asian ideograph -5800East Asian ideograph -57ECEast Asian ideograph -5807East Asian ideograph -580EEast Asian ideograph -580FEast Asian ideograph -57F4East Asian ideograph -5810East Asian ideograph -580DEast Asian ideograph -57EFEast Asian ideograph -5801East Asian ideograph -5812East Asian ideograph -57FDEast Asian ideograph -57F8East Asian ideograph -580CEast Asian ideograph -5813East Asian ideograph -57F0East Asian ideograph -580BEast Asian ideograph -57F3East Asian ideograph -5804East Asian ideograph -57CFEast Asian ideograph -57DDEast Asian ideograph -5847East Asian ideograph -581BEast Asian ideograph -5819East Asian ideograph -5833East Asian ideograph -581EEast Asian ideograph -583FEast Asian ideograph -5827East Asian ideograph -5828East Asian ideograph -582EEast Asian ideograph -581DEast Asian ideograph -5844East Asian ideograph -5848East Asian ideograph -5818East Asian ideograph -57F5East Asian ideograph -582DEast Asian ideograph -5820East Asian ideograph -584EEast Asian ideograph -585DEast Asian ideograph -5859East Asian ideograph -584BEast Asian ideograph -5865East Asian ideograph -586CEast Asian ideograph -5852East Asian ideograph -5864East Asian ideograph -5853East Asian ideograph -584FEast Asian ideograph -583DEast Asian ideograph -584DEast Asian ideograph -5856East Asian ideograph -589AEast Asian ideograph -5892East Asian ideograph -588EEast Asian ideograph -5889East Asian ideograph -5840East Asian ideograph -589BEast Asian ideograph -587CEast Asian ideograph -5888East Asian ideograph -5890East Asian ideograph -5898East Asian ideograph -587DEast Asian ideograph -587FEast Asian ideograph -5881East Asian ideograph -58A9East Asian ideograph -58A1East Asian ideograph -58B1East Asian ideograph -58ADEast Asian ideograph -58A0East Asian ideograph -58A3East Asian ideograph -58A6East Asian ideograph -58C8East Asian ideograph -58BCEast Asian ideograph -58BFEast Asian ideograph -58C6East Asian ideograph -58BAEast Asian ideograph -58D6East Asian ideograph -58D2East Asian ideograph -58CEEast Asian ideograph -58E0East Asian ideograph -58DAEast Asian ideograph -58FCEast Asian ideograph -5902East Asian ideograph -5906East Asian ideograph -6535East Asian ideograph -5910East Asian ideograph -8641East Asian ideograph -592CEast Asian ideograph -592FEast Asian ideograph -593CEast Asian ideograph -5940East Asian ideograph -594DEast Asian ideograph -5953East Asian ideograph -595CEast Asian ideograph -5961East Asian ideograph -596CEast Asian ideograph -596DEast Asian ideograph -597CEast Asian ideograph -59A7East Asian ideograph -5998East Asian ideograph -599AEast Asian ideograph -59A0East Asian ideograph -5997East Asian ideograph -5990East Asian ideograph -59C5East Asian ideograph -59B5East Asian ideograph -59CFEast Asian ideograph -59BAEast Asian ideograph -59B8East Asian ideograph -59B2East Asian ideograph -59B7East Asian ideograph -59C1East Asian ideograph -59F9East Asian ideograph -59F8East Asian ideograph -59EEEast Asian ideograph -59F1East Asian ideograph -5A00East Asian ideograph -59DEEast Asian ideograph -59FDEast Asian ideograph -59F6East Asian ideograph -59DDEast Asian ideograph -59FAEast Asian ideograph -59E4East Asian ideograph -5A2AEast Asian ideograph -5A16East Asian ideograph -5A09East Asian ideograph -5A12East Asian ideograph -5A60East Asian ideograph -5A67East Asian ideograph -5A38East Asian ideograph -5A5EEast Asian ideograph -5A6DEast Asian ideograph -5A35East Asian ideograph -5A55East Asian ideograph -5A2CEast Asian ideograph -5A50East Asian ideograph -5A65East Asian ideograph -5A64East Asian ideograph -5A8AEast Asian ideograph -5ACFEast Asian ideograph -5A7AEast Asian ideograph -5A9FEast Asian ideograph -5AA0East Asian ideograph -5AA6East Asian ideograph -5A8CEast Asian ideograph -5AA7East Asian ideograph -5A9EEast Asian ideograph -5AA2East Asian ideograph -5A9CEast Asian ideograph -5A7CEast Asian ideograph -5A96East Asian ideograph -5A93East Asian ideograph -5AACEast Asian ideograph -5AAEEast Asian ideograph -5A95East Asian ideograph -5AAFEast Asian ideograph -5AC8East Asian ideograph -5AB5East Asian ideograph -5AC4East Asian ideograph -5AB7East Asian ideograph -5AD1East Asian ideograph -5A90East Asian ideograph -5AB8East Asian ideograph -5ABAEast Asian ideograph -5AAAEast Asian ideograph -5AD3East Asian ideograph -5AB1East Asian ideograph -5ADCEast Asian ideograph -5AE5East Asian ideograph -5AE0East Asian ideograph -5AEAEast Asian ideograph -5ADAEast Asian ideograph -5AEBEast Asian ideograph -5AFFEast Asian ideograph -5AFDEast Asian ideograph -5B08East Asian ideograph -5B0DEast Asian ideograph -5B03East Asian ideograph -5B17East Asian ideograph -5B16East Asian ideograph -5B19East Asian ideograph -5B1BEast Asian ideograph -5B21East Asian ideograph -5B2CEast Asian ideograph -5B32East Asian ideograph -5B3FEast Asian ideograph -5B45East Asian ideograph -5B4CEast Asian ideograph -5B4BEast Asian ideograph -5B56East Asian ideograph -5B5BEast Asian ideograph -5B62East Asian ideograph -5B65East Asian ideograph -5B67East Asian ideograph -E9E5East Asian ideograph not in Unicode -5B6CEast Asian ideograph -5B6EEast Asian ideograph -5B7BEast Asian ideograph -5B7CEast Asian ideograph -5B80East Asian ideograph -5B84East Asian ideograph -E9E6East Asian ideograph not in Unicode -5B95East Asian ideograph -5B93East Asian ideograph -5BACEast Asian ideograph -5BA7East Asian ideograph -5BB7East Asian ideograph -5BC1East Asian ideograph -EA01East Asian ideography not found in unified han -5BC9East Asian ideograph -5BD4East Asian ideograph -5BC3East Asian ideograph -5BD6East Asian ideograph -5BD7East Asian ideograph -5BE0East Asian ideograph -5BEAEast Asian ideograph -5BF0East Asian ideograph -5BEFEast Asian ideograph -5C00East Asian ideograph -5C57East Asian ideograph -5C15East Asian ideograph -5C22East Asian ideograph -5C25East Asian ideograph -5C2AEast Asian ideograph -5C2FEast Asian ideograph -5C32East Asian ideograph -5C3BEast Asian ideograph -5C44East Asian ideograph -5C49East Asian ideograph -5C59East Asian ideograph -5C5DEast Asian ideograph -5C5FEast Asian ideograph -5C63East Asian ideograph -5C67East Asian ideograph -5C68East Asian ideograph -5C6DEast Asian ideograph -5C6EEast Asian ideograph -5C74East Asian ideograph -5C73East Asian ideograph -5C77East Asian ideograph -5C7AEast Asian ideograph -5C7CEast Asian ideograph -5C8FEast Asian ideograph -5C88East Asian ideograph -5C8DEast Asian ideograph -5C99East Asian ideograph -5CA6East Asian ideograph -5CA0East Asian ideograph -5CA2East Asian ideograph -5CB5East Asian ideograph -5CA7East Asian ideograph -5CA8East Asian ideograph -5CACEast Asian ideograph -5CA3East Asian ideograph -5CB6East Asian ideograph -5CC1East Asian ideograph -5CADEast Asian ideograph -5CD5East Asian ideograph -5CD3East Asian ideograph -E9E7East Asian ideograph not in Unicode -5CE0East Asian ideograph -5CD2East Asian ideograph -5CDDEast Asian ideograph -5CCBEast Asian ideograph -5CC7East Asian ideograph -5CDCEast Asian ideograph -5D00East Asian ideograph -5CFFEast Asian ideograph -5CEBEast Asian ideograph -5CF4East Asian ideograph -5CF1East Asian ideograph -5D1EEast Asian ideograph -5D12East Asian ideograph -5D1AEast Asian ideograph -5D0CEast Asian ideograph -5D20East Asian ideograph -5D21East Asian ideograph -5D27East Asian ideograph -5D0DEast Asian ideograph -5D26East Asian ideograph -5D2EEast Asian ideograph -5D24East Asian ideograph -5D36East Asian ideograph -5D3EEast Asian ideograph -5D4BEast Asian ideograph -5D57East Asian ideograph -5D34East Asian ideograph -5D3FEast Asian ideograph -5D52East Asian ideograph -5D3DEast Asian ideograph -5D4EEast Asian ideograph -5D59East Asian ideograph -5D47East Asian ideograph -5D32East Asian ideograph -5D42East Asian ideograph -5D74East Asian ideograph -5D6FEast Asian ideograph -5D6BEast Asian ideograph -5D75East Asian ideograph -5D4AEast Asian ideograph -5D6CEast Asian ideograph -5D62East Asian ideograph -5D82East Asian ideograph -5D79East Asian ideograph -5D8EEast Asian ideograph -5D81East Asian ideograph -5D7EEast Asian ideograph -5D92East Asian ideograph -5D99East Asian ideograph -5D97East Asian ideograph -5DA2East Asian ideograph -5DA1East Asian ideograph -5D93East Asian ideograph -5DA0East Asian ideograph -5D94East Asian ideograph -5DACEast Asian ideograph -5DA7East Asian ideograph -5DB0East Asian ideograph -5DB4East Asian ideograph -5DAEEast Asian ideograph -5DB6East Asian ideograph -5DB8East Asian ideograph -5DBFEast Asian ideograph -5DB7East Asian ideograph -5DC3East Asian ideograph -5DC7East Asian ideograph -5DC9East Asian ideograph -5DCBEast Asian ideograph -5DD8East Asian ideograph -5DDBEast Asian ideograph -5DDCEast Asian ideograph -5DE4East Asian ideograph -5E00East Asian ideograph -51E7East Asian ideograph -5E14East Asian ideograph -5E17East Asian ideograph -5E19East Asian ideograph -5E12East Asian ideograph -5E1FEast Asian ideograph -5E23East Asian ideograph -5E21East Asian ideograph -5E22East Asian ideograph -5E28East Asian ideograph -5E44East Asian ideograph -5E43East Asian ideograph -5E42East Asian ideograph -5E4EEast Asian ideograph -5E58East Asian ideograph -5E48East Asian ideograph -5E5EEast Asian ideograph -5E61East Asian ideograph -5E68East Asian ideograph -5E6CEast Asian ideograph -5E6AEast Asian ideograph -5E6EEast Asian ideograph -5E6DEast Asian ideograph -5E70East Asian ideograph -5E75East Asian ideograph -5E80East Asian ideograph -5E8BEast Asian ideograph -5EA4East Asian ideograph -5EA5East Asian ideograph -5EAFEast Asian ideograph -5EB9East Asian ideograph -5EB3East Asian ideograph -5EC4East Asian ideograph -5ECCEast Asian ideograph -5ECBEast Asian ideograph -5ECDEast Asian ideograph -5ED2East Asian ideograph -5ED1East Asian ideograph -5ED5East Asian ideograph -5ED4East Asian ideograph -5ED9East Asian ideograph -5ECEEast Asian ideograph -5EE1East Asian ideograph -5EE7East Asian ideograph -5EE8East Asian ideograph -5EEDEast Asian ideograph -5EF1East Asian ideograph -5EF4East Asian ideograph -5F07East Asian ideograph -5F0BEast Asian ideograph -5F28East Asian ideograph -5F22East Asian ideograph -5F23East Asian ideograph -5F24East Asian ideograph -5F33East Asian ideograph -5F30East Asian ideograph -5F38East Asian ideograph -5F40East Asian ideograph -5F44East Asian ideograph -5F4DEast Asian ideograph -5F50East Asian ideograph -5F54East Asian ideograph -5F56East Asian ideograph -5F58East Asian ideograph -5F60East Asian ideograph -5F61East Asian ideograph -5F63East Asian ideograph -809CEast Asian ideograph -5F67East Asian ideograph -5F72East Asian ideograph -5F73East Asian ideograph -5F74East Asian ideograph -5F82East Asian ideograph -5F89East Asian ideograph -5F94East Asian ideograph -EA02East Asian ideograph not found in unified han -5F9CEast Asian ideograph -5F9AEast Asian ideograph -5FAFEast Asian ideograph -5FBCEast Asian ideograph -5FC9East Asian ideograph -5FD1East Asian ideograph -5FD2East Asian ideograph -5FD0East Asian ideograph -5FCEEast Asian ideograph -5FEDEast Asian ideograph -5FEEEast Asian ideograph -5FF8East Asian ideograph -5FE1East Asian ideograph -5FE4East Asian ideograph -5FEAEast Asian ideograph -6026East Asian ideograph -6029East Asian ideograph -602BEast Asian ideograph -6019East Asian ideograph -6008East Asian ideograph -600AEast Asian ideograph -600CEast Asian ideograph -601BEast Asian ideograph -6017East Asian ideograph -6033East Asian ideograph -600DEast Asian ideograph -6010East Asian ideograph -6039East Asian ideograph -6013East Asian ideograph -6054East Asian ideograph -605DEast Asian ideograph -6047East Asian ideograph -6049East Asian ideograph -6053East Asian ideograph -6067East Asian ideograph -604CEast Asian ideograph -6041East Asian ideograph -6077East Asian ideograph -6042East Asian ideograph -605FEast Asian ideograph -6061East Asian ideograph -608AEast Asian ideograph -6092East Asian ideograph -609DEast Asian ideograph -6081East Asian ideograph -609EEast Asian ideograph -6083East Asian ideograph -6097East Asian ideograph -60A7East Asian ideograph -6095East Asian ideograph -60C7East Asian ideograph -60B0East Asian ideograph -60BEEast Asian ideograph -60D3East Asian ideograph -60D4East Asian ideograph -60CEEast Asian ideograph -60CFEast Asian ideograph -60D9East Asian ideograph -60B3East Asian ideograph -60DDEast Asian ideograph -60C4East Asian ideograph -60B1East Asian ideograph -60E3East Asian ideograph -60E2East Asian ideograph -60E5East Asian ideograph -60DBEast Asian ideograph -60E9East Asian ideograph -6114East Asian ideograph -6103East Asian ideograph -6119East Asian ideograph -60FDEast Asian ideograph -610DEast Asian ideograph -610AEast Asian ideograph -6110East Asian ideograph -6112East Asian ideograph -60F2East Asian ideograph -6125East Asian ideograph -60F8East Asian ideograph -6121East Asian ideograph -60FCEast Asian ideograph -6106East Asian ideograph -6149East Asian ideograph -614AEast Asian ideograph -612BEast Asian ideograph -6129East Asian ideograph -6150East Asian ideograph -53AFEast Asian ideograph -6130East Asian ideograph -6141East Asian ideograph -6137East Asian ideograph -6146East Asian ideograph -615EEast Asian ideograph -6175East Asian ideograph -6174East Asian ideograph -6183East Asian ideograph -6171East Asian ideograph -616AEast Asian ideograph -6173East Asian ideograph -6164East Asian ideograph -6153East Asian ideograph -618BEast Asian ideograph -616FEast Asian ideograph -6165East Asian ideograph -615CEast Asian ideograph -619DEast Asian ideograph -61A6East Asian ideograph -61A2East Asian ideograph -61A8East Asian ideograph -619CEast Asian ideograph -61AFEast Asian ideograph -6196East Asian ideograph -6197East Asian ideograph -61ADEast Asian ideograph -6192East Asian ideograph -61AEEast Asian ideograph -618DEast Asian ideograph -61CBEast Asian ideograph -61CCEast Asian ideograph -61C6East Asian ideograph -61BAEast Asian ideograph -61B8East Asian ideograph -61E0East Asian ideograph -61E5East Asian ideograph -61DCEast Asian ideograph -61DFEast Asian ideograph -61F3East Asian ideograph -6201East Asian ideograph -6204East Asian ideograph -6207East Asian ideograph -6209East Asian ideograph -6214East Asian ideograph -6223East Asian ideograph -6225East Asian ideograph -6224East Asian ideograph -6229East Asian ideograph -622DEast Asian ideograph -97EFEast Asian ideograph -6239East Asian ideograph -623AEast Asian ideograph -623DEast Asian ideograph -6243East Asian ideograph -6246East Asian ideograph -6245East Asian ideograph -624AEast Asian ideograph -6250East Asian ideograph -625EEast Asian ideograph -6268East Asian ideograph -6260East Asian ideograph -625AEast Asian ideograph -6262East Asian ideograph -6266East Asian ideograph -6286East Asian ideograph -628EEast Asian ideograph -62A3East Asian ideograph -6282East Asian ideograph -6285East Asian ideograph -629DEast Asian ideograph -62A6East Asian ideograph -62D1East Asian ideograph -62E4East Asian ideograph -62B6East Asian ideograph -62C3East Asian ideograph -630DEast Asian ideograph -62F5East Asian ideograph -630CEast Asian ideograph -6360East Asian ideograph -62F6East Asian ideograph -6331East Asian ideograph -6345East Asian ideograph -6343East Asian ideograph -6335East Asian ideograph -6353East Asian ideograph -6364East Asian ideograph -6336East Asian ideograph -6344East Asian ideograph -6339East Asian ideograph -6357East Asian ideograph -633CEast Asian ideograph -6358East Asian ideograph -634BEast Asian ideograph -6354East Asian ideograph -637DEast Asian ideograph -63B6East Asian ideograph -6382East Asian ideograph -636CEast Asian ideograph -639FEast Asian ideograph -639EEast Asian ideograph -637FEast Asian ideograph -6381East Asian ideograph -6397East Asian ideograph -63ABEast Asian ideograph -6387East Asian ideograph -637AEast Asian ideograph -638EEast Asian ideograph -6386East Asian ideograph -6375East Asian ideograph -63AFEast Asian ideograph -63B1East Asian ideograph -63B0East Asian ideograph -63AEEast Asian ideograph -637CEast Asian ideograph -6390East Asian ideograph -63ADEast Asian ideograph -636DEast Asian ideograph -63DEEast Asian ideograph -63E5East Asian ideograph -63D3East Asian ideograph -63BDEast Asian ideograph -63C3East Asian ideograph -63F5East Asian ideograph -63E6East Asian ideograph -63E0East Asian ideograph -63D5East Asian ideograph -63F6East Asian ideograph -63F2East Asian ideograph -63F8East Asian ideograph -E9E8East Asian ideograph not in Unicode -63F9East Asian ideograph -63BEEast Asian ideograph -63EBEast Asian ideograph -63DDEast Asian ideograph -E9E9East Asian ideograph not in Unicode -63C4East Asian ideograph -63DCEast Asian ideograph -63D7East Asian ideograph -6412East Asian ideograph -6410East Asian ideograph -6434East Asian ideograph -641BEast Asian ideograph -6420East Asian ideograph -6424East Asian ideograph -6426East Asian ideograph -640CEast Asian ideograph -6415East Asian ideograph -6418East Asian ideograph -640EEast Asian ideograph -EA03East Asian ideography not found in unified han -6422East Asian ideograph -6421East Asian ideograph -6430East Asian ideograph -6441East Asian ideograph -6435East Asian ideograph -6409East Asian ideograph -640AEast Asian ideograph -6440East Asian ideograph -6407East Asian ideograph -643BEast Asian ideograph -643FEast Asian ideograph -645BEast Asian ideograph -644FEast Asian ideograph -646BEast Asian ideograph -6476East Asian ideograph -6474East Asian ideograph -647DEast Asian ideograph -6473East Asian ideograph -644EEast Asian ideograph -6464East Asian ideograph -6482East Asian ideograph -645EEast Asian ideograph -647BEast Asian ideograph -645CEast Asian ideograph -649DEast Asian ideograph -6499East Asian ideograph -648FEast Asian ideograph -6496East Asian ideograph -64A2East Asian ideograph -6490East Asian ideograph -64B6East Asian ideograph -6498East Asian ideograph -649FEast Asian ideograph -E9EAEast Asian ideograph not in Unicode -64B3East Asian ideograph -64D7East Asian ideograph -64D3East Asian ideograph -64BEEast Asian ideograph -64D0East Asian ideograph -64EFEast Asian ideograph -64E1East Asian ideograph -64E5East Asian ideograph -64EBEast Asian ideograph -64E2East Asian ideograph -64EDEast Asian ideograph -64E4East Asian ideograph -64F7East Asian ideograph -6504East Asian ideograph -64FDEast Asian ideograph -6508East Asian ideograph -6509East Asian ideograph -651AEast Asian ideograph -6516East Asian ideograph -651BEast Asian ideograph -6527East Asian ideograph -6522East Asian ideograph -6529East Asian ideograph -6525East Asian ideograph -652EEast Asian ideograph -6541East Asian ideograph -6538East Asian ideograph -6542East Asian ideograph -6549East Asian ideograph -6554East Asian ideograph -6555East Asian ideograph -6567East Asian ideograph -6561East Asian ideograph -656DEast Asian ideograph -657AEast Asian ideograph -6585East Asian ideograph -658CEast Asian ideograph -6592East Asian ideograph -6595East Asian ideograph -659BEast Asian ideograph -659DEast Asian ideograph -65A0East Asian ideograph -65A8East Asian ideograph -65A6East Asian ideograph -65AEEast Asian ideograph -65B6East Asian ideograph -65B8East Asian ideograph -65BFEast Asian ideograph -65C6East Asian ideograph -65C3East Asian ideograph -65C4East Asian ideograph -65C2East Asian ideograph -65D0East Asian ideograph -65D2East Asian ideograph -65DBEast Asian ideograph -65DCEast Asian ideograph -65DDEast Asian ideograph -65DFEast Asian ideograph -65E1East Asian ideograph -65E4East Asian ideograph -65F4East Asian ideograph -65F0East Asian ideograph -6609East Asian ideograph -65FBEast Asian ideograph -65FCEast Asian ideograph -660AEast Asian ideograph -6603East Asian ideograph -6611East Asian ideograph -6615East Asian ideograph -6604East Asian ideograph -6631East Asian ideograph -6621East Asian ideograph -662CEast Asian ideograph -6635East Asian ideograph -661EEast Asian ideograph -663AEast Asian ideograph -6633East Asian ideograph -662BEast Asian ideograph -6634East Asian ideograph -6624East Asian ideograph -6645East Asian ideograph -665FEast Asian ideograph -6665East Asian ideograph -665CEast Asian ideograph -6661East Asian ideograph -665BEast Asian ideograph -6659East Asian ideograph -6667East Asian ideograph -665EEast Asian ideograph -6657East Asian ideograph -667EEast Asian ideograph -666CEast Asian ideograph -6678East Asian ideograph -6673East Asian ideograph -666DEast Asian ideograph -6677East Asian ideograph -6684East Asian ideograph -668CEast Asian ideograph -6693East Asian ideograph -668BEast Asian ideograph -6690East Asian ideograph -6694East Asian ideograph -668AEast Asian ideograph -6698East Asian ideograph -668DEast Asian ideograph -7A25East Asian ideograph -66A0East Asian ideograph -5C21East Asian ideograph -669DEast Asian ideograph -66B2East Asian ideograph -66B5East Asian ideograph -66AAEast Asian ideograph -66ACEast Asian ideograph -66B1East Asian ideograph -66C8East Asian ideograph -66BEEast Asian ideograph -66C0East Asian ideograph -66C7East Asian ideograph -66BBEast Asian ideograph -66C4East Asian ideograph -66CFEast Asian ideograph -66DAEast Asian ideograph -66DBEast Asian ideograph -66E2East Asian ideograph -66E1East Asian ideograph -66E8East Asian ideograph -66E9East Asian ideograph -6705East Asian ideograph -670FEast Asian ideograph -6710East Asian ideograph -6712East Asian ideograph -6713East Asian ideograph -6719East Asian ideograph -6718East Asian ideograph -6723East Asian ideograph -673EEast Asian ideograph -673FEast Asian ideograph -6757East Asian ideograph -6745East Asian ideograph -6747East Asian ideograph -675DEast Asian ideograph -6755East Asian ideograph -674CEast Asian ideograph -6759East Asian ideograph -6748East Asian ideograph -6763East Asian ideograph -6753East Asian ideograph -674AEast Asian ideograph -6793East Asian ideograph -677CEast Asian ideograph -679FEast Asian ideograph -6785East Asian ideograph -677BEast Asian ideograph -6792East Asian ideograph -6776East Asian ideograph -6791East Asian ideograph -6799East Asian ideograph -67A4East Asian ideograph -678FEast Asian ideograph -6772East Asian ideograph -E9636798Variant of 4C3B31 which maps to 6798 -676AEast Asian ideograph -67ACEast Asian ideograph -67A0East Asian ideograph -67A1East Asian ideograph -67F9East Asian ideograph -678DEast Asian ideograph -678CEast Asian ideograph -67FCEast Asian ideograph -6810East Asian ideograph -67C8East Asian ideograph -67CCEast Asian ideograph -67C5East Asian ideograph -67BBEast Asian ideograph -67B0East Asian ideograph -6803East Asian ideograph -67F8East Asian ideograph -67D8East Asian ideograph -67B7East Asian ideograph -6802East Asian ideograph -67E4East Asian ideograph -67D9East Asian ideograph -67DBEast Asian ideograph -67B5East Asian ideograph -67DFEast Asian ideograph -67F7East Asian ideograph -67B3East Asian ideograph -6806East Asian ideograph -67AEEast Asian ideograph -67F6East Asian ideograph -67EEEast Asian ideograph -6AAFEast Asian ideograph -67B2East Asian ideograph -67B9East Asian ideograph -67C2East Asian ideograph -67E3East Asian ideograph -67CAEast Asian ideograph -67CEEast Asian ideograph -67E2East Asian ideograph -67F2East Asian ideograph -67C3East Asian ideograph -67DDEast Asian ideograph -67E7East Asian ideograph -6849East Asian ideograph -683EEast Asian ideograph -6814East Asian ideograph -684BEast Asian ideograph -681EEast Asian ideograph -6833East Asian ideograph -6831East Asian ideograph -6832East Asian ideograph -6835East Asian ideograph -683BEast Asian ideograph -684EEast Asian ideograph -682BEast Asian ideograph -682DEast Asian ideograph -684DEast Asian ideograph -6844East Asian ideograph -685DEast Asian ideograph -685EEast Asian ideograph -6834East Asian ideograph -6812East Asian ideograph -685AEast Asian ideograph -686BEast Asian ideograph -686CEast Asian ideograph -6879East Asian ideograph -68B2East Asian ideograph -689BEast Asian ideograph -687EEast Asian ideograph -68B6East Asian ideograph -6882East Asian ideograph -6890East Asian ideograph -6872East Asian ideograph -689CEast Asian ideograph -686DEast Asian ideograph -68A9East Asian ideograph -6898East Asian ideograph -688BEast Asian ideograph -68A0East Asian ideograph -686FEast Asian ideograph -68A3East Asian ideograph -6874East Asian ideograph -6875East Asian ideograph -6877East Asian ideograph -688FEast Asian ideograph -687BEast Asian ideograph -688EEast Asian ideograph -68B4East Asian ideograph -692CEast Asian ideograph -6917East Asian ideograph -690CEast Asian ideograph -690BEast Asian ideograph -68D3East Asian ideograph -6904East Asian ideograph -690AEast Asian ideograph -6909East Asian ideograph -6929East Asian ideograph -68ECEast Asian ideograph -692AEast Asian ideograph -68EAEast Asian ideograph -681FEast Asian ideograph -7439East Asian ideograph -6910East Asian ideograph -68D6East Asian ideograph -68EBEast Asian ideograph -68F1East Asian ideograph -68FDEast Asian ideograph -68FCEast Asian ideograph -68F3East Asian ideograph -6913East Asian ideograph -6907East Asian ideograph -691AEast Asian ideograph -6919East Asian ideograph -68DEEast Asian ideograph -691BEast Asian ideograph -68FBEast Asian ideograph -68E1East Asian ideograph -68D1East Asian ideograph -68D0East Asian ideograph -6908East Asian ideograph -68E8East Asian ideograph -68F0East Asian ideograph -68C3East Asian ideograph -6911East Asian ideograph -68D4East Asian ideograph -68EFEast Asian ideograph -68C6East Asian ideograph -68C7East Asian ideograph -6974East Asian ideograph -6938East Asian ideograph -6962East Asian ideograph -6958East Asian ideograph -6957East Asian ideograph -693FEast Asian ideograph -6971East Asian ideograph -6945East Asian ideograph -695DEast Asian ideograph -6932East Asian ideograph -696EEast Asian ideograph -6963East Asian ideograph -6948East Asian ideograph -6939East Asian ideograph -696AEast Asian ideograph -6937East Asian ideograph -696CEast Asian ideograph -694EEast Asian ideograph -6980East Asian ideograph -6933East Asian ideograph -6952East Asian ideograph -695BEast Asian ideograph -6985East Asian ideograph -693DEast Asian ideograph -6978East Asian ideograph -697BEast Asian ideograph -6934East Asian ideograph -6969East Asian ideograph -6944East Asian ideograph -696FEast Asian ideograph -698AEast Asian ideograph -69A0East Asian ideograph -69B1East Asian ideograph -69CEEast Asian ideograph -69CAEast Asian ideograph -698DEast Asian ideograph -6991East Asian ideograph -69AAEast Asian ideograph -69BCEast Asian ideograph -69A7East Asian ideograph -699EEast Asian ideograph -69D9East Asian ideograph -698EEast Asian ideograph -69D6East Asian ideograph -69A5East Asian ideograph -69BEEast Asian ideograph -69D1East Asian ideograph -69F6East Asian ideograph -69D5East Asian ideograph -69BFEast Asian ideograph -69A3East Asian ideograph -69A4East Asian ideograph -69D4East Asian ideograph -69C3East Asian ideograph -6A12East Asian ideograph -6A11East Asian ideograph -6A00East Asian ideograph -69E6East Asian ideograph -6A0BEast Asian ideograph -69E5East Asian ideograph -69E9East Asian ideograph -69FCEast Asian ideograph -6A17East Asian ideograph -69E7East Asian ideograph -69EBEast Asian ideograph -69F1East Asian ideograph -6A2BEast Asian ideograph -69FFEast Asian ideograph -6A20East Asian ideograph -69EDEast Asian ideograph -6A1BEast Asian ideograph -6A2DEast Asian ideograph -6A18East Asian ideograph -6A1DEast Asian ideograph -6A0CEast Asian ideograph -6A0FEast Asian ideograph -69EEEast Asian ideograph -69F0East Asian ideograph -69F2East Asian ideograph -6A14East Asian ideograph -6A63East Asian ideograph -6A67East Asian ideograph -6A43East Asian ideograph -6A33East Asian ideograph -6A32East Asian ideograph -6A5AEast Asian ideograph -6A28East Asian ideograph -6A48East Asian ideograph -6A50East Asian ideograph -6A52East Asian ideograph -6A72East Asian ideograph -6A3EEast Asian ideograph -6A77East Asian ideograph -6A5BEast Asian ideograph -6A5EEast Asian ideograph -6A5CEast Asian ideograph -6A51East Asian ideograph -6A56East Asian ideograph -6A36East Asian ideograph -6A7AEast Asian ideograph -6A3FEast Asian ideograph -69F9East Asian ideograph -6A64East Asian ideograph -6A8DEast Asian ideograph -6AA8East Asian ideograph -6AA5East Asian ideograph -6A96East Asian ideograph -6A7DEast Asian ideograph -6A7FEast Asian ideograph -6A89East Asian ideograph -6A91East Asian ideograph -6A9FEast Asian ideograph -6A92East Asian ideograph -6AA3East Asian ideograph -6A99East Asian ideograph -6A9DEast Asian ideograph -6A7EEast Asian ideograph -6A9BEast Asian ideograph -6AA0East Asian ideograph -6A90East Asian ideograph -6A9EEast Asian ideograph -6A87East Asian ideograph -6A8EEast Asian ideograph -6AABEast Asian ideograph -6AC8East Asian ideograph -6AAEEast Asian ideograph -6ABFEast Asian ideograph -6ACAEast Asian ideograph -6AB4East Asian ideograph -6AE6East Asian ideograph -6AEDEast Asian ideograph -6ACCEast Asian ideograph -6AD1East Asian ideograph -6ADFEast Asian ideograph -6ACDEast Asian ideograph -6ADEEast Asian ideograph -6AECEast Asian ideograph -6AF3East Asian ideograph -6AE7East Asian ideograph -6AEBEast Asian ideograph -6AEAEast Asian ideograph -6AF1East Asian ideograph -6AE8East Asian ideograph -6AF5East Asian ideograph -6AFDEast Asian ideograph -6AFAEast Asian ideograph -6B01East Asian ideograph -6B03East Asian ideograph -6AF8East Asian ideograph -6B0DEast Asian ideograph -6B09East Asian ideograph -6B0EEast Asian ideograph -6B11East Asian ideograph -6B19East Asian ideograph -6B17East Asian ideograph -6B1EEast Asian ideograph -6B2CEast Asian ideograph -6B35East Asian ideograph -6B37East Asian ideograph -6B3BEast Asian ideograph -6B39East Asian ideograph -6B3FEast Asian ideograph -6B46East Asian ideograph -6B41East Asian ideograph -6B40East Asian ideograph -6B42East Asian ideograph -6B43East Asian ideograph -6B48East Asian ideograph -6B4AEast Asian ideograph -E9646B4EVariant of 4C4446 which maps to 6B4E -6B57East Asian ideograph -6B54East Asian ideograph -6B55East Asian ideograph -6B5CEast Asian ideograph -6B5EEast Asian ideograph -6B60East Asian ideograph -6B6BEast Asian ideograph -6B6CEast Asian ideograph -6B6EEast Asian ideograph -6B71East Asian ideograph -6B7EEast Asian ideograph -6B82East Asian ideograph -6B84East Asian ideograph -6B8DEast Asian ideograph -6B95East Asian ideograph -6B99East Asian ideograph -6B9BEast Asian ideograph -6BA3East Asian ideograph -6BA2East Asian ideograph -6BAAEast Asian ideograph -6BABEast Asian ideograph -6BADEast Asian ideograph -6BB0East Asian ideograph -6BB3East Asian ideograph -6BBDEast Asian ideograph -6996East Asian ideograph -6BC8East Asian ideograph -6BD6East Asian ideograph -6BDAEast Asian ideograph -6BDCEast Asian ideograph -6BDDEast Asian ideograph -6BDFEast Asian ideograph -6BE7East Asian ideograph -6BEAEast Asian ideograph -6BE8East Asian ideograph -6BF6East Asian ideograph -6BF3East Asian ideograph -6BF8East Asian ideograph -6BFAEast Asian ideograph -6BF9East Asian ideograph -6BFFEast Asian ideograph -6C06East Asian ideograph -6C04East Asian ideograph -6C05East Asian ideograph -6C08East Asian ideograph -6C0CEast Asian ideograph -6C0DEast Asian ideograph -6C15East Asian ideograph -6C18East Asian ideograph -6C19East Asian ideograph -6C1AEast Asian ideograph -6C1DEast Asian ideograph -6C20East Asian ideograph -6C21East Asian ideograph -6C2AEast Asian ideograph -6C2DEast Asian ideograph -6C30East Asian ideograph -6C2CEast Asian ideograph -E9EBEast Asian ideograph not in Unicode -6C3BEast Asian ideograph -6C3FEast Asian ideograph -6C46East Asian ideograph -6C52East Asian ideograph -6C62East Asian ideograph -6C4AEast Asian ideograph -6C5CEast Asian ideograph -6C5BEast Asian ideograph -6C4DEast Asian ideograph -6C4BEast Asian ideograph -6C54East Asian ideograph -6C63East Asian ideograph -6C78East Asian ideograph -6C74East Asian ideograph -6C86East Asian ideograph -6C76East Asian ideograph -6C6CEast Asian ideograph -6C67East Asian ideograph -6C84East Asian ideograph -6C94East Asian ideograph -6C8FEast Asian ideograph -6C65East Asian ideograph -6C6FEast Asian ideograph -6C9DEast Asian ideograph -6C69East Asian ideograph -6C9AEast Asian ideograph -6C6DEast Asian ideograph -6C93East Asian ideograph -6C87East Asian ideograph -6C6EEast Asian ideograph -6C95East Asian ideograph -6C82East Asian ideograph -6CA0East Asian ideograph -6CEBEast Asian ideograph -6CEEEast Asian ideograph -6CC0East Asian ideograph -6CEFEast Asian ideograph -6CACEast Asian ideograph -E9656CADVariant of 4C476E which maps to 6CAD -6CAFEast Asian ideograph -6CF5East Asian ideograph -6CBAEast Asian ideograph -7553East Asian ideograph -6CC2East Asian ideograph -6CD8East Asian ideograph -6CC6East Asian ideograph -6CCEEast Asian ideograph -6CE9East Asian ideograph -6CF2East Asian ideograph -6CE0East Asian ideograph -6CD1East Asian ideograph -6CD2East Asian ideograph -6CB4East Asian ideograph -6D1DEast Asian ideograph -6D28East Asian ideograph -6D39East Asian ideograph -6D26East Asian ideograph -6D27East Asian ideograph -6D0FEast Asian ideograph -6D0AEast Asian ideograph -6D3FEast Asian ideograph -6D07East Asian ideograph -6D04East Asian ideograph -6CDAEast Asian ideograph -6D2EEast Asian ideograph -6D35East Asian ideograph -6D3AEast Asian ideograph -6D19East Asian ideograph -6D0EEast Asian ideograph -6D2BEast Asian ideograph -6D11East Asian ideograph -6D00East Asian ideograph -6D24East Asian ideograph -6D33East Asian ideograph -6D63East Asian ideograph -6DA5East Asian ideograph -6D92East Asian ideograph -6D6DEast Asian ideograph -6D6FEast Asian ideograph -6D61East Asian ideograph -6D91East Asian ideograph -6D81East Asian ideograph -6D8AEast Asian ideograph -E9666D34Variant of 34492F which maps to 6D34 -6D79East Asian ideograph -6DEFEast Asian ideograph -6D7FEast Asian ideograph -6D85East Asian ideograph -6D65East Asian ideograph -6D5EEast Asian ideograph -6D67East Asian ideograph -6D94East Asian ideograph -6D60East Asian ideograph -6D98East Asian ideograph -6D7CEast Asian ideograph -6D70East Asian ideograph -6D96East Asian ideograph -6DABEast Asian ideograph -6DB4East Asian ideograph -6DAAEast Asian ideograph -6DECEast Asian ideograph -6DACEast Asian ideograph -6DB7East Asian ideograph -6DE2East Asian ideograph -6DD5East Asian ideograph -6DE9East Asian ideograph -6DF6East Asian ideograph -6E0FEast Asian ideograph -6DBFEast Asian ideograph -6DDFEast Asian ideograph -6DD3East Asian ideograph -6DFCEast Asian ideograph -6DDDEast Asian ideograph -6DDCEast Asian ideograph -6DDBEast Asian ideograph -6DA4East Asian ideograph -6E12East Asian ideograph -6DF0East Asian ideograph -6DE6East Asian ideograph -6E1FEast Asian ideograph -6E27East Asian ideograph -6E49East Asian ideograph -6E3CEast Asian ideograph -6E8AEast Asian ideograph -6E4BEast Asian ideograph -6E62East Asian ideograph -6E51East Asian ideograph -6E44East Asian ideograph -6E63East Asian ideograph -6E73East Asian ideograph -6E4FEast Asian ideograph -6E4EEast Asian ideograph -6E28East Asian ideograph -6E5CEast Asian ideograph -6E31East Asian ideograph -6E5EEast Asian ideograph -6E84East Asian ideograph -6E2EEast Asian ideograph -6E36East Asian ideograph -6E5DEast Asian ideograph -6E72East Asian ideograph -6E30East Asian ideograph -6E53East Asian ideograph -6E39East Asian ideograph -6E71East Asian ideograph -6E69East Asian ideograph -6E6BEast Asian ideograph -6E8BEast Asian ideograph -6E76East Asian ideograph -6E2AEast Asian ideograph -6E4CEast Asian ideograph -6E22East Asian ideograph -6ECEEast Asian ideograph -6E9BEast Asian ideograph -6E9FEast Asian ideograph -6EC8East Asian ideograph -6ED8East Asian ideograph -6E8FEast Asian ideograph -6E93East Asian ideograph -6EA0East Asian ideograph -6EB1East Asian ideograph -6EA8East Asian ideograph -6E92East Asian ideograph -6EA7East Asian ideograph -6E8EEast Asian ideograph -6ED9East Asian ideograph -6EBDEast Asian ideograph -6EC1East Asian ideograph -6EBBEast Asian ideograph -6EC9East Asian ideograph -6EB3East Asian ideograph -6EB7East Asian ideograph -6EA4East Asian ideograph -6ECFEast Asian ideograph -6ECAEast Asian ideograph -6ED5East Asian ideograph -6EC3East Asian ideograph -6EB4East Asian ideograph -6EB2East Asian ideograph -6EB5East Asian ideograph -6EF8East Asian ideograph -6F37East Asian ideograph -6EFDEast Asian ideograph -6F09East Asian ideograph -6F3BEast Asian ideograph -6F63East Asian ideograph -6F12East Asian ideograph -6F26East Asian ideograph -6F1AEast Asian ideograph -6EF6East Asian ideograph -6F19East Asian ideograph -6F00East Asian ideograph -6F24East Asian ideograph -6F18East Asian ideograph -6F1FEast Asian ideograph -6F0AEast Asian ideograph -6F36East Asian ideograph -6EF9East Asian ideograph -6EEEEast Asian ideograph -6F41East Asian ideograph -6F95East Asian ideograph -6F2DEast Asian ideograph -6F34East Asian ideograph -6F49East Asian ideograph -6F30East Asian ideograph -6EFAEast Asian ideograph -6EEBEast Asian ideograph -6F08East Asian ideograph -6F0EEast Asian ideograph -6F35East Asian ideograph -6F7EEast Asian ideograph -6F9DEast Asian ideograph -6F87East Asian ideograph -6F6FEast Asian ideograph -6F5AEast Asian ideograph -6F60East Asian ideograph -6F90East Asian ideograph -6F8DEast Asian ideograph -6F92East Asian ideograph -6F89East Asian ideograph -6F8CEast Asian ideograph -E9676F62Variant of 4C4D3D which maps to 6F62 -6F0BEast Asian ideograph -6F6CEast Asian ideograph -6F8BEast Asian ideograph -6E88East Asian ideograph -6F55East Asian ideograph -6F72East Asian ideograph -6F57East Asian ideograph -6F5FEast Asian ideograph -6F5DEast Asian ideograph -6FB6East Asian ideograph -6F9FEast Asian ideograph -6FA6East Asian ideograph -6FC6East Asian ideograph -6FBCEast Asian ideograph -6FAAEast Asian ideograph -6FBFEast Asian ideograph -6FC7East Asian ideograph -6FC9East Asian ideograph -6F5EEast Asian ideograph -6FC8East Asian ideograph -6FA0East Asian ideograph -6FCAEast Asian ideograph -6FB4East Asian ideograph -6FAFEast Asian ideograph -6FA8East Asian ideograph -6FA5East Asian ideograph -6FB0East Asian ideograph -6FAEEast Asian ideograph -6FD9East Asian ideograph -6FDAEast Asian ideograph -6FD4East Asian ideograph -6FE9East Asian ideograph -6FF8East Asian ideograph -6FDEEast Asian ideograph -6FEEEast Asian ideograph -6FF0East Asian ideograph -7005East Asian ideograph -700CEast Asian ideograph -700DEast Asian ideograph -7026East Asian ideograph -7020East Asian ideograph -7027East Asian ideograph -E968701EVariant of 4C4F2B which maps to 701E -702EEast Asian ideograph -702DEast Asian ideograph -7021East Asian ideograph -7018East Asian ideograph -7023East Asian ideograph -703CEast Asian ideograph -7035East Asian ideograph -7034East Asian ideograph -7039East Asian ideograph -703AEast Asian ideograph -7043East Asian ideograph -7044East Asian ideograph -7047East Asian ideograph -7049East Asian ideograph -7055East Asian ideograph -7052East Asian ideograph -705CEast Asian ideograph -7059East Asian ideograph -705EEast Asian ideograph -7061East Asian ideograph -705DEast Asian ideograph -9E02East Asian ideograph -7066East Asian ideograph -7065East Asian ideograph -7068East Asian ideograph -7054East Asian ideograph -7074East Asian ideograph -707AEast Asian ideograph -7093East Asian ideograph -7086East Asian ideograph -E9ECEast Asian ideograph not in Unicode -7084East Asian ideograph -7081East Asian ideograph -7088East Asian ideograph -7098East Asian ideograph -708CEast Asian ideograph -70B7East Asian ideograph -70A1East Asian ideograph -70A3East Asian ideograph -7551East Asian ideograph -70A7East Asian ideograph -79CCEast Asian ideograph -70B5East Asian ideograph -70BFEast Asian ideograph -70A9East Asian ideograph -70EAEast Asian ideograph -70E5East Asian ideograph -70DCEast Asian ideograph -70D3East Asian ideograph -70DDEast Asian ideograph -70E1East Asian ideograph -70E3East Asian ideograph -70E0East Asian ideograph -70D4East Asian ideograph -70D1East Asian ideograph -70CBEast Asian ideograph -70D0East Asian ideograph -70C7East Asian ideograph -70DAEast Asian ideograph -70C6East Asian ideograph -70FAEast Asian ideograph -70F7East Asian ideograph -7104East Asian ideograph -70F3East Asian ideograph -7110East Asian ideograph -7103East Asian ideograph -70F4East Asian ideograph -7111East Asian ideograph -7112East Asian ideograph -710CEast Asian ideograph -70F6East Asian ideograph -7113East Asian ideograph -70EFEast Asian ideograph -7100East Asian ideograph -711EEast Asian ideograph -7134East Asian ideograph -7120East Asian ideograph -713FEast Asian ideograph -7131East Asian ideograph -712DEast Asian ideograph -7139East Asian ideograph -7135East Asian ideograph -713BEast Asian ideograph -711CEast Asian ideograph -713DEast Asian ideograph -712FEast Asian ideograph -7129East Asian ideograph -712EEast Asian ideograph -7177East Asian ideograph -7146East Asian ideograph -7152East Asian ideograph -714FEast Asian ideograph -715DEast Asian ideograph -7141East Asian ideograph -7160East Asian ideograph -7175East Asian ideograph -7173East Asian ideograph -7143East Asian ideograph -715AEast Asian ideograph -7176East Asian ideograph -714BEast Asian ideograph -7147East Asian ideograph -7168East Asian ideograph -7171East Asian ideograph -715FEast Asian ideograph -7150East Asian ideograph -7153East Asian ideograph -7144East Asian ideograph -7172East Asian ideograph -7178East Asian ideograph -7187East Asian ideograph -717BEast Asian ideograph -7192East Asian ideograph -7180East Asian ideograph -7189East Asian ideograph -7185East Asian ideograph -7196East Asian ideograph -717CEast Asian ideograph -7198East Asian ideograph -7197East Asian ideograph -71B5East Asian ideograph -71A9East Asian ideograph -71A5East Asian ideograph -719EEast Asian ideograph -71B2East Asian ideograph -719BEast Asian ideograph -71AFEast Asian ideograph -71A4East Asian ideograph -71A0East Asian ideograph -719AEast Asian ideograph -71B3East Asian ideograph -71B4East Asian ideograph -71D1East Asian ideograph -71C7East Asian ideograph -71B7East Asian ideograph -71CAEast Asian ideograph -71CFEast Asian ideograph -71D6East Asian ideograph -71BAEast Asian ideograph -71C2East Asian ideograph -71C5East Asian ideograph -71BFEast Asian ideograph -71B8East Asian ideograph -71DDEast Asian ideograph -71C0East Asian ideograph -71C1East Asian ideograph -71D4East Asian ideograph -71CBEast Asian ideograph -71DEEast Asian ideograph -71EBEast Asian ideograph -71E8East Asian ideograph -71F5East Asian ideograph -71F3East Asian ideograph -71E1East Asian ideograph -71E0East Asian ideograph -720CEast Asian ideograph -71FCEast Asian ideograph -71F9East Asian ideograph -720EEast Asian ideograph -5911East Asian ideograph -720AEast Asian ideograph -7217East Asian ideograph -7207East Asian ideograph -7215East Asian ideograph -7213East Asian ideograph -7218East Asian ideograph -720BEast Asian ideograph -721AEast Asian ideograph -721FEast Asian ideograph -721DEast Asian ideograph -7225East Asian ideograph -7226East Asian ideograph -723FEast Asian ideograph -7241East Asian ideograph -7242East Asian ideograph -7250East Asian ideograph -724FEast Asian ideograph -7253East Asian ideograph -7255East Asian ideograph -725AEast Asian ideograph -7263East Asian ideograph -7273East Asian ideograph -726EEast Asian ideograph -7276East Asian ideograph -7277East Asian ideograph -727EEast Asian ideograph -727CEast Asian ideograph -727FEast Asian ideograph -7289East Asian ideograph -728BEast Asian ideograph -728DEast Asian ideograph -728FEast Asian ideograph -72A8East Asian ideograph -72ABEast Asian ideograph -72B0East Asian ideograph -72B4East Asian ideograph -72C6East Asian ideograph -72B5East Asian ideograph -72BCEast Asian ideograph -72C3East Asian ideograph -72C1East Asian ideograph -72D6East Asian ideograph -72D2East Asian ideograph -72C9East Asian ideograph -72CCEast Asian ideograph -72DBEast Asian ideograph -72CDEast Asian ideograph -72E8East Asian ideograph -72EBEast Asian ideograph -72E5East Asian ideograph -72FAEast Asian ideograph -72F4East Asian ideograph -72FEEast Asian ideograph -7302East Asian ideograph -72FBEast Asian ideograph -7301East Asian ideograph -72F3East Asian ideograph -731DEast Asian ideograph -730BEast Asian ideograph -7317East Asian ideograph -7307East Asian ideograph -7318East Asian ideograph -731EEast Asian ideograph -7331East Asian ideograph -7338East Asian ideograph -7322East Asian ideograph -7332East Asian ideograph -732CEast Asian ideograph -7327East Asian ideograph -732BEast Asian ideograph -732FEast Asian ideograph -7328East Asian ideograph -7347East Asian ideograph -7348East Asian ideograph -7349East Asian ideograph -733BEast Asian ideograph -733AEast Asian ideograph -7340East Asian ideograph -734DEast Asian ideograph -7352East Asian ideograph -735EEast Asian ideograph -735DEast Asian ideograph -7360East Asian ideograph -7358East Asian ideograph -7362East Asian ideograph -734BEast Asian ideograph -7367East Asian ideograph -736CEast Asian ideograph -736BEast Asian ideograph -736FEast Asian ideograph -737CEast Asian ideograph -737EEast Asian ideograph -7381East Asian ideograph -7388East Asian ideograph -738EEast Asian ideograph -7395East Asian ideograph -7392East Asian ideograph -7397East Asian ideograph -7393East Asian ideograph -7394East Asian ideograph -739EEast Asian ideograph -73A6East Asian ideograph -73A5East Asian ideograph -73A2East Asian ideograph -73A0East Asian ideograph -73B6East Asian ideograph -73CFEast Asian ideograph -73C2East Asian ideograph -73D0East Asian ideograph -73BFEast Asian ideograph -73C8East Asian ideograph -73CCEast Asian ideograph -73D3East Asian ideograph -73EAEast Asian ideograph -73E5East Asian ideograph -73D9East Asian ideograph -73EFEast Asian ideograph -73D4East Asian ideograph -73DBEast Asian ideograph -73D6East Asian ideograph -73BCEast Asian ideograph -73E7East Asian ideograph -73E3East Asian ideograph -73DEEast Asian ideograph -73E6East Asian ideograph -73E9East Asian ideograph -73F6East Asian ideograph -73FAEast Asian ideograph -73F8East Asian ideograph -73F5East Asian ideograph -73FDEast Asian ideograph -7407East Asian ideograph -7412East Asian ideograph -743CEast Asian ideograph -742EEast Asian ideograph -742FEast Asian ideograph -7414East Asian ideograph -742CEast Asian ideograph -7430East Asian ideograph -742BEast Asian ideograph -73F7East Asian ideograph -741AEast Asian ideograph -7416East Asian ideograph -7426East Asian ideograph -7428East Asian ideograph -7429East Asian ideograph -7420East Asian ideograph -741BEast Asian ideograph -7424East Asian ideograph -7432East Asian ideograph -742DEast Asian ideograph -7415East Asian ideograph -743BEast Asian ideograph -7444East Asian ideograph -7447East Asian ideograph -7458East Asian ideograph -7442East Asian ideograph -744BEast Asian ideograph -744AEast Asian ideograph -7452East Asian ideograph -7457East Asian ideograph -7451East Asian ideograph -745DEast Asian ideograph -7454East Asian ideograph -7440East Asian ideograph -746DEast Asian ideograph -7462East Asian ideograph -7473East Asian ideograph -7474East Asian ideograph -746EEast Asian ideograph -7471East Asian ideograph -7468East Asian ideograph -7460East Asian ideograph -7472East Asian ideograph -7484East Asian ideograph -7487East Asian ideograph -7488East Asian ideograph -7489East Asian ideograph -747CEast Asian ideograph -7482East Asian ideograph -747EEast Asian ideograph -748AEast Asian ideograph -7486East Asian ideograph -747AEast Asian ideograph -7480East Asian ideograph -7481East Asian ideograph -747DEast Asian ideograph -7485East Asian ideograph -7497East Asian ideograph -7498East Asian ideograph -749AEast Asian ideograph -74A4East Asian ideograph -749FEast Asian ideograph -749DEast Asian ideograph -748DEast Asian ideograph -749EEast Asian ideograph -74A0East Asian ideograph -74A1East Asian ideograph -74B2East Asian ideograph -74B1East Asian ideograph -74B4East Asian ideograph -74ABEast Asian ideograph -74AAEast Asian ideograph -7490East Asian ideograph -74A5East Asian ideograph -74A8East Asian ideograph -74B8East Asian ideograph -74C0East Asian ideograph -74BFEast Asian ideograph -74B5East Asian ideograph -74BAEast Asian ideograph -74C8East Asian ideograph -74C5East Asian ideograph -74CCEast Asian ideograph -74D6East Asian ideograph -74D4East Asian ideograph -74D8East Asian ideograph -74DAEast Asian ideograph -74DBEast Asian ideograph -74DEEast Asian ideograph -74E4East Asian ideograph -74E7East Asian ideograph -74E9East Asian ideograph -74F1East Asian ideograph -74F0East Asian ideograph -74EEEast Asian ideograph -74F4East Asian ideograph -74F8East Asian ideograph -74FBEast Asian ideograph -74FFEast Asian ideograph -7505East Asian ideograph -7503East Asian ideograph -7507East Asian ideograph -750EEast Asian ideograph -750DEast Asian ideograph -7511East Asian ideograph -750FEast Asian ideograph -7512East Asian ideograph -7513East Asian ideograph -7517East Asian ideograph -7521East Asian ideograph -7524East Asian ideograph -752FEast Asian ideograph -753AEast Asian ideograph -753FEast Asian ideograph -7540East Asian ideograph -753EEast Asian ideograph -754AEast Asian ideograph -754EEast Asian ideograph -7547East Asian ideograph -754BEast Asian ideograph -7548East Asian ideograph -755FEast Asian ideograph -755BEast Asian ideograph -7564East Asian ideograph -7563East Asian ideograph -756FEast Asian ideograph -756CEast Asian ideograph -7579East Asian ideograph -757AEast Asian ideograph -7577East Asian ideograph -7571East Asian ideograph -757DEast Asian ideograph -757FEast Asian ideograph -7583East Asian ideograph -7590East Asian ideograph -7592East Asian ideograph -7594East Asian ideograph -7595East Asian ideograph -7598East Asian ideograph -75A2East Asian ideograph -75A3East Asian ideograph -75BAEast Asian ideograph -75B0East Asian ideograph -75C3East Asian ideograph -75BFEast Asian ideograph -75B4East Asian ideograph -75C2East Asian ideograph -75C1East Asian ideograph -75B1East Asian ideograph -75C4East Asian ideograph -75CDEast Asian ideograph -75CFEast Asian ideograph -75CCEast Asian ideograph -75D0East Asian ideograph -75E7East Asian ideograph -75E1East Asian ideograph -75E6East Asian ideograph -75E4East Asian ideograph -75E0East Asian ideograph -75D7East Asian ideograph -7602East Asian ideograph -7603East Asian ideograph -75F9East Asian ideograph -75FCEast Asian ideograph -7616East Asian ideograph -7608East Asian ideograph -7615East Asian ideograph -760CEast Asian ideograph -760FEast Asian ideograph -7610East Asian ideograph -760AEast Asian ideograph -7625East Asian ideograph -761AEast Asian ideograph -761BEast Asian ideograph -7619East Asian ideograph -761EEast Asian ideograph -761DEast Asian ideograph -7622East Asian ideograph -762FEast Asian ideograph -762DEast Asian ideograph -7633East Asian ideograph -763BEast Asian ideograph -7630East Asian ideograph -763CEast Asian ideograph -7635East Asian ideograph -7648East Asian ideograph -764EEast Asian ideograph -7647East Asian ideograph -7643East Asian ideograph -764DEast Asian ideograph -7649East Asian ideograph -7654East Asian ideograph -765CEast Asian ideograph -7657East Asian ideograph -7664East Asian ideograph -7659East Asian ideograph -765FEast Asian ideograph -7667East Asian ideograph -766AEast Asian ideograph -766DEast Asian ideograph -766FEast Asian ideograph -7670East Asian ideograph -7676East Asian ideograph -7677East Asian ideograph -7680East Asian ideograph -768BEast Asian ideograph -7695East Asian ideograph -656BEast Asian ideograph -7699East Asian ideograph -769CEast Asian ideograph -769DEast Asian ideograph -76A4East Asian ideograph -76A5East Asian ideograph -76A6East Asian ideograph -76AAEast Asian ideograph -76ADEast Asian ideograph -76B8East Asian ideograph -76BDEast Asian ideograph -76CBEast Asian ideograph -76CCEast Asian ideograph -76E6East Asian ideograph -76E9East Asian ideograph -76ECEast Asian ideograph -76EDEast Asian ideograph -76F1East Asian ideograph -7704East Asian ideograph -7708East Asian ideograph -7707East Asian ideograph -76F7East Asian ideograph -770AEast Asian ideograph -76FBEast Asian ideograph -772BEast Asian ideograph -770EEast Asian ideograph -771BEast Asian ideograph -7724East Asian ideograph -7722East Asian ideograph -771AEast Asian ideograph -7721East Asian ideograph -7740East Asian ideograph -7739East Asian ideograph -772FEast Asian ideograph -7731East Asian ideograph -7725East Asian ideograph -7735East Asian ideograph -7734East Asian ideograph -7747East Asian ideograph -7745East Asian ideograph -774DEast Asian ideograph -774AEast Asian ideograph -7743East Asian ideograph -774EEast Asian ideograph -775FEast Asian ideograph -7760East Asian ideograph -7752East Asian ideograph -7758East Asian ideograph -7756East Asian ideograph -775AEast Asian ideograph -7762East Asian ideograph -7780East Asian ideograph -776FEast Asian ideograph -777EEast Asian ideograph -7785East Asian ideograph -777AEast Asian ideograph -E969778BVariant of 4C6266 which maps to 778B -778DEast Asian ideograph -7798East Asian ideograph -7796East Asian ideograph -77A2East Asian ideograph -7799East Asian ideograph -77B5East Asian ideograph -77B7East Asian ideograph -77B6East Asian ideograph -77BEEast Asian ideograph -77B9East Asian ideograph -77BCEast Asian ideograph -77CDEast Asian ideograph -77D1East Asian ideograph -77DEEast Asian ideograph -77DFEast Asian ideograph -77E7East Asian ideograph -77E6East Asian ideograph -77ECEast Asian ideograph -77F0East Asian ideograph -77F1East Asian ideograph -77F4East Asian ideograph -77FCEast Asian ideograph -77F8East Asian ideograph -77FBEast Asian ideograph -7809East Asian ideograph -7806East Asian ideograph -7819East Asian ideograph -7811East Asian ideograph -7812East Asian ideograph -781BEast Asian ideograph -782CEast Asian ideograph -7823East Asian ideograph -782BEast Asian ideograph -7829East Asian ideograph -7822East Asian ideograph -7835East Asian ideograph -7833East Asian ideograph -782EEast Asian ideograph -7820East Asian ideograph -783DEast Asian ideograph -781FEast Asian ideograph -7831East Asian ideograph -784DEast Asian ideograph -7848East Asian ideograph -7853East Asian ideograph -7854East Asian ideograph -7845East Asian ideograph -7852East Asian ideograph -7850East Asian ideograph -7858East Asian ideograph -7826East Asian ideograph -7847East Asian ideograph -784CEast Asian ideograph -7868East Asian ideograph -786DEast Asian ideograph -7864East Asian ideograph -785CEast Asian ideograph -7876East Asian ideograph -786AEast Asian ideograph -7886East Asian ideograph -789AEast Asian ideograph -787FEast Asian ideograph -7887East Asian ideograph -7894East Asian ideograph -788FEast Asian ideograph -7899East Asian ideograph -7893East Asian ideograph -7892East Asian ideograph -7896East Asian ideograph -78B2East Asian ideograph -78A1East Asian ideograph -78B6East Asian ideograph -78B7East Asian ideograph -78A4East Asian ideograph -78B4East Asian ideograph -78ADEast Asian ideograph -78A3East Asian ideograph -789EEast Asian ideograph -78A8East Asian ideograph -78ABEast Asian ideograph -78BBEast Asian ideograph -78CCEast Asian ideograph -78C9East Asian ideograph -78D1East Asian ideograph -78D8East Asian ideograph -78C8East Asian ideograph -78D4East Asian ideograph -78DFEast Asian ideograph -78E7East Asian ideograph -78DBEast Asian ideograph -78E1East Asian ideograph -78E0East Asian ideograph -78EEEast Asian ideograph -78E3East Asian ideograph -78F2East Asian ideograph -7905East Asian ideograph -78F9East Asian ideograph -78FDEast Asian ideograph -78FEEast Asian ideograph -78FBEast Asian ideograph -7904East Asian ideograph -7912East Asian ideograph -790CEast Asian ideograph -7913East Asian ideograph -7911East Asian ideograph -791EEast Asian ideograph -7922East Asian ideograph -7924East Asian ideograph -7927East Asian ideograph -7929East Asian ideograph -7931East Asian ideograph -7934East Asian ideograph -7936East Asian ideograph -793DEast Asian ideograph -7942East Asian ideograph -793FEast Asian ideograph -794AEast Asian ideograph -794DEast Asian ideograph -7946East Asian ideograph -7958East Asian ideograph -795BEast Asian ideograph -795CEast Asian ideograph -794FEast Asian ideograph -7953East Asian ideograph -E9D07953Unrelated variant of EACC 22667C which maps to 7953 -7951East Asian ideograph -7954East Asian ideograph -7967East Asian ideograph -796BEast Asian ideograph -7972East Asian ideograph -797CEast Asian ideograph -7998East Asian ideograph -798AEast Asian ideograph -7999East Asian ideograph -7995East Asian ideograph -798BEast Asian ideograph -7996East Asian ideograph -7994East Asian ideograph -7993East Asian ideograph -799AEast Asian ideograph -79A1East Asian ideograph -799BEast Asian ideograph -79A3East Asian ideograph -799DEast Asian ideograph -79A9East Asian ideograph -79ABEast Asian ideograph -79A8East Asian ideograph -79B0East Asian ideograph -79B3East Asian ideograph -79B4East Asian ideograph -79B8East Asian ideograph -79BAEast Asian ideograph -79BCEast Asian ideograph -79C6East Asian ideograph -79C8East Asian ideograph -79D4East Asian ideograph -79D5East Asian ideograph -79D6East Asian ideograph -79ECEast Asian ideograph -E96A79EBVariant of 4C683E which maps to 79EB -79E1East Asian ideograph -79DDEast Asian ideograph -79EDEast Asian ideograph -79F8East Asian ideograph -7A02East Asian ideograph -7A0AEast Asian ideograph -7A09East Asian ideograph -7A03East Asian ideograph -7A0CEast Asian ideograph -7A11East Asian ideograph -7A18East Asian ideograph -E96B7A19Variant of 2E686F which maps to 7A19 -7A1EEast Asian ideograph -7A17East Asian ideograph -7A2DEast Asian ideograph -7A2CEast Asian ideograph -7A48East Asian ideograph -7A4BEast Asian ideograph -7A47East Asian ideograph -7A44East Asian ideograph -7A5CEast Asian ideograph -7A5FEast Asian ideograph -7A60East Asian ideograph -7A6EEast Asian ideograph -7A70East Asian ideograph -7A75East Asian ideograph -7A78East Asian ideograph -7A80East Asian ideograph -7A85East Asian ideograph -7A86East Asian ideograph -7A8AEast Asian ideograph -7A94East Asian ideograph -68A5East Asian ideograph -7AA3East Asian ideograph -7A9EEast Asian ideograph -7AA7East Asian ideograph -7AA8East Asian ideograph -7AACEast Asian ideograph -7AB3East Asian ideograph -7ABDEast Asian ideograph -7AB6East Asian ideograph -7AB8East Asian ideograph -7AB5East Asian ideograph -7ABBEast Asian ideograph -7ABFEast Asian ideograph -7ACDEast Asian ideograph -7ACFEast Asian ideograph -7AD1East Asian ideograph -7AD3East Asian ideograph -7AD4East Asian ideograph -7AD5East Asian ideograph -7ADAEast Asian ideograph -7AE1East Asian ideograph -7AE6East Asian ideograph -7AEBEast Asian ideograph -7AF0East Asian ideograph -7AF5East Asian ideograph -7AFEEast Asian ideograph -7B39East Asian ideograph -7B0FEast Asian ideograph -7B08East Asian ideograph -7B0AEast Asian ideograph -7B35East Asian ideograph -7B25East Asian ideograph -7B38East Asian ideograph -7B3BEast Asian ideograph -7B24East Asian ideograph -7B33East Asian ideograph -7B2AEast Asian ideograph -7B18East Asian ideograph -7B31East Asian ideograph -7B2BEast Asian ideograph -7B37East Asian ideograph -7B1FEast Asian ideograph -7B4AEast Asian ideograph -E9EDEast Asian ideograph not in Unicode -E96C7B04Variant of 2E6B54 which maps to 7B04 -7B47East Asian ideograph -7B58East Asian ideograph -7B6CEast Asian ideograph -7B48East Asian ideograph -7B45East Asian ideograph -7B4CEast Asian ideograph -7B4EEast Asian ideograph -7B66East Asian ideograph -7B64East Asian ideograph -7B69East Asian ideograph -7B6DEast Asian ideograph -7B62East Asian ideograph -7B6EEast Asian ideograph -7B74East Asian ideograph -7B72East Asian ideograph -7B78East Asian ideograph -7B6FEast Asian ideograph -7B67East Asian ideograph -7B65East Asian ideograph -7B71East Asian ideograph -7B70East Asian ideograph -7B73East Asian ideograph -7B9CEast Asian ideograph -7B92East Asian ideograph -7B91East Asian ideograph -7B90East Asian ideograph -7BA3East Asian ideograph -7B8DEast Asian ideograph -7B85East Asian ideograph -7B8EEast Asian ideograph -7B98East Asian ideograph -7B86East Asian ideograph -7B99East Asian ideograph -7BB2East Asian ideograph -7BCBEast Asian ideograph -7BB8East Asian ideograph -7BCFEast Asian ideograph -7BD0East Asian ideograph -7BBEEast Asian ideograph -7BCCEast Asian ideograph -7BDDEast Asian ideograph -7BE5East Asian ideograph -7BE8East Asian ideograph -7BF9East Asian ideograph -7BD4East Asian ideograph -7BDFEast Asian ideograph -7BD8East Asian ideograph -E9D17BEAUnrelated variant of EACC 3A6A7C which maps to 7BEA -7C06East Asian ideograph -7BF0East Asian ideograph -7C0FEast Asian ideograph -7C0BEast Asian ideograph -7C00East Asian ideograph -7C0CEast Asian ideograph -7BF4East Asian ideograph -7BF3East Asian ideograph -7C09East Asian ideograph -7C03East Asian ideograph -7BFCEast Asian ideograph -7C1CEast Asian ideograph -7C26East Asian ideograph -7C28East Asian ideograph -7C20East Asian ideograph -7C1FEast Asian ideograph -7C2FEast Asian ideograph -7C30East Asian ideograph -7C35East Asian ideograph -7C40East Asian ideograph -7C39East Asian ideograph -7C3BEast Asian ideograph -7C34East Asian ideograph -7C42East Asian ideograph -7C4EEast Asian ideograph -7C5DEast Asian ideograph -7C5CEast Asian ideograph -7C5AEast Asian ideograph -7C5BEast Asian ideograph -7C59East Asian ideograph -7C5EEast Asian ideograph -7C67East Asian ideograph -7C63East Asian ideograph -7C68East Asian ideograph -7C65East Asian ideograph -7C6FEast Asian ideograph -7C75East Asian ideograph -7C7EEast Asian ideograph -7C78East Asian ideograph -7C7DEast Asian ideograph -7C81East Asian ideograph -7C8EEast Asian ideograph -7C91East Asian ideograph -7C83East Asian ideograph -7C8DEast Asian ideograph -7C99East Asian ideograph -7C98East Asian ideograph -7C9CEast Asian ideograph -7C95East Asian ideograph -7CA7East Asian ideograph -7CA2East Asian ideograph -7C9EEast Asian ideograph -7CA9East Asian ideograph -7CA8East Asian ideograph -7CA1East Asian ideograph -7CACEast Asian ideograph -7CA6East Asian ideograph -7CB2East Asian ideograph -7CBBEast Asian ideograph -7CBFEast Asian ideograph -7CBAEast Asian ideograph -7CBCEast Asian ideograph -7CC2East Asian ideograph -7CCEEast Asian ideograph -7CC8East Asian ideograph -7CC5East Asian ideograph -7CCCEast Asian ideograph -7CC9East Asian ideograph -7CD2East Asian ideograph -7CD7East Asian ideograph -7CE1East Asian ideograph -E96D7CE8Variant of 4C6F7B which maps to 7CE8 -7CDDEast Asian ideograph -7CEDEast Asian ideograph -7CF0East Asian ideograph -7CF2East Asian ideograph -7CF4East Asian ideograph -7CF6East Asian ideograph -7D06East Asian ideograph -7D03East Asian ideograph -7D08East Asian ideograph -7D0FEast Asian ideograph -7D13East Asian ideograph -7D18East Asian ideograph -7D1EEast Asian ideograph -7D1DEast Asian ideograph -7D35East Asian ideograph -7D3DEast Asian ideograph -7D3AEast Asian ideograph -7D32East Asian ideograph -7D31East Asian ideograph -7D45East Asian ideograph -7D3FEast Asian ideograph -7D29East Asian ideograph -7D41East Asian ideograph -7D3EEast Asian ideograph -7D5CEast Asian ideograph -7D53East Asian ideograph -7D5AEast Asian ideograph -7D70East Asian ideograph -7D67East Asian ideograph -7D6AEast Asian ideograph -7D6BEast Asian ideograph -7D73East Asian ideograph -7D4EEast Asian ideograph -7D8BEast Asian ideograph -7D88East Asian ideograph -7D85East Asian ideograph -7D8EEast Asian ideograph -7D7FEast Asian ideograph -7D86East Asian ideograph -7D8DEast Asian ideograph -7D9BEast Asian ideograph -7D83East Asian ideograph -7D7DEast Asian ideograph -7D7BEast Asian ideograph -7D7AEast Asian ideograph -7D96East Asian ideograph -7D5BEast Asian ideograph -7D8CEast Asian ideograph -7DA3East Asian ideograph -7DAEEast Asian ideograph -7DCBEast Asian ideograph -7DAAEast Asian ideograph -7DCEEast Asian ideograph -7DC9East Asian ideograph -7DC5East Asian ideograph -7DA6East Asian ideograph -7DC4East Asian ideograph -7DACEast Asian ideograph -7DB9East Asian ideograph -7D9FEast Asian ideograph -7DE1East Asian ideograph -7DD9East Asian ideograph -7DE4East Asian ideograph -7DD7East Asian ideograph -7DF9East Asian ideograph -7E06East Asian ideograph -7DF2East Asian ideograph -7DE6East Asian ideograph -7DDCEast Asian ideograph -7DF1East Asian ideograph -7DF6East Asian ideograph -7DE5East Asian ideograph -7DF5East Asian ideograph -7E17East Asian ideograph -7E1EEast Asian ideograph -7E21East Asian ideograph -7E0BEast Asian ideograph -7E12East Asian ideograph -7E22East Asian ideograph -7E20East Asian ideograph -7E1DEast Asian ideograph -7E09East Asian ideograph -7E1FEast Asian ideograph -7E15East Asian ideograph -7E10East Asian ideograph -7E0FEast Asian ideograph -7E3BEast Asian ideograph -7E34East Asian ideograph -7E2DEast Asian ideograph -7E2FEast Asian ideograph -7E36East Asian ideograph -7E3AEast Asian ideograph -7E39East Asian ideograph -7E44East Asian ideograph -7E35East Asian ideograph -7E3FEast Asian ideograph -7E47East Asian ideograph -7E52East Asian ideograph -7E51East Asian ideograph -7E50East Asian ideograph -7E67East Asian ideograph -7E56East Asian ideograph -7E68East Asian ideograph -7E6EEast Asian ideograph -7E70East Asian ideograph -7E6FEast Asian ideograph -7E73East Asian ideograph -7E7BEast Asian ideograph -7E7EEast Asian ideograph -7E81East Asian ideograph -7E8AEast Asian ideograph -7E87East Asian ideograph -7E88East Asian ideograph -7E86East Asian ideograph -7E91East Asian ideograph -7E95East Asian ideograph -7E94East Asian ideograph -7E9BEast Asian ideograph -7E9AEast Asian ideograph -7E99East Asian ideograph -7E98East Asian ideograph -7F43East Asian ideograph -7F46East Asian ideograph -7F45East Asian ideograph -7F4BEast Asian ideograph -7F4CEast Asian ideograph -7F4DEast Asian ideograph -7F4EEast Asian ideograph -7F4FEast Asian ideograph -7F60East Asian ideograph -7F61East Asian ideograph -7F5DEast Asian ideograph -7F5BEast Asian ideograph -7F63East Asian ideograph -7F65East Asian ideograph -7F66East Asian ideograph -7F6DEast Asian ideograph -7F6BEast Asian ideograph -7F67East Asian ideograph -7F68East Asian ideograph -7F71East Asian ideograph -7F73East Asian ideograph -7F76East Asian ideograph -7F7FEast Asian ideograph -7F7EEast Asian ideograph -7F7DEast Asian ideograph -7F86East Asian ideograph -7F91East Asian ideograph -7F96East Asian ideograph -7F97East Asian ideograph -7F95East Asian ideograph -7FA2East Asian ideograph -7FA7East Asian ideograph -7FB0East Asian ideograph -7FADEast Asian ideograph -7FB1East Asian ideograph -7FB4East Asian ideograph -7FB5East Asian ideograph -7FBCEast Asian ideograph -7FBEEast Asian ideograph -7FC3East Asian ideograph -7FCAEast Asian ideograph -7FDBEast Asian ideograph -7FE3East Asian ideograph -7FE6East Asian ideograph -7FE5East Asian ideograph -7FECEast Asian ideograph -7FEBEast Asian ideograph -7FEFEast Asian ideograph -7FEEEast Asian ideograph -7FFDEast Asian ideograph -7FFEEast Asian ideograph -7FFFEast Asian ideograph -8004East Asian ideograph -8008East Asian ideograph -800BEast Asian ideograph -800EEast Asian ideograph -8011East Asian ideograph -800FEast Asian ideograph -8014East Asian ideograph -8016East Asian ideograph -801FEast Asian ideograph -801EEast Asian ideograph -801DEast Asian ideograph -8025East Asian ideograph -8026East Asian ideograph -802AEast Asian ideograph -8029East Asian ideograph -8028East Asian ideograph -8030East Asian ideograph -8031East Asian ideograph -8035East Asian ideograph -8039East Asian ideograph -8041East Asian ideograph -8043East Asian ideograph -8052East Asian ideograph -8062East Asian ideograph -8063East Asian ideograph -806CEast Asian ideograph -8075East Asian ideograph -807BEast Asian ideograph -8079East Asian ideograph -808AEast Asian ideograph -808EEast Asian ideograph -809FEast Asian ideograph -670AEast Asian ideograph -80A7East Asian ideograph -80B0East Asian ideograph -80B8East Asian ideograph -80B5East Asian ideograph -80A6East Asian ideograph -80E0East Asian ideograph -6711East Asian ideograph -80DFEast Asian ideograph -80C2East Asian ideograph -80D9East Asian ideograph -80DDEast Asian ideograph -80CFEast Asian ideograph -80CDEast Asian ideograph -80D7East Asian ideograph -80F2East Asian ideograph -80FAEast Asian ideograph -80FEEast Asian ideograph -8103East Asian ideograph -80F9East Asian ideograph -80EFEast Asian ideograph -80D4East Asian ideograph -811DEast Asian ideograph -8118East Asian ideograph -8130East Asian ideograph -8124East Asian ideograph -811BEast Asian ideograph -812AEast Asian ideograph -811EEast Asian ideograph -8121East Asian ideograph -8117East Asian ideograph -813AEast Asian ideograph -815AEast Asian ideograph -8148East Asian ideograph -814CEast Asian ideograph -8153East Asian ideograph -8141East Asian ideograph -814DEast Asian ideograph -6720East Asian ideograph -8160East Asian ideograph -8169East Asian ideograph -817CEast Asian ideograph -8161East Asian ideograph -8176East Asian ideograph -8174East Asian ideograph -8167East Asian ideograph -816FEast Asian ideograph -8182East Asian ideograph -818BEast Asian ideograph -8186East Asian ideograph -8183East Asian ideograph -819FEast Asian ideograph -81A3East Asian ideograph -8198East Asian ideograph -8195East Asian ideograph -8197East Asian ideograph -81AAEast Asian ideograph -81A6East Asian ideograph -6725East Asian ideograph -81B5East Asian ideograph -81B0East Asian ideograph -81B4East Asian ideograph -81B7East Asian ideograph -81BBEast Asian ideograph -81C1East Asian ideograph -81CCEast Asian ideograph -81CAEast Asian ideograph -81C4East Asian ideograph -81D1East Asian ideograph -81CEEast Asian ideograph -81D0East Asian ideograph -81DBEast Asian ideograph -81DDEast Asian ideograph -81DEEast Asian ideograph -81E0East Asian ideograph -81E2East Asian ideograph -81E7East Asian ideograph -81EFEast Asian ideograph -81F2East Asian ideograph -81F6East Asian ideograph -8201East Asian ideograph -E9EEEast Asian ideograph not in Unicode -8203East Asian ideograph -8204East Asian ideograph -820BEast Asian ideograph -821DEast Asian ideograph -8220East Asian ideograph -822DEast Asian ideograph -822FEast Asian ideograph -8238East Asian ideograph -823AEast Asian ideograph -8233East Asian ideograph -8234East Asian ideograph -8232East Asian ideograph -8248East Asian ideograph -8249East Asian ideograph -8244East Asian ideograph -8240East Asian ideograph -8241East Asian ideograph -8245East Asian ideograph -824BEast Asian ideograph -824FEast Asian ideograph -824EEast Asian ideograph -8256East Asian ideograph -8257East Asian ideograph -825AEast Asian ideograph -825FEast Asian ideograph -8262East Asian ideograph -8268East Asian ideograph -826DEast Asian ideograph -8278East Asian ideograph -827FEast Asian ideograph -828EEast Asian ideograph -8291East Asian ideograph -828FEast Asian ideograph -8284East Asian ideograph -8283East Asian ideograph -828AEast Asian ideograph -82AFEast Asian ideograph -82A7East Asian ideograph -82ABEast Asian ideograph -82B0East Asian ideograph -82A4East Asian ideograph -829AEast Asian ideograph -82A3East Asian ideograph -82B7East Asian ideograph -E96E82AEVariant of 4C7C45 which maps to 82AE -82A9East Asian ideograph -82BCEast Asian ideograph -82A8East Asian ideograph -82B4East Asian ideograph -82A1East Asian ideograph -82AAEast Asian ideograph -82D9East Asian ideograph -82FEEast Asian ideograph -82E0East Asian ideograph -82D0East Asian ideograph -8300East Asian ideograph -82EAEast Asian ideograph -82F7East Asian ideograph -82EFEast Asian ideograph -833AEast Asian ideograph -82E4East Asian ideograph -82D5East Asian ideograph -8307East Asian ideograph -82FAEast Asian ideograph -82F4East Asian ideograph -82E2East Asian ideograph -82D2East Asian ideograph -8314East Asian ideograph -82EBEast Asian ideograph -82D8East Asian ideograph -82E1East Asian ideograph -82F6East Asian ideograph -8310East Asian ideograph -82F3East Asian ideograph -830CEast Asian ideograph -82FBEast Asian ideograph -82FDEast Asian ideograph -8333East Asian ideograph -8328East Asian ideograph -8344East Asian ideograph -8351East Asian ideograph -831BEast Asian ideograph -8356East Asian ideograph -8322East Asian ideograph -832CEast Asian ideograph -833CEast Asian ideograph -834DEast Asian ideograph -E96F8343Variant of 4C7D4D which maps to 8343 -832FEast Asian ideograph -8348East Asian ideograph -8312East Asian ideograph -8316East Asian ideograph -831AEast Asian ideograph -8347East Asian ideograph -83A8East Asian ideograph -83ADEast Asian ideograph -8373East Asian ideograph -83B0East Asian ideograph -831DEast Asian ideograph -838FEast Asian ideograph -8395East Asian ideograph -8375East Asian ideograph -837FEast Asian ideograph -8399East Asian ideograph -83A6East Asian ideograph -8387East Asian ideograph -83B9East Asian ideograph -83A9East Asian ideograph -839BEast Asian ideograph -83AAEast Asian ideograph -839CEast Asian ideograph -839FEast Asian ideograph -83CFEast Asian ideograph -83F9East Asian ideograph -8421East Asian ideograph -8423East Asian ideograph -83EAEast Asian ideograph -8413East Asian ideograph -83FCEast Asian ideograph -83F6East Asian ideograph -8410East Asian ideograph -83E1East Asian ideograph -83C6East Asian ideograph -8407East Asian ideograph -83EBEast Asian ideograph -83BFEast Asian ideograph -83E2East Asian ideograph -8401East Asian ideograph -83D8East Asian ideograph -83E5East Asian ideograph -8418East Asian ideograph -83CEEast Asian ideograph -83D3East Asian ideograph -83D6East Asian ideograph -83FDEast Asian ideograph -841EEast Asian ideograph -83C9East Asian ideograph -83DFEast Asian ideograph -841FEast Asian ideograph -840FEast Asian ideograph -8411East Asian ideograph -839AEast Asian ideograph -83F3East Asian ideograph -83D1East Asian ideograph -8453East Asian ideograph -848EEast Asian ideograph -8439East Asian ideograph -8476East Asian ideograph -8479East Asian ideograph -8451East Asian ideograph -847DEast Asian ideograph -845AEast Asian ideograph -8459East Asian ideograph -8473East Asian ideograph -843EEast Asian ideograph -846DEast Asian ideograph -847AEast Asian ideograph -8484East Asian ideograph -8478East Asian ideograph -8432East Asian ideograph -845CEast Asian ideograph -842AEast Asian ideograph -8429East Asian ideograph -8471East Asian ideograph -845FEast Asian ideograph -8460East Asian ideograph -846EEast Asian ideograph -8446East Asian ideograph -8452East Asian ideograph -844AEast Asian ideograph -844EEast Asian ideograph -8497East Asian ideograph -84A1East Asian ideograph -849FEast Asian ideograph -84BAEast Asian ideograph -84B9East Asian ideograph -84B4East Asian ideograph -84C1East Asian ideograph -84BBEast Asian ideograph -84CDEast Asian ideograph -84B1East Asian ideograph -849DEast Asian ideograph -84D0East Asian ideograph -8494East Asian ideograph -84C7East Asian ideograph -84BDEast Asian ideograph -84C2East Asian ideograph -8495East Asian ideograph -84AFEast Asian ideograph -84ADEast Asian ideograph -84A8East Asian ideograph -84D6East Asian ideograph -84DAEast Asian ideograph -8493East Asian ideograph -84CFEast Asian ideograph -84CAEast Asian ideograph -8506East Asian ideograph -850BEast Asian ideograph -8500East Asian ideograph -851FEast Asian ideograph -853BEast Asian ideograph -84EAEast Asian ideograph -84F4East Asian ideograph -850CEast Asian ideograph -852FEast Asian ideograph -8515East Asian ideograph -84F7East Asian ideograph -84FCEast Asian ideograph -84EBEast Asian ideograph -84FDEast Asian ideograph -851EEast Asian ideograph -8518East Asian ideograph -8526East Asian ideograph -E9708507Variant of 2F252E which maps to 8507 -84E7East Asian ideograph -84F0East Asian ideograph -84EFEast Asian ideograph -8556East Asian ideograph -8541East Asian ideograph -8558East Asian ideograph -8553East Asian ideograph -8561East Asian ideograph -8540East Asian ideograph -8546East Asian ideograph -8564East Asian ideograph -855EEast Asian ideograph -8573East Asian ideograph -8551East Asian ideograph -8562East Asian ideograph -8563East Asian ideograph -848DEast Asian ideograph -8542East Asian ideograph -854EEast Asian ideograph -8555East Asian ideograph -855DEast Asian ideograph -858CEast Asian ideograph -8580East Asian ideograph -858FEast Asian ideograph -8579East Asian ideograph -857FEast Asian ideograph -8577East Asian ideograph -8578East Asian ideograph -8598East Asian ideograph -857BEast Asian ideograph -85A4East Asian ideograph -857AEast Asian ideograph -8597East Asian ideograph -8557East Asian ideograph -85A8East Asian ideograph -8586East Asian ideograph -8599East Asian ideograph -858AEast Asian ideograph -85A2East Asian ideograph -8590East Asian ideograph -8585East Asian ideograph -8588East Asian ideograph -85B8East Asian ideograph -85C1East Asian ideograph -85BAEast Asian ideograph -85CEEast Asian ideograph -85C2East Asian ideograph -85B7East Asian ideograph -85B9East Asian ideograph -85B3East Asian ideograph -85BDEast Asian ideograph -85C4East Asian ideograph -85BFEast Asian ideograph -85BEEast Asian ideograph -85B6East Asian ideograph -8624East Asian ideograph -85F7East Asian ideograph -85E6East Asian ideograph -85D4East Asian ideograph -85EDEast Asian ideograph -85DAEast Asian ideograph -85DFEast Asian ideograph -85D8East Asian ideograph -85DCEast Asian ideograph -85F5East Asian ideograph -8622East Asian ideograph -8610East Asian ideograph -85FCEast Asian ideograph -85FFEast Asian ideograph -85FEEast Asian ideograph -8600East Asian ideograph -8604East Asian ideograph -8605East Asian ideograph -862BEast Asian ideograph -8627East Asian ideograph -8629East Asian ideograph -8637East Asian ideograph -8636East Asian ideograph -863CEast Asian ideograph -8640East Asian ideograph -863AEast Asian ideograph -8645East Asian ideograph -864DEast Asian ideograph -8653East Asian ideograph -8659East Asian ideograph -8661East Asian ideograph -8662East Asian ideograph -8663East Asian ideograph -8669East Asian ideograph -866CEast Asian ideograph -8672East Asian ideograph -866FEast Asian ideograph -867BEast Asian ideograph -867AEast Asian ideograph -8673East Asian ideograph -867CEast Asian ideograph -8696East Asian ideograph -86A8East Asian ideograph -8691East Asian ideograph -869CEast Asian ideograph -8698East Asian ideograph -868DEast Asian ideograph -868BEast Asian ideograph -86A6East Asian ideograph -869DEast Asian ideograph -86A0East Asian ideograph -86A7East Asian ideograph -86BFEast Asian ideograph -86BAEast Asian ideograph -86B0East Asian ideograph -86B3East Asian ideograph -86C9East Asian ideograph -86B4East Asian ideograph -86D8East Asian ideograph -86E3East Asian ideograph -86E9East Asian ideograph -86ECEast Asian ideograph -86D5East Asian ideograph -86D0East Asian ideograph -86D1East Asian ideograph -86DEEast Asian ideograph -870BEast Asian ideograph -86FAEast Asian ideograph -86F8East Asian ideograph -8706East Asian ideograph -870EEast Asian ideograph -8709East Asian ideograph -870AEast Asian ideograph -870DEast Asian ideograph -874AEast Asian ideograph -8723East Asian ideograph -8737East Asian ideograph -8728East Asian ideograph -8740East Asian ideograph -872EEast Asian ideograph -873DEast Asian ideograph -871EEast Asian ideograph -8743East Asian ideograph -8744East Asian ideograph -873EEast Asian ideograph -8729East Asian ideograph -8739East Asian ideograph -871AEast Asian ideograph -8731East Asian ideograph -8711East Asian ideograph -8712East Asian ideograph -874FEast Asian ideograph -8771East Asian ideograph -8763East Asian ideograph -8764East Asian ideograph -8765East Asian ideograph -877DEast Asian ideograph -8758East Asian ideograph -877BEast Asian ideograph -8761East Asian ideograph -876AEast Asian ideograph -874EEast Asian ideograph -875FEast Asian ideograph -876FEast Asian ideograph -875DEast Asian ideograph -876EEast Asian ideograph -874DEast Asian ideograph -8753East Asian ideograph -87A3East Asian ideograph -8793East Asian ideograph -8799East Asian ideograph -8788East Asian ideograph -8798East Asian ideograph -8785East Asian ideograph -878BEast Asian ideograph -8784East Asian ideograph -87A9East Asian ideograph -8789East Asian ideograph -87ADEast Asian ideograph -87BEEast Asian ideograph -87C4East Asian ideograph -87AFEast Asian ideograph -87ACEast Asian ideograph -87AEEast Asian ideograph -87BFEast Asian ideograph -87BDEast Asian ideograph -87EEEast Asian ideograph -87F3East Asian ideograph -87F0East Asian ideograph -87EAEast Asian ideograph -87DBEast Asian ideograph -87E2East Asian ideograph -87EBEast Asian ideograph -87D6East Asian ideograph -87F5East Asian ideograph -87E0East Asian ideograph -87D3East Asian ideograph -87DCEast Asian ideograph -87E3East Asian ideograph -8801East Asian ideograph -8803East Asian ideograph -880AEast Asian ideograph -87F6East Asian ideograph -87F7East Asian ideograph -880BEast Asian ideograph -8806East Asian ideograph -87FEEast Asian ideograph -8810East Asian ideograph -8819East Asian ideograph -8811East Asian ideograph -8818East Asian ideograph -8813East Asian ideograph -8816East Asian ideograph -8834East Asian ideograph -881CEast Asian ideograph -881BEast Asian ideograph -8828East Asian ideograph -8832East Asian ideograph -882EEast Asian ideograph -882DEast Asian ideograph -883CEast Asian ideograph -8841East Asian ideograph -E9EFEast Asian ideograph not in Unicode -8844East Asian ideograph -8847East Asian ideograph -884AEast Asian ideograph -884EEast Asian ideograph -8852East Asian ideograph -8850East Asian ideograph -8856East Asian ideograph -8855East Asian ideograph -885CEast Asian ideograph -885AEast Asian ideograph -8869East Asian ideograph -886DEast Asian ideograph -887AEast Asian ideograph -8875East Asian ideograph -8872East Asian ideograph -887DEast Asian ideograph -8879East Asian ideograph -887FEast Asian ideograph -887EEast Asian ideograph -88A2East Asian ideograph -88A4East Asian ideograph -88AAEast Asian ideograph -889AEast Asian ideograph -8890East Asian ideograph -888CEast Asian ideograph -88A0East Asian ideograph -8899East Asian ideograph -8897East Asian ideograph -88C9East Asian ideograph -88BFEast Asian ideograph -88BAEast Asian ideograph -88C0East Asian ideograph -88B2East Asian ideograph -88BCEast Asian ideograph -88B7East Asian ideograph -88BDEast Asian ideograph -88C4East Asian ideograph -88CBEast Asian ideograph -88CCEast Asian ideograph -88DBEast Asian ideograph -88CEEast Asian ideograph -88D2East Asian ideograph -88F1East Asian ideograph -88FEEast Asian ideograph -88F2East Asian ideograph -8900East Asian ideograph -88F0East Asian ideograph -88FCEast Asian ideograph -88EFEast Asian ideograph -8903East Asian ideograph -8909East Asian ideograph -8918East Asian ideograph -8906East Asian ideograph -890CEast Asian ideograph -8919East Asian ideograph -890AEast Asian ideograph -8915East Asian ideograph -892FEast Asian ideograph -8930East Asian ideograph -8921East Asian ideograph -8927East Asian ideograph -891FEast Asian ideograph -8931East Asian ideograph -891EEast Asian ideograph -8926East Asian ideograph -8922East Asian ideograph -8935East Asian ideograph -8941East Asian ideograph -8933East Asian ideograph -8954East Asian ideograph -894FEast Asian ideograph -8947East Asian ideograph -894CEast Asian ideograph -8946East Asian ideograph -894DEast Asian ideograph -8962East Asian ideograph -895AEast Asian ideograph -895EEast Asian ideograph -895BEast Asian ideograph -895CEast Asian ideograph -895DEast Asian ideograph -8966East Asian ideograph -896DEast Asian ideograph -896BEast Asian ideograph -896EEast Asian ideograph -896CEast Asian ideograph -8976East Asian ideograph -8974East Asian ideograph -897BEast Asian ideograph -897CEast Asian ideograph -8984East Asian ideograph -8985East Asian ideograph -8991East Asian ideograph -8997East Asian ideograph -8998East Asian ideograph -899CEast Asian ideograph -89A1East Asian ideograph -89A5East Asian ideograph -89A9East Asian ideograph -89AFEast Asian ideograph -89B8East Asian ideograph -89B7East Asian ideograph -89B6East Asian ideograph -89BCEast Asian ideograph -89BFEast Asian ideograph -89D6East Asian ideograph -89D5East Asian ideograph -89DAEast Asian ideograph -89E5East Asian ideograph -89DCEast Asian ideograph -89E1East Asian ideograph -89E9East Asian ideograph -89EBEast Asian ideograph -89EDEast Asian ideograph -89F1East Asian ideograph -89F3East Asian ideograph -89F5East Asian ideograph -89F6East Asian ideograph -89F7East Asian ideograph -89FFEast Asian ideograph -8A06East Asian ideograph -8A07East Asian ideograph -8A04East Asian ideograph -8A0FEast Asian ideograph -8A11East Asian ideograph -8A12East Asian ideograph -8A0DEast Asian ideograph -8A27East Asian ideograph -8A29East Asian ideograph -8A22East Asian ideograph -8A51East Asian ideograph -8A4AEast Asian ideograph -8A4EEast Asian ideograph -8A56East Asian ideograph -8A57East Asian ideograph -8A48East Asian ideograph -8A58East Asian ideograph -8A52East Asian ideograph -8A3DEast Asian ideograph -8A45East Asian ideograph -8A7FEast Asian ideograph -8A86East Asian ideograph -8A61East Asian ideograph -8A3EEast Asian ideograph -8A82East Asian ideograph -8A84East Asian ideograph -8A75East Asian ideograph -8A8FEast Asian ideograph -8A96East Asian ideograph -8A9AEast Asian ideograph -8AB6East Asian ideograph -8ABEEast Asian ideograph -8ACFEast Asian ideograph -8AC6East Asian ideograph -8AD1East Asian ideograph -8AD3East Asian ideograph -8AAFEast Asian ideograph -8AD4East Asian ideograph -8ACDEast Asian ideograph -8AB9East Asian ideograph -8ADBEast Asian ideograph -8AD0East Asian ideograph -8AD7East Asian ideograph -8AF3East Asian ideograph -8AE2East Asian ideograph -8B4CEast Asian ideograph -8ADDEast Asian ideograph -8AF6East Asian ideograph -8AF4East Asian ideograph -8AF5East Asian ideograph -8ADFEast Asian ideograph -8B03East Asian ideograph -8AE4East Asian ideograph -8B14East Asian ideograph -8AFCEast Asian ideograph -8ADEEast Asian ideograph -8AE1East Asian ideograph -8B07East Asian ideograph -8B0CEast Asian ideograph -8B1CEast Asian ideograph -8B16East Asian ideograph -8B1FEast Asian ideograph -8B0BEast Asian ideograph -8B06East Asian ideograph -8B05East Asian ideograph -8B0FEast Asian ideograph -8B10East Asian ideograph -8B2BEast Asian ideograph -8B37East Asian ideograph -8B26East Asian ideograph -8B33East Asian ideograph -8B3EEast Asian ideograph -8B29East Asian ideograph -8B48East Asian ideograph -8B54East Asian ideograph -8B53East Asian ideograph -8B4AEast Asian ideograph -8B46East Asian ideograph -8B56East Asian ideograph -8B3FEast Asian ideograph -8B59East Asian ideograph -8B4DEast Asian ideograph -8B6BEast Asian ideograph -8B6DEast Asian ideograph -8B78East Asian ideograph -8B45East Asian ideograph -8B85East Asian ideograph -8B81East Asian ideograph -8B7EEast Asian ideograph -8B8BEast Asian ideograph -8B87East Asian ideograph -8B95East Asian ideograph -8B94East Asian ideograph -8B9CEast Asian ideograph -8B9FEast Asian ideograph -8C3AEast Asian ideograph -8C40East Asian ideograph -8C42East Asian ideograph -8C47East Asian ideograph -8C4BEast Asian ideograph -8C4FEast Asian ideograph -8C55East Asian ideograph -8C57East Asian ideograph -8C5CEast Asian ideograph -8C5DEast Asian ideograph -86C3East Asian ideograph -8C68East Asian ideograph -8C6DEast Asian ideograph -8C73East Asian ideograph -8C74East Asian ideograph -8C75East Asian ideograph -8C77East Asian ideograph -8C76East Asian ideograph -8C78East Asian ideograph -8C7BEast Asian ideograph -8C86East Asian ideograph -8C85East Asian ideograph -8C88East Asian ideograph -8C94East Asian ideograph -8C9BEast Asian ideograph -8C9FEast Asian ideograph -8CA4East Asian ideograph -8CB0East Asian ideograph -8CBAEast Asian ideograph -8CB5East Asian ideograph -8CB9East Asian ideograph -8CCDEast Asian ideograph -8CD8East Asian ideograph -8CD5East Asian ideograph -8CE8East Asian ideograph -8CE9East Asian ideograph -8CE1East Asian ideograph -8CEBEast Asian ideograph -8CDAEast Asian ideograph -8CDDEast Asian ideograph -8CD9East Asian ideograph -8CEEEast Asian ideograph -8CF1East Asian ideograph -8CF5East Asian ideograph -8CFBEast Asian ideograph -8CF7East Asian ideograph -8D04East Asian ideograph -8CFEEast Asian ideograph -8D07East Asian ideograph -8D09East Asian ideograph -8D0CEast Asian ideograph -8D11East Asian ideograph -8D10East Asian ideograph -8D12East Asian ideograph -8D14East Asian ideograph -8D18East Asian ideograph -8D6CEast Asian ideograph -8D78East Asian ideograph -8D7AEast Asian ideograph -8D84East Asian ideograph -8D94East Asian ideograph -8D8DEast Asian ideograph -8D96East Asian ideograph -8DA1East Asian ideograph -8DA6East Asian ideograph -8DABEast Asian ideograph -8DAFEast Asian ideograph -8DB0East Asian ideograph -8DB2East Asian ideograph -8DBCEast Asian ideograph -8DBAEast Asian ideograph -8DB9East Asian ideograph -8DC2East Asian ideograph -8DC1East Asian ideograph -8DBFEast Asian ideograph -8DCFEast Asian ideograph -8DD6East Asian ideograph -8DD0East Asian ideograph -8DC5East Asian ideograph -8DE4East Asian ideograph -8DECEast Asian ideograph -8DEBEast Asian ideograph -8DF4East Asian ideograph -8DE9East Asian ideograph -8DE6East Asian ideograph -8DE3East Asian ideograph -8DE7East Asian ideograph -8DF2East Asian ideograph -8E09East Asian ideograph -8DFDEast Asian ideograph -8DFFEast Asian ideograph -8E05East Asian ideograph -8E01East Asian ideograph -8E04East Asian ideograph -8E06East Asian ideograph -8E2AEast Asian ideograph -8E23East Asian ideograph -8E2EEast Asian ideograph -8E21East Asian ideograph -8E1EEast Asian ideograph -8E16East Asian ideograph -8E26East Asian ideograph -8E27East Asian ideograph -8E14East Asian ideograph -8E18East Asian ideograph -8E41East Asian ideograph -8E40East Asian ideograph -8E36East Asian ideograph -8E3DEast Asian ideograph -8E30East Asian ideograph -8E47East Asian ideograph -8E46East Asian ideograph -8E4CEast Asian ideograph -8E50East Asian ideograph -8E4FEast Asian ideograph -8E5CEast Asian ideograph -8E62East Asian ideograph -8E60East Asian ideograph -8E54East Asian ideograph -8E67East Asian ideograph -8E5AEast Asian ideograph -8E5EEast Asian ideograph -8E55East Asian ideograph -8E61East Asian ideograph -8E5DEast Asian ideograph -8E75East Asian ideograph -8E74East Asian ideograph -8E95East Asian ideograph -8E6DEast Asian ideograph -8E69East Asian ideograph -8E83East Asian ideograph -8E84East Asian ideograph -8E8BEast Asian ideograph -8E94East Asian ideograph -8E9AEast Asian ideograph -8E92East Asian ideograph -8E93East Asian ideograph -8E90East Asian ideograph -8E98East Asian ideograph -8E9EEast Asian ideograph -8EA5East Asian ideograph -8EA7East Asian ideograph -8EA9East Asian ideograph -8E99East Asian ideograph -8EB3East Asian ideograph -8EBCEast Asian ideograph -8EB6East Asian ideograph -8EC9East Asian ideograph -8ECFEast Asian ideograph -8ECEEast Asian ideograph -8ED5East Asian ideograph -8EFAEast Asian ideograph -8EF9East Asian ideograph -8EE8East Asian ideograph -8EEBEast Asian ideograph -8EFFEast Asian ideograph -8F00East Asian ideograph -8F05East Asian ideograph -8F08East Asian ideograph -8F07East Asian ideograph -8F27East Asian ideograph -8F2CEast Asian ideograph -8F1EEast Asian ideograph -8F25East Asian ideograph -8F20East Asian ideograph -8F17East Asian ideograph -8F36East Asian ideograph -8F2EEast Asian ideograph -8F33East Asian ideograph -8F2DEast Asian ideograph -8F39East Asian ideograph -8F34East Asian ideograph -8F40East Asian ideograph -8F46East Asian ideograph -8F4AEast Asian ideograph -8F47East Asian ideograph -8F52East Asian ideograph -8F56East Asian ideograph -8F57East Asian ideograph -8F55East Asian ideograph -8F58East Asian ideograph -8F5CEast Asian ideograph -8F5EEast Asian ideograph -8F5DEast Asian ideograph -8F62East Asian ideograph -8F63East Asian ideograph -8F64East Asian ideograph -8FA4East Asian ideograph -8FA5East Asian ideograph -8FB5East Asian ideograph -8FB7East Asian ideograph -8FBBEast Asian ideograph -8FBCEast Asian ideograph -8FBFEast Asian ideograph -8FD2East Asian ideograph -8FCBEast Asian ideograph -8FCAEast Asian ideograph -8FD3East Asian ideograph -8FCDEast Asian ideograph -8FDAEast Asian ideograph -8FD5East Asian ideograph -8FE4East Asian ideograph -8FEEEast Asian ideograph -8FF9East Asian ideograph -8FFBEast Asian ideograph -9004East Asian ideograph -9008East Asian ideograph -9011East Asian ideograph -900BEast Asian ideograph -900CEast Asian ideograph -9021East Asian ideograph -902DEast Asian ideograph -902CEast Asian ideograph -9037East Asian ideograph -9034East Asian ideograph -902FEast Asian ideograph -9036East Asian ideograph -9046East Asian ideograph -9052East Asian ideograph -9049East Asian ideograph -9044East Asian ideograph -9062East Asian ideograph -905DEast Asian ideograph -905BEast Asian ideograph -906BEast Asian ideograph -9070East Asian ideograph -906FEast Asian ideograph -9079East Asian ideograph -9076East Asian ideograph -907BEast Asian ideograph -9085East Asian ideograph -9083East Asian ideograph -9088East Asian ideograph -908BEast Asian ideograph -9099East Asian ideograph -9097East Asian ideograph -909BEast Asian ideograph -909CEast Asian ideograph -90A1East Asian ideograph -90A8East Asian ideograph -90A0East Asian ideograph -90AFEast Asian ideograph -90B3East Asian ideograph -90B6East Asian ideograph -90B0East Asian ideograph -90ADEast Asian ideograph -90B2East Asian ideograph -90C9East Asian ideograph -90BDEast Asian ideograph -90D5East Asian ideograph -90BEEast Asian ideograph -90C7East Asian ideograph -90C8East Asian ideograph -90C3East Asian ideograph -90DDEast Asian ideograph -90DFEast Asian ideograph -90E2East Asian ideograph -90D8East Asian ideograph -90DBEast Asian ideograph -90DCEast Asian ideograph -90D7East Asian ideograph -90E4East Asian ideograph -90EFEast Asian ideograph -90EAEast Asian ideograph -90F0East Asian ideograph -90F4East Asian ideograph -90F2East Asian ideograph -90EBEast Asian ideograph -90F3East Asian ideograph -90FCEast Asian ideograph -90FEEast Asian ideograph -9104East Asian ideograph -90FFEast Asian ideograph -9106East Asian ideograph -9100East Asian ideograph -9107East Asian ideograph -910FEast Asian ideograph -9111East Asian ideograph -9116East Asian ideograph -9114East Asian ideograph -910BEast Asian ideograph -9118East Asian ideograph -911CEast Asian ideograph -9120East Asian ideograph -9122East Asian ideograph -911EEast Asian ideograph -9124East Asian ideograph -911AEast Asian ideograph -9125East Asian ideograph -912FEast Asian ideograph -912BEast Asian ideograph -9132East Asian ideograph -9126East Asian ideograph -9134East Asian ideograph -9136East Asian ideograph -913AEast Asian ideograph -913BEast Asian ideograph -9143East Asian ideograph -9146East Asian ideograph -9145East Asian ideograph -9148East Asian ideograph -9147East Asian ideograph -9150East Asian ideograph -914EEast Asian ideograph -9159East Asian ideograph -915CEast Asian ideograph -9156East Asian ideograph -9158East Asian ideograph -915AEast Asian ideograph -9161East Asian ideograph -9164East Asian ideograph -916FEast Asian ideograph -916EEast Asian ideograph -917AEast Asian ideograph -9172East Asian ideograph -9179East Asian ideograph -9176East Asian ideograph -9174East Asian ideograph -9173East Asian ideograph -9185East Asian ideograph -9182East Asian ideograph -918AEast Asian ideograph -9186East Asian ideograph -918CEast Asian ideograph -9181East Asian ideograph -9191East Asian ideograph -9190East Asian ideograph -918EEast Asian ideograph -918DEast Asian ideograph -9193East Asian ideograph -919DEast Asian ideograph -919AEast Asian ideograph -91A2East Asian ideograph -E971919BVariant of 4D4134 which maps to 919B -91A8East Asian ideograph -91AAEast Asian ideograph -91AFEast Asian ideograph -91B1East Asian ideograph -91ADEast Asian ideograph -91AEEast Asian ideograph -91B4East Asian ideograph -91B2East Asian ideograph -91B5East Asian ideograph -91BFEast Asian ideograph -91BDEast Asian ideograph -91C2East Asian ideograph -91C4East Asian ideograph -91C3East Asian ideograph -91D4East Asian ideograph -91D3East Asian ideograph -91D5East Asian ideograph -91D9East Asian ideograph -91E2East Asian ideograph -91EDEast Asian ideograph -91F7East Asian ideograph -91FAEast Asian ideograph -91F2East Asian ideograph -91E8East Asian ideograph -91F6East Asian ideograph -91EEEast Asian ideograph -91F4East Asian ideograph -91F1East Asian ideograph -91E9East Asian ideograph -91F8East Asian ideograph -91F9East Asian ideograph -91E4East Asian ideograph -9204East Asian ideograph -9201East Asian ideograph -922BEast Asian ideograph -920AEast Asian ideograph -9225East Asian ideograph -9292East Asian ideograph -9228East Asian ideograph -9207East Asian ideograph -9203East Asian ideograph -9200East Asian ideograph -9218East Asian ideograph -91FEEast Asian ideograph -9208East Asian ideograph -9226East Asian ideograph -921CEast Asian ideograph -9224East Asian ideograph -9212East Asian ideograph -91FFEast Asian ideograph -9216East Asian ideograph -9211East Asian ideograph -9206East Asian ideograph -92A2East Asian ideograph -9230East Asian ideograph -9249East Asian ideograph -924DEast Asian ideograph -9248East Asian ideograph -923AEast Asian ideograph -922EEast Asian ideograph -9233East Asian ideograph -9266East Asian ideograph -925EEast Asian ideograph -9235East Asian ideograph -9250East Asian ideograph -926BEast Asian ideograph -9239East Asian ideograph -926DEast Asian ideograph -926CEast Asian ideograph -924FEast Asian ideograph -923FEast Asian ideograph -9260East Asian ideograph -9236East Asian ideograph -924EEast Asian ideograph -924CEast Asian ideograph -9256East Asian ideograph -925AEast Asian ideograph -9241East Asian ideograph -9283East Asian ideograph -92A5East Asian ideograph -9282East Asian ideograph -92A8East Asian ideograph -927CEast Asian ideograph -92A4East Asian ideograph -9276East Asian ideograph -928DEast Asian ideograph -92EEEast Asian ideograph -9288East Asian ideograph -927AEast Asian ideograph -928EEast Asian ideograph -92A0East Asian ideograph -9277East Asian ideograph -92AAEast Asian ideograph -92A6East Asian ideograph -927EEast Asian ideograph -929AEast Asian ideograph -92ABEast Asian ideograph -9291East Asian ideograph -929BEast Asian ideograph -927FEast Asian ideograph -92A3East Asian ideograph -92C8East Asian ideograph -92C3East Asian ideograph -92D0East Asian ideograph -92F1East Asian ideograph -92DFEast Asian ideograph -92E6East Asian ideograph -92B6East Asian ideograph -92C0East Asian ideograph -92BEEast Asian ideograph -92D9East Asian ideograph -92D5East Asian ideograph -92C6East Asian ideograph -92F4East Asian ideograph -92CFEast Asian ideograph -92B2East Asian ideograph -92E7East Asian ideograph -92C7East Asian ideograph -92F0East Asian ideograph -92DBEast Asian ideograph -92DCEast Asian ideograph -92D8East Asian ideograph -92E9East Asian ideograph -92DDEast Asian ideograph -92D1East Asian ideograph -92CAEast Asian ideograph -92C2East Asian ideograph -92CCEast Asian ideograph -92EFEast Asian ideograph -92E8East Asian ideograph -92EBEast Asian ideograph -92F5East Asian ideograph -92F2East Asian ideograph -9303East Asian ideograph -9307East Asian ideograph -931EEast Asian ideograph -9344East Asian ideograph -931DEast Asian ideograph -92FAEast Asian ideograph -931FEast Asian ideograph -9331East Asian ideograph -9306East Asian ideograph -92F9East Asian ideograph -930FEast Asian ideograph -9302East Asian ideograph -9324East Asian ideograph -9312East Asian ideograph -9338East Asian ideograph -9323East Asian ideograph -9321East Asian ideograph -9340East Asian ideograph -9301East Asian ideograph -9315East Asian ideograph -9329East Asian ideograph -932EEast Asian ideograph -932AEast Asian ideograph -933FEast Asian ideograph -933AEast Asian ideograph -9335East Asian ideograph -9314East Asian ideograph -92FEEast Asian ideograph -9342East Asian ideograph -9341East Asian ideograph -9319East Asian ideograph -934CEast Asian ideograph -9379East Asian ideograph -9386East Asian ideograph -936AEast Asian ideograph -935CEast Asian ideograph -934FEast Asian ideograph -9347East Asian ideograph -937AEast Asian ideograph -9356East Asian ideograph -9371East Asian ideograph -937CEast Asian ideograph -9377East Asian ideograph -9349East Asian ideograph -9358East Asian ideograph -935AEast Asian ideograph -E9F0East Asian ideograph not in Unicode -935FEast Asian ideograph -9376East Asian ideograph -9355East Asian ideograph -9354East Asian ideograph -9348East Asian ideograph -9374East Asian ideograph -9351East Asian ideograph -9364East Asian ideograph -936BEast Asian ideograph -936DEast Asian ideograph -9360East Asian ideograph -936EEast Asian ideograph -938FEast Asian ideograph -93ACEast Asian ideograph -9395East Asian ideograph -938BEast Asian ideograph -93B5East Asian ideograph -938CEast Asian ideograph -9388East Asian ideograph -93B9East Asian ideograph -93A1East Asian ideograph -93B0East Asian ideograph -93A3East Asian ideograph -93B7East Asian ideograph -939BEast Asian ideograph -9398East Asian ideograph -9389East Asian ideograph -93A4East Asian ideograph -93BCEast Asian ideograph -93A7East Asian ideograph -93BDEast Asian ideograph -93A6East Asian ideograph -939AEast Asian ideograph -93AAEast Asian ideograph -939EEast Asian ideograph -9397East Asian ideograph -93BBEast Asian ideograph -93F1East Asian ideograph -93DEEast Asian ideograph -93EEEast Asian ideograph -93C7East Asian ideograph -93F2East Asian ideograph -93D4East Asian ideograph -93E5East Asian ideograph -93F9East Asian ideograph -93CAEast Asian ideograph -93C4East Asian ideograph -93E8East Asian ideograph -93E7East Asian ideograph -93DAEast Asian ideograph -93D0East Asian ideograph -93EFEast Asian ideograph -93DBEast Asian ideograph -93CCEast Asian ideograph -93D3East Asian ideograph -93A9East Asian ideograph -93E6East Asian ideograph -940BEast Asian ideograph -9413East Asian ideograph -940FEast Asian ideograph -E9F1East Asian ideograph not in Unicode -93FBEast Asian ideograph -93FAEast Asian ideograph -9419East Asian ideograph -940DEast Asian ideograph -9426East Asian ideograph -9427East Asian ideograph -9409East Asian ideograph -9414East Asian ideograph -9404East Asian ideograph -9422East Asian ideograph -9406East Asian ideograph -9410East Asian ideograph -9423East Asian ideograph -93F5East Asian ideograph -93F7East Asian ideograph -9407East Asian ideograph -940EEast Asian ideograph -9411East Asian ideograph -943FEast Asian ideograph -9429East Asian ideograph -943DEast Asian ideograph -93F4East Asian ideograph -9436East Asian ideograph -943BEast Asian ideograph -9424East Asian ideograph -9437East Asian ideograph -9440East Asian ideograph -942BEast Asian ideograph -942DEast Asian ideograph -9441East Asian ideograph -9431East Asian ideograph -9467East Asian ideograph -944CEast Asian ideograph -9445East Asian ideograph -9450East Asian ideograph -944AEast Asian ideograph -9466East Asian ideograph -9464East Asian ideograph -9462East Asian ideograph -9465East Asian ideograph -9455East Asian ideograph -945EEast Asian ideograph -946AEast Asian ideograph -946BEast Asian ideograph -946DEast Asian ideograph -946FEast Asian ideograph -9471East Asian ideograph -9477East Asian ideograph -9482East Asian ideograph -9481East Asian ideograph -9585East Asian ideograph -9588East Asian ideograph -958CEast Asian ideograph -9597East Asian ideograph -958EEast Asian ideograph -959FEast Asian ideograph -95A0East Asian ideograph -95ACEast Asian ideograph -95ABEast Asian ideograph -95BCEast Asian ideograph -95BEEast Asian ideograph -95CDEast Asian ideograph -95B9East Asian ideograph -95BAEast Asian ideograph -95B6East Asian ideograph -95BFEast Asian ideograph -95BDEast Asian ideograph -95C9East Asian ideograph -95CEEast Asian ideograph -95D5East Asian ideograph -95D2East Asian ideograph -95D3East Asian ideograph -95D1East Asian ideograph -95C3East Asian ideograph -95DAEast Asian ideograph -95DEEast Asian ideograph -95E0East Asian ideograph -95E5East Asian ideograph -95E4East Asian ideograph -95E7East Asian ideograph -961EEast Asian ideograph -9624East Asian ideograph -9622East Asian ideograph -9627East Asian ideograph -9642East Asian ideograph -963DEast Asian ideograph -963CEast Asian ideograph -9651East Asian ideograph -9660East Asian ideograph -965CEast Asian ideograph -9658East Asian ideograph -965FEast Asian ideograph -9656East Asian ideograph -966CEast Asian ideograph -967BEast Asian ideograph -967FEast Asian ideograph -967EEast Asian ideograph -9684East Asian ideograph -9688East Asian ideograph -9689East Asian ideograph -9682East Asian ideograph -9683East Asian ideograph -9696East Asian ideograph -9697East Asian ideograph -96A4East Asian ideograph -96A9East Asian ideograph -96AEEast Asian ideograph -96B0East Asian ideograph -96B2East Asian ideograph -96B3East Asian ideograph -96B9East Asian ideograph -96BCEast Asian ideograph -96CEEast Asian ideograph -96CAEast Asian ideograph -96D2East Asian ideograph -96DFEast Asian ideograph -96D8East Asian ideograph -96DDEast Asian ideograph -96E9East Asian ideograph -96F1East Asian ideograph -96F0East Asian ideograph -96F4East Asian ideograph -96FAEast Asian ideograph -96F5East Asian ideograph -96FFEast Asian ideograph -9702East Asian ideograph -9708East Asian ideograph -9705East Asian ideograph -971BEast Asian ideograph -971DEast Asian ideograph -9719East Asian ideograph -9723East Asian ideograph -9722East Asian ideograph -9724East Asian ideograph -9728East Asian ideograph -9726East Asian ideograph -9731East Asian ideograph -9730East Asian ideograph -9736East Asian ideograph -9741East Asian ideograph -9747East Asian ideograph -9746East Asian ideograph -9749East Asian ideograph -9758East Asian ideograph -975AEast Asian ideograph -975DEast Asian ideograph -975FEast Asian ideograph -9764East Asian ideograph -9767East Asian ideograph -976BEast Asian ideograph -976EEast Asian ideograph -9777East Asian ideograph -9778East Asian ideograph -9773East Asian ideograph -9783East Asian ideograph -977AEast Asian ideograph -9780East Asian ideograph -9781East Asian ideograph -9784East Asian ideograph -977FEast Asian ideograph -9789East Asian ideograph -9794East Asian ideograph -979BEast Asian ideograph -979FEast Asian ideograph -979AEast Asian ideograph -979CEast Asian ideograph -97ACEast Asian ideograph -97AEEast Asian ideograph -97A8East Asian ideograph -97ABEast Asian ideograph -97A5East Asian ideograph -97B2East Asian ideograph -97B4East Asian ideograph -97B3East Asian ideograph -97B5East Asian ideograph -97B9East Asian ideograph -97B8East Asian ideograph -97BEEast Asian ideograph -97C0East Asian ideograph -97C5East Asian ideograph -97C9East Asian ideograph -97CEEast Asian ideograph -97CDEast Asian ideograph -97D0East Asian ideograph -97D4East Asian ideograph -97D8East Asian ideograph -97D9East Asian ideograph -97DDEast Asian ideograph -97DEEast Asian ideograph -97E0East Asian ideograph -97E1East Asian ideograph -97F5East Asian ideograph -97FAEast Asian ideograph -9807East Asian ideograph -980FEast Asian ideograph -980DEast Asian ideograph -980EEast Asian ideograph -9816East Asian ideograph -9826East Asian ideograph -981EEast Asian ideograph -982BEast Asian ideograph -9820East Asian ideograph -981FEast Asian ideograph -9833East Asian ideograph -982EEast Asian ideograph -982FEast Asian ideograph -9832East Asian ideograph -9847East Asian ideograph -9844East Asian ideograph -9852East Asian ideograph -984BEast Asian ideograph -983FEast Asian ideograph -985CEast Asian ideograph -9859East Asian ideograph -9857East Asian ideograph -9856East Asian ideograph -9862East Asian ideograph -9868East Asian ideograph -9865East Asian ideograph -9866East Asian ideograph -986CEast Asian ideograph -9873East Asian ideograph -9874East Asian ideograph -98ADEast Asian ideograph -98B4East Asian ideograph -98B8East Asian ideograph -98BFEast Asian ideograph -98BBEast Asian ideograph -98C0East Asian ideograph -98C6East Asian ideograph -98E1East Asian ideograph -98E3East Asian ideograph -98E4East Asian ideograph -98E5East Asian ideograph -98F1East Asian ideograph -98EBEast Asian ideograph -9907East Asian ideograph -9902East Asian ideograph -9916East Asian ideograph -9914East Asian ideograph -9917East Asian ideograph -9911East Asian ideograph -9915East Asian ideograph -9924East Asian ideograph -991FEast Asian ideograph -991CEast Asian ideograph -9929East Asian ideograph -9927East Asian ideograph -991AEast Asian ideograph -992EEast Asian ideograph -992CEast Asian ideograph -992AEast Asian ideograph -9933East Asian ideograph -E9729942Variant of 4D5154 which maps to 9942 -9932East Asian ideograph -992BEast Asian ideograph -9931East Asian ideograph -993BEast Asian ideograph -993AEast Asian ideograph -9941East Asian ideograph -9940East Asian ideograph -993CEast Asian ideograph -9948East Asian ideograph -9947East Asian ideograph -9949East Asian ideograph -9943East Asian ideograph -994DEast Asian ideograph -994CEast Asian ideograph -994EEast Asian ideograph -9950East Asian ideograph -9958East Asian ideograph -9954East Asian ideograph -9955East Asian ideograph -E9739957Variant of 475222 which maps to 9957 -995DEast Asian ideograph -995FEast Asian ideograph -9997East Asian ideograph -9998East Asian ideograph -99A3East Asian ideograph -99A1East Asian ideograph -99A6East Asian ideograph -99A9East Asian ideograph -99AAEast Asian ideograph -99B5East Asian ideograph -99BFEast Asian ideograph -99BCEast Asian ideograph -99C3East Asian ideograph -99B9East Asian ideograph -99BDEast Asian ideograph -99D3East Asian ideograph -99D4East Asian ideograph -99C9East Asian ideograph -99D8East Asian ideograph -99ECEast Asian ideograph -99F0East Asian ideograph -99E3East Asian ideograph -99EAEast Asian ideograph -9A02East Asian ideograph -99F8East Asian ideograph -99F4East Asian ideograph -99FBEast Asian ideograph -99FDEast Asian ideograph -9A0FEast Asian ideograph -9A0BEast Asian ideograph -9A09East Asian ideograph -9A04East Asian ideograph -9A11East Asian ideograph -9A05East Asian ideograph -9A10East Asian ideograph -9A24East Asian ideograph -9A22East Asian ideograph -9A20East Asian ideograph -9A27East Asian ideograph -9A2FEast Asian ideograph -9A38East Asian ideograph -9A2DEast Asian ideograph -9A35East Asian ideograph -9A32East Asian ideograph -9A36East Asian ideograph -9A2EEast Asian ideograph -9A41East Asian ideograph -9A3BEast Asian ideograph -9A42East Asian ideograph -9A44East Asian ideograph -9A48East Asian ideograph -9A4CEast Asian ideograph -9A4DEast Asian ideograph -9A52East Asian ideograph -9A4AEast Asian ideograph -9A58East Asian ideograph -9A56East Asian ideograph -9A64East Asian ideograph -9A66East Asian ideograph -9A6BEast Asian ideograph -9AADEast Asian ideograph -9AABEast Asian ideograph -9AB1East Asian ideograph -9AB3East Asian ideograph -9AB6East Asian ideograph -9ABBEast Asian ideograph -9ABAEast Asian ideograph -9ABDEast Asian ideograph -9AC1East Asian ideograph -9AC0East Asian ideograph -9AC2East Asian ideograph -9AC8East Asian ideograph -9AD0East Asian ideograph -9AD1East Asian ideograph -9AD6East Asian ideograph -9ADCEast Asian ideograph -9ADFEast Asian ideograph -9AE0East Asian ideograph -9AE2East Asian ideograph -9AE7East Asian ideograph -9AEBEast Asian ideograph -9AF2East Asian ideograph -9AEFEast Asian ideograph -9AF9East Asian ideograph -9AFDEast Asian ideograph -9B01East Asian ideograph -9B02East Asian ideograph -9B00East Asian ideograph -9B08East Asian ideograph -9B04East Asian ideograph -9B05East Asian ideograph -9B0BEast Asian ideograph -9B0EEast Asian ideograph -9B11East Asian ideograph -9B10East Asian ideograph -9B18East Asian ideograph -9B1DEast Asian ideograph -9B1FEast Asian ideograph -9B23East Asian ideograph -9B29East Asian ideograph -9B2DEast Asian ideograph -E9F2East Asian ideograph not in Unicode -9B2FEast Asian ideograph -9B34East Asian ideograph -9B35East Asian ideograph -9B37East Asian ideograph -9B43East Asian ideograph -9B48East Asian ideograph -9B4EEast Asian ideograph -9B4DEast Asian ideograph -9B4BEast Asian ideograph -9B51East Asian ideograph -9B74East Asian ideograph -9B68East Asian ideograph -9B80East Asian ideograph -9B8CEast Asian ideograph -9B95East Asian ideograph -9B7DEast Asian ideograph -9B83East Asian ideograph -9B8EEast Asian ideograph -9B90East Asian ideograph -9B93East Asian ideograph -9B97East Asian ideograph -9B92East Asian ideograph -9B98East Asian ideograph -9B9FEast Asian ideograph -9B9DEast Asian ideograph -9BADEast Asian ideograph -9B9AEast Asian ideograph -9BA8East Asian ideograph -9B9EEast Asian ideograph -9B99East Asian ideograph -9B86East Asian ideograph -9BA0East Asian ideograph -9BC7East Asian ideograph -9BD2East Asian ideograph -9BC6East Asian ideograph -9BBFEast Asian ideograph -9BC1East Asian ideograph -9BB9East Asian ideograph -9BBBEast Asian ideograph -9BD3East Asian ideograph -9BC0East Asian ideograph -9BC8East Asian ideograph -9BD7East Asian ideograph -9BD6East Asian ideograph -9BEBEast Asian ideograph -9BD5East Asian ideograph -9BE4East Asian ideograph -9BF1East Asian ideograph -9BE1East Asian ideograph -9BDBEast Asian ideograph -9BE2East Asian ideograph -9BF0East Asian ideograph -9BD4East Asian ideograph -9BFFEast Asian ideograph -9C06East Asian ideograph -9C15East Asian ideograph -9C0AEast Asian ideograph -9C08East Asian ideograph -9C14East Asian ideograph -9C04East Asian ideograph -9C02East Asian ideograph -9C10East Asian ideograph -9C12East Asian ideograph -9C09East Asian ideograph -9C1CEast Asian ideograph -9C2FEast Asian ideograph -9C23East Asian ideograph -9C2EEast Asian ideograph -9C28East Asian ideograph -9C21East Asian ideograph -9C24East Asian ideograph -9C46East Asian ideograph -9C32East Asian ideograph -9C44East Asian ideograph -9C48East Asian ideograph -9C39East Asian ideograph -9C33East Asian ideograph -9C47East Asian ideograph -9C35East Asian ideograph -9C37East Asian ideograph -9C52East Asian ideograph -9C58East Asian ideograph -9C51East Asian ideograph -9C63East Asian ideograph -9C67East Asian ideograph -9C5FEast Asian ideograph -9C60East Asian ideograph -9C6DEast Asian ideograph -9C68East Asian ideograph -9C6FEast Asian ideograph -9C6EEast Asian ideograph -9C7AEast Asian ideograph -9CE7East Asian ideograph -9CF0East Asian ideograph -9CF2East Asian ideograph -9D02East Asian ideograph -9D03East Asian ideograph -9CF7East Asian ideograph -9D04East Asian ideograph -9D07East Asian ideograph -9CF8East Asian ideograph -9D2AEast Asian ideograph -9D25East Asian ideograph -9D1EEast Asian ideograph -9D1DEast Asian ideograph -9D1FEast Asian ideograph -9D41East Asian ideograph -9D36East Asian ideograph -9D3EEast Asian ideograph -9D30East Asian ideograph -9D42East Asian ideograph -9D40East Asian ideograph -9D3DEast Asian ideograph -9D5CEast Asian ideograph -9D53East Asian ideograph -9D59East Asian ideograph -9D5AEast Asian ideograph -9D52East Asian ideograph -9D77East Asian ideograph -9D8AEast Asian ideograph -9D7AEast Asian ideograph -9D87East Asian ideograph -9D78East Asian ideograph -9D7EEast Asian ideograph -9D69East Asian ideograph -9D7BEast Asian ideograph -9D83East Asian ideograph -9D6FEast Asian ideograph -9DA9East Asian ideograph -9D92East Asian ideograph -9D98East Asian ideograph -9DA4East Asian ideograph -9DAAEast Asian ideograph -9DA1East Asian ideograph -9D9AEast Asian ideograph -9D96East Asian ideograph -9DB1East Asian ideograph -9DB6East Asian ideograph -9DBCEast Asian ideograph -9DC0East Asian ideograph -9DC1East Asian ideograph -9DB8East Asian ideograph -9DBAEast Asian ideograph -9DCFEast Asian ideograph -9DC7East Asian ideograph -9DC3East Asian ideograph -9DBBEast Asian ideograph -9DB9East Asian ideograph -9DACEast Asian ideograph -9DB2East Asian ideograph -9DDFEast Asian ideograph -9DD9East Asian ideograph -9DD6East Asian ideograph -9DDEEast Asian ideograph -9DE9East Asian ideograph -9DF2East Asian ideograph -9DF8East Asian ideograph -9DFCEast Asian ideograph -9DEBEast Asian ideograph -9DEFEast Asian ideograph -9DEDEast Asian ideograph -9DE6East Asian ideograph -9DEEEast Asian ideograph -9E07East Asian ideograph -9DFDEast Asian ideograph -9E0EEast Asian ideograph -9E11East Asian ideograph -9E15East Asian ideograph -9E18East Asian ideograph -9E1CEast Asian ideograph -9E1BEast Asian ideograph -9E1DEast Asian ideograph -9E75East Asian ideograph -9E7AEast Asian ideograph -9E7BEast Asian ideograph -9E80East Asian ideograph -9E83East Asian ideograph -9E84East Asian ideograph -9E88East Asian ideograph -9E87East Asian ideograph -9E90East Asian ideograph -9E8CEast Asian ideograph -9E95East Asian ideograph -9E91East Asian ideograph -9E9BEast Asian ideograph -9E9EEast Asian ideograph -9EADEast Asian ideograph -9EAFEast Asian ideograph -9EB0East Asian ideograph -9EC1East Asian ideograph -9EC6East Asian ideograph -9EC8East Asian ideograph -9ECCEast Asian ideograph -9ED0East Asian ideograph -9ED3East Asian ideograph -9EDAEast Asian ideograph -9EDFEast Asian ideograph -9EE3East Asian ideograph -9EE5East Asian ideograph -9EE7East Asian ideograph -9EEEEast Asian ideograph -9EF0East Asian ideograph -9EF6East Asian ideograph -9EF9East Asian ideograph -9EFBEast Asian ideograph -9EFCEast Asian ideograph -9EFDEast Asian ideograph -E9F3East Asian ideograph not in Unicode -9EFFEast Asian ideograph -9F02East Asian ideograph -9F0FEast Asian ideograph -9F10East Asian ideograph -9F12East Asian ideograph -9F16East Asian ideograph -9F17East Asian ideograph -9F1AEast Asian ideograph -9F22East Asian ideograph -9F2BEast Asian ideograph -9F26East Asian ideograph -9F2FEast Asian ideograph -9F39East Asian ideograph -9F37East Asian ideograph -9F3DEast Asian ideograph -9F41East Asian ideograph -9F45East Asian ideograph -9F46East Asian ideograph -9F48East Asian ideograph -9F49East Asian ideograph -9F4EEast Asian ideograph -9F4FEast Asian ideograph -9F54East Asian ideograph -9F55East Asian ideograph -9F57East Asian ideograph -9F60East Asian ideograph -9F6EEast Asian ideograph -9F6FEast Asian ideograph -9F76East Asian ideograph -9F8EEast Asian ideograph -9F93East Asian ideograph -9F95East Asian ideograph -9FA0East Asian ideograph -9FA5East Asian ideograph -9FA4East Asian ideograph -5E76East Asian ideograph -5E72East Asian ideograph -4E71East Asian ideograph -4E9AEast Asian ideograph -5E03East Asian ideograph -5360East Asian ideograph -6765East Asian ideograph -4ED1East Asian ideograph -4FA0East Asian ideograph -E901Duplicate simplified ideograph -4ED3East Asian ideograph -4EECEast Asian ideograph -4FE9East Asian ideograph -4E2AEast Asian ideograph -4F25East Asian ideograph -4F26East Asian ideograph -E902Duplicate simplified ideograph -4F1FEast Asian ideograph -4FA7East Asian ideograph -4FA6East Asian ideograph -5BB6East Asian ideograph -5907East Asian ideograph -6770East Asian ideograph -4F27East Asian ideograph -4F1EEast Asian ideograph -4F20East Asian ideograph -503AEast Asian ideograph -4EC5East Asian ideograph -503EEast Asian ideograph -4F24East Asian ideograph -4FA5East Asian ideograph -4EC6East Asian ideograph -4F2AEast Asian ideograph -8C61East Asian ideograph -4FA8East Asian ideograph -4EEAEast Asian ideograph -4EBFEast Asian ideograph -4EF7East Asian ideograph -4FACEast Asian ideograph -4FA9East Asian ideograph -4FEDEast Asian ideograph -50A7East Asian ideograph -E903Duplicate simplified ideograph -4FE6East Asian ideograph -4F18East Asian ideograph -507FEast Asian ideograph -50A8East Asian ideograph -4FEAEast Asian ideograph -4FE8East Asian ideograph -51F6East Asian ideograph -513FEast Asian ideograph -5156East Asian ideograph -4E24East Asian ideograph -51BBEast Asian ideograph -51EFEast Asian ideograph -514BEast Asian ideograph -5219East Asian ideograph -521AEast Asian ideograph -5240East Asian ideograph -521BEast Asian ideograph -5212East Asian ideograph -5267East Asian ideograph -5251East Asian ideograph -5218East Asian ideograph -5242East Asian ideograph -52B2East Asian ideograph -52A1East Asian ideograph -52A8East Asian ideograph -52B3East Asian ideograph -52CBEast Asian ideograph -80DCEast Asian ideograph -52BFEast Asian ideograph -52B1East Asian ideograph -529DEast Asian ideograph -6C47East Asian ideograph -532EEast Asian ideograph -533AEast Asian ideograph -5346East Asian ideograph -534FEast Asian ideograph -538CEast Asian ideograph -5389East Asian ideograph -53C2East Asian ideograph -4E1BEast Asian ideograph -5458East Asian ideograph -95EEEast Asian ideograph -54D1East Asian ideograph -4E27East Asian ideograph -5355East Asian ideograph -5524East Asian ideograph -4E54East Asian ideograph -54DFEast Asian ideograph -556CEast Asian ideograph -5417East Asian ideograph -545CEast Asian ideograph -545BEast Asian ideograph -5567East Asian ideograph -53F9East Asian ideograph -5455East Asian ideograph -5C1DEast Asian ideograph -55BDEast Asian ideograph -5520East Asian ideograph -5578East Asian ideograph -5480East Asian ideograph -53FDEast Asian ideograph -5428East Asian ideograph -55B7East Asian ideograph -E904Duplicate simplified ideograph -54DDEast Asian ideograph -55F3East Asian ideograph -549BEast Asian ideograph -5413East Asian ideograph -565CEast Asian ideograph -5411East Asian ideograph -5499East Asian ideograph -4E25East Asian ideograph -5624East Asian ideograph -556DEast Asian ideograph -55EBEast Asian ideograph -56A3East Asian ideograph -E905Duplicate simplified ideograph -5453East Asian ideograph -5631East Asian ideograph -56EFEast Asian ideograph -56F4East Asian ideograph -56EDEast Asian ideograph -5706East Asian ideograph -56E2East Asian ideograph -56FEEast Asian ideograph -6267East Asian ideograph -57A9East Asian ideograph -62A5East Asian ideograph -5C27East Asian ideograph -573AEast Asian ideograph -6D82East Asian ideograph -575EEast Asian ideograph -5757East Asian ideograph -5C18East Asian ideograph -57ABEast Asian ideograph -5811East Asian ideograph -575FEast Asian ideograph -5760East Asian ideograph -5815East Asian ideograph -575BEast Asian ideograph -57A6East Asian ideograph -538BEast Asian ideograph -5739East Asian ideograph -5792East Asian ideograph -5784East Asian ideograph -574FEast Asian ideograph -575CEast Asian ideograph -575DEast Asian ideograph -58EEEast Asian ideograph -58F6East Asian ideograph -5BFFEast Asian ideograph -4F19East Asian ideograph -68A6East Asian ideograph -5939East Asian ideograph -5941East Asian ideograph -593AEast Asian ideograph -594BEast Asian ideograph -5986East Asian ideograph -5987East Asian ideograph -5A04East Asian ideograph -5988East Asian ideograph -59AAEast Asian ideograph -5A34East Asian ideograph -5A75East Asian ideograph -5A07East Asian ideograph -59A9East Asian ideograph -5AD4East Asian ideograph -5A74East Asian ideograph -5A76East Asian ideograph -5B59East Asian ideograph -5B5AEast Asian ideograph -5B66East Asian ideograph -5B6AEast Asian ideograph -5BDDEast Asian ideograph -5B9EEast Asian ideograph -5B81East Asian ideograph -5BBDEast Asian ideograph -5BA1East Asian ideograph -5199East Asian ideograph -5BA0East Asian ideograph -5B9DEast Asian ideograph -4E13East Asian ideograph -5C06East Asian ideograph -5BFBEast Asian ideograph -5BF9East Asian ideograph -5BFCEast Asian ideograph -5C34East Asian ideograph -5C61East Asian ideograph -5C42East Asian ideograph -5C5EEast Asian ideograph -5188East Asian ideograph -5CE1East Asian ideograph -5C9BEast Asian ideograph -5C9AEast Asian ideograph -5D2DEast Asian ideograph -5C96East Asian ideograph -5C7FEast Asian ideograph -5CB3East Asian ideograph -5CE6East Asian ideograph -5DC5East Asian ideograph -5CA9East Asian ideograph -5E05East Asian ideograph -5E08East Asian ideograph -5E10East Asian ideograph -5E26East Asian ideograph -5E27East Asian ideograph -5E3CEast Asian ideograph -5E01East Asian ideograph -5E1CEast Asian ideograph -5E2EEast Asian ideograph -51E0East Asian ideograph -5E93East Asian ideograph -5750East Asian ideograph -5395East Asian ideograph -5E9FEast Asian ideograph -5E7FEast Asian ideograph -5E99East Asian ideograph -5382East Asian ideograph -5E9EEast Asian ideograph -5E90East Asian ideograph -5385East Asian ideograph -5F20East Asian ideograph -5F39East Asian ideograph -5F25East Asian ideograph -5F2FEast Asian ideograph -E906Duplicate simplified ideograph -540EEast Asian ideograph -5F84East Asian ideograph -4ECEEast Asian ideograph -590DEast Asian ideograph -5F7BEast Asian ideograph -5F81East Asian ideograph -5FF0East Asian ideograph -95F7East Asian ideograph -6005East Asian ideograph -6076East Asian ideograph -60ECEast Asian ideograph -607BEast Asian ideograph -7231East Asian ideograph -607CEast Asian ideograph -6001East Asian ideograph -5FFEEast Asian ideograph -6006East Asian ideograph -5E86East Asian ideograph -60EDEast Asian ideograph -5FE7East Asian ideograph -8651East Asian ideograph -60E8East Asian ideograph -60EFEast Asian ideograph -6078East Asian ideograph -6002East Asian ideograph -6B32East Asian ideograph -5BAAEast Asian ideograph -51EDEast Asian ideograph -60AFEast Asian ideograph -6124East Asian ideograph -60EEEast Asian ideograph -6187East Asian ideograph -60EBEast Asian ideograph -5FC6East Asian ideograph -5E94East Asian ideograph -601CEast Asian ideograph -6073East Asian ideograph -6000East Asian ideograph -61D2East Asian ideograph -60ACEast Asian ideograph -5FCFEast Asian ideograph -6151East Asian ideograph -60E7East Asian ideograph -604BEast Asian ideograph -6218East Asian ideograph -620FEast Asian ideograph -631FEast Asian ideograph -5377East Asian ideograph -626BEast Asian ideograph -626AEast Asian ideograph -6302East Asian ideograph -62A1East Asian ideograph -62E3East Asian ideograph -626CEast Asian ideograph -6325East Asian ideograph -635FEast Asian ideograph -6363East Asian ideograph -62A2East Asian ideograph -5C4FEast Asian ideograph -631AEast Asian ideograph -6402East Asian ideograph -63B4East Asian ideograph -635EEast Asian ideograph -62E8East Asian ideograph -6320East Asian ideograph -6251East Asian ideograph -629AEast Asian ideograph -62E5East Asian ideograph -51FBEast Asian ideograph -631EEast Asian ideograph -6321East Asian ideograph -636EEast Asian ideograph -63B3East Asian ideograph -62E9East Asian ideograph -62C5East Asian ideograph -6361East Asian ideograph -6324East Asian ideograph -62E7East Asian ideograph -62DFEast Asian ideograph -6401East Asian ideograph -6269East Asian ideograph -63B7East Asian ideograph -64B5East Asian ideograph -6270East Asian ideograph -64DEEast Asian ideograph -6446East Asian ideograph -62E2East Asian ideograph -62E6East Asian ideograph -6400East Asian ideograph -6444East Asian ideograph -631BEast Asian ideograph -644AEast Asian ideograph -6405East Asian ideograph -63FDEast Asian ideograph -8D25East Asian ideograph -542FEast Asian ideograph -654CEast Asian ideograph -6570East Asian ideograph -655BEast Asian ideograph -6BD9East Asian ideograph -65A9East Asian ideograph -65ADEast Asian ideograph -65F6East Asian ideograph -663CEast Asian ideograph -6656East Asian ideograph -6655East Asian ideograph -7545East Asian ideograph -6682East Asian ideograph -6653East Asian ideograph -E907Duplicate simplified ideograph -66A7East Asian ideograph -65F7East Asian ideograph -4E66East Asian ideograph -4F1AEast Asian ideograph -80E7East Asian ideograph -4E1CEast Asian ideograph -6761East Asian ideograph -67ADEast Asian ideograph -6800East Asian ideograph -5F03East Asian ideograph -6816East Asian ideograph -680BEast Asian ideograph -6808East Asian ideograph -67A3East Asian ideograph -832DEast Asian ideograph -6781East Asian ideograph -6768East Asian ideograph -6862East Asian ideograph -4E1AEast Asian ideograph -67ABEast Asian ideograph -8363East Asian ideograph -6784East Asian ideograph -67AAEast Asian ideograph -6837East Asian ideograph -6869East Asian ideograph -6807East Asian ideograph -67A2East Asian ideograph -697CEast Asian ideograph -6868East Asian ideograph -4E50East Asian ideograph -679EEast Asian ideograph -692DEast Asian ideograph -6811East Asian ideograph -6866East Asian ideograph -6734East Asian ideograph -6865East Asian ideograph -673AEast Asian ideograph -6863East Asian ideograph -68C0East Asian ideograph -6867East Asian ideograph -67E0East Asian ideograph -69DFEast Asian ideograph -67DCEast Asian ideograph -69DBEast Asian ideograph -6988East Asian ideograph -691FEast Asian ideograph -6809East Asian ideograph -6A79East Asian ideograph -680FEast Asian ideograph -6A31East Asian ideograph -6743East Asian ideograph -6984East Asian ideograph -94A6East Asian ideograph -E908Duplicate simplified ideograph -6B27East Asian ideograph -6B24East Asian ideograph -6B22East Asian ideograph -5C81East Asian ideograph -5386East Asian ideograph -5F52East Asian ideograph -6B8BEast Asian ideograph -6B87East Asian ideograph -6B93East Asian ideograph -6BA1East Asian ideograph -6B7CEast Asian ideograph -6740East Asian ideograph -58F3East Asian ideograph -6BB4East Asian ideograph -6C14East Asian ideograph -6C22East Asian ideograph -6CFEEast Asian ideograph -6CEAEast Asian ideograph -6D45East Asian ideograph -6E0AEast Asian ideograph -6CA6East Asian ideograph -6D8CEast Asian ideograph -6C64East Asian ideograph -6D4BEast Asian ideograph -6DA1East Asian ideograph -6D51East Asian ideograph -6C9FEast Asian ideograph -6C85East Asian ideograph -706DEast Asian ideograph -6E7FEast Asian ideograph -6CA7East Asian ideograph -51C6East Asian ideograph -6CAAEast Asian ideograph -6E0DEast Asian ideograph -6DA8East Asian ideograph -6C49East Asian ideograph -6EE1East Asian ideograph -6D9FEast Asian ideograph -6E10East Asian ideograph -6EDEEast Asian ideograph -6D46East Asian ideograph -6E17East Asian ideograph -6E14East Asian ideograph -6CFCEast Asian ideograph -6DA6East Asian ideograph -6DA7East Asian ideograph -6D01East Asian ideograph -6D47East Asian ideograph -6E83East Asian ideograph -6DC0East Asian ideograph -6D53East Asian ideograph -6CFDEast Asian ideograph -6D4AEast Asian ideograph -6D4EEast Asian ideograph -6CDEEast Asian ideograph -6EE8East Asian ideograph -6EE5East Asian ideograph -6D9BEast Asian ideograph -6DA9East Asian ideograph -6C88East Asian ideograph -6CFBEast Asian ideograph -6E0EEast Asian ideograph -6E85East Asian ideograph -6EE4East Asian ideograph -6D4FEast Asian ideograph -6FD1East Asian ideograph -6CA5East Asian ideograph -6FD2East Asian ideograph -6F47East Asian ideograph -6F9CEast Asian ideograph -6D12East Asian ideograph -6EE9East Asian ideograph -6E7EEast Asian ideograph -6EE6East Asian ideograph -707EEast Asian ideograph -4E3AEast Asian ideograph -4E4CEast Asian ideograph -65E0East Asian ideograph -70BCEast Asian ideograph -70E6East Asian ideograph -7080East Asian ideograph -6247East Asian ideograph -70EDEast Asian ideograph -70EBEast Asian ideograph -70BDEast Asian ideograph -7096East Asian ideograph -706FEast Asian ideograph -7116East Asian ideograph -70E7East Asian ideograph -8425East Asian ideograph -70DBEast Asian ideograph -707FEast Asian ideograph -70E9East Asian ideograph -70C1East Asian ideograph -7089East Asian ideograph -70C2East Asian ideograph -7237East Asian ideograph -5C14East Asian ideograph -5899East Asian ideograph -724DEast Asian ideograph -5B83East Asian ideograph -7275East Asian ideograph -8366East Asian ideograph -728AEast Asian ideograph -727AEast Asian ideograph -72B6East Asian ideograph -72EDEast Asian ideograph -72C8East Asian ideograph -72B9East Asian ideograph -72F1East Asian ideograph -72EFEast Asian ideograph -72EEEast Asian ideograph -72ECEast Asian ideograph -72DEEast Asian ideograph -83B7East Asian ideograph -72B7East Asian ideograph -517DEast Asian ideograph -730EEast Asian ideograph -736DEast Asian ideograph -732EEast Asian ideograph -7321East Asian ideograph -73B0East Asian ideograph -73F2East Asian ideograph -739BEast Asian ideograph -7410East Asian ideograph -7391East Asian ideograph -73AFEast Asian ideograph -7477East Asian ideograph -73BAEast Asian ideograph -73D1East Asian ideograph -74EFEast Asian ideograph -4EA7East Asian ideograph -4EA9East Asian ideograph -7544East Asian ideograph -6BD5East Asian ideograph -5F02East Asian ideograph -753BEast Asian ideograph -5F53East Asian ideograph -7574East Asian ideograph -8FEDEast Asian ideograph -75C9East Asian ideograph -75A1East Asian ideograph -759FEast Asian ideograph -75EAEast Asian ideograph -75AFEast Asian ideograph -75AEEast Asian ideograph -75E8East Asian ideograph -7597East Asian ideograph -75A0East Asian ideograph -75D2East Asian ideograph -765EEast Asian ideograph -763EEast Asian ideograph -7663East Asian ideograph -762BEast Asian ideograph -766BEast Asian ideograph -53D1East Asian ideograph -7691East Asian ideograph -76B1East Asian ideograph -76CFEast Asian ideograph -5C3DEast Asian ideograph -76D1East Asian ideograph -76D8East Asian ideograph -5362East Asian ideograph -4F17East Asian ideograph -56F0East Asian ideograph -7750East Asian ideograph -4E86East Asian ideograph -77A9East Asian ideograph -77EBEast Asian ideograph -781AEast Asian ideograph -7815East Asian ideograph -7855East Asian ideograph -786EEast Asian ideograph -7801East Asian ideograph -7816East Asian ideograph -77F6East Asian ideograph -7840East Asian ideograph -788DEast Asian ideograph -77FFEast Asian ideograph -77FEEast Asian ideograph -783AEast Asian ideograph -783EEast Asian ideograph -E909Duplicate simplified ideograph -7978East Asian ideograph -796FEast Asian ideograph -7985East Asian ideograph -793CEast Asian ideograph -7977East Asian ideograph -4E07East Asian ideograph -53B6East Asian ideograph -5E0CEast Asian ideograph -79F0East Asian ideograph -79CDEast Asian ideograph -8C37East Asian ideograph -79EFEast Asian ideograph -7A23East Asian ideograph -7A51East Asian ideograph -79FDEast Asian ideograph -E90ADuplicate simplified ideograph -7A33East Asian ideograph -6D3CEast Asian ideograph -7A9DEast Asian ideograph -7A77East Asian ideograph -7AA5East Asian ideograph -7A8DEast Asian ideograph -7A9CEast Asian ideograph -7AA6East Asian ideograph -7A83East Asian ideograph -7ADEEast Asian ideograph -E90BDuplicate simplified ideograph -7B14East Asian ideograph -7B0BEast Asian ideograph -8345East Asian ideograph -94B3East Asian ideograph -7B3AEast Asian ideograph -8303East Asian ideograph -8282East Asian ideograph -7BACEast Asian ideograph -7B03East Asian ideograph -7B51East Asian ideograph -7B5BEast Asian ideograph -7BD3East Asian ideograph -7B80East Asian ideograph -7BABEast Asian ideograph -7BAAEast Asian ideograph -7BD1East Asian ideograph -5E18East Asian ideograph -7B7EEast Asian ideograph -7BEEEast Asian ideograph -7B79East Asian ideograph -7B3CEast Asian ideograph -7C41East Asian ideograph -E90CDuplicate simplified ideograph -7BF1East Asian ideograph -7BA9East Asian ideograph -5401East Asian ideograph -7C8BEast Asian ideograph -E90DDuplicate simplified ideograph -7CAAEast Asian ideograph -7CAEEast Asian ideograph -7EA0East Asian ideograph -7EAAEast Asian ideograph -7EA3East Asian ideograph -7EA2East Asian ideograph -7EABEast Asian ideograph -7EA6East Asian ideograph -7EA5East Asian ideograph -7EBAEast Asian ideograph -7EB9East Asian ideograph -7EADEast Asian ideograph -7EB0East Asian ideograph -7EAFEast Asian ideograph -7EBDEast Asian ideograph -7EB1East Asian ideograph -7EB3East Asian ideograph -7EA7East Asian ideograph -7EB8East Asian ideograph -7EB7East Asian ideograph -7ECAEast Asian ideograph -7ECBEast Asian ideograph -624EEast Asian ideograph -7ECDEast Asian ideograph -7EC4East Asian ideograph -7EC6East Asian ideograph -7EC5East Asian ideograph -7ECCEast Asian ideograph -7EC8East Asian ideograph -7EDFEast Asian ideograph -7EDEEast Asian ideograph -7ED2East Asian ideograph -7ED3East Asian ideograph -7EDAEast Asian ideograph -7EDDEast Asian ideograph -7EDCEast Asian ideograph -7ED9East Asian ideograph -4E1DEast Asian ideograph -7ECFEast Asian ideograph -6346East Asian ideograph -7EE2East Asian ideograph -7EE5East Asian ideograph -7ED1East Asian ideograph -7EFCEast Asian ideograph -7EFDEast Asian ideograph -7EFEEast Asian ideograph -7D27East Asian ideograph -7EEBEast Asian ideograph -7F00East Asian ideograph -7F51East Asian ideograph -7EB2East Asian ideograph -7EF0East Asian ideograph -7EFFEast Asian ideograph -7EF8East Asian ideograph -7EF4East Asian ideograph -7EF5East Asian ideograph -7EB6East Asian ideograph -7F01East Asian ideograph -7F14East Asian ideograph -7EACEast Asian ideograph -7EC3East Asian ideograph -7EEAEast Asian ideograph -7F04East Asian ideograph -7F05East Asian ideograph -7F09East Asian ideograph -7F13East Asian ideograph -7F18East Asian ideograph -7F16East Asian ideograph -7EBFEast Asian ideograph -7F0DEast Asian ideograph -7F0EEast Asian ideograph -7F23East Asian ideograph -7F22East Asian ideograph -8426East Asian ideograph -7F1AEast Asian ideograph -81F4East Asian ideograph -E97453BFVariant of 455164 which maps to 53BF -7F29East Asian ideograph -7EE9East Asian ideograph -7F2AEast Asian ideograph -7F15East Asian ideograph -7F27East Asian ideograph -7F1DEast Asian ideograph -603BEast Asian ideograph -7EB5East Asian ideograph -7F2BEast Asian ideograph -7F2EEast Asian ideograph -7EC7East Asian ideograph -7EE3East Asian ideograph -7ED5East Asian ideograph -7F2DEast Asian ideograph -E90EDuplicate simplified ideograph -7EF3East Asian ideograph -8327East Asian ideograph -7ECEEast Asian ideograph -7ED8East Asian ideograph -8FABEast Asian ideograph -7F24East Asian ideograph -7EE7East Asian ideograph -7F20East Asian ideograph -7EEDEast Asian ideograph -7F28East Asian ideograph -7EA4East Asian ideograph -7F06East Asian ideograph -7F5AEast Asian ideograph -9A82East Asian ideograph -7F62East Asian ideograph -7F57East Asian ideograph -7F81East Asian ideograph -4E49East Asian ideograph -4E60East Asian ideograph -7FC6East Asian ideograph -7FD8East Asian ideograph -5723East Asian ideograph -95FBEast Asian ideograph -58F0East Asian ideograph -8038East Asian ideograph -806AEast Asian ideograph -8054East Asian ideograph -804CEast Asian ideograph -8042East Asian ideograph -804BEast Asian ideograph -542CEast Asian ideograph -8083East Asian ideograph -80C1East Asian ideograph -8090East Asian ideograph -8109East Asian ideograph -80BEEast Asian ideograph -80C0East Asian ideograph -80A0East Asian ideograph -80BFEast Asian ideograph -8111East Asian ideograph -80F6East Asian ideograph -80A4East Asian ideograph -817BEast Asian ideograph -8113East Asian ideograph -80C6East Asian ideograph -8138East Asian ideograph -810DEast Asian ideograph -8110East Asian ideograph -8191East Asian ideograph -814AEast Asian ideograph -80EAEast Asian ideograph -E90FDuplicate simplified ideograph -4E34East Asian ideograph -53F0East Asian ideograph -4E0EEast Asian ideograph -5174East Asian ideograph -4E3EEast Asian ideograph -65E7East Asian ideograph -8231East Asian ideograph -8230East Asian ideograph -8270East Asian ideograph -E910Duplicate simplified ideograph -520DEast Asian ideograph -835AEast Asian ideograph -830EEast Asian ideograph -82CBEast Asian ideograph -5E84East Asian ideograph -534EEast Asian ideograph -83B1East Asian ideograph -82C7East Asian ideograph -53F6East Asian ideograph -E911Duplicate simplified ideograph -8364East Asian ideograph -83B4East Asian ideograph -5E2DEast Asian ideograph -836AEast Asian ideograph -82CEEast Asian ideograph -82CDEast Asian ideograph -8298East Asian ideograph -83B2East Asian ideograph -836BEast Asian ideograph -848BEast Asian ideograph -535CEast Asian ideograph -8361East Asian ideograph -829CEast Asian ideograph -8427East Asian ideograph -59DCEast Asian ideograph -8537East Asian ideograph -84DDEast Asian ideograph -8428East Asian ideograph -501FEast Asian ideograph -827AEast Asian ideograph -85AEEast Asian ideograph -836FEast Asian ideograph -853CEast Asian ideograph -853AEast Asian ideograph -82A6East Asian ideograph -82F9East Asian ideograph -82CFEast Asian ideograph -8574East Asian ideograph -5170East Asian ideograph -85D3East Asian ideograph -841DEast Asian ideograph -4E47East Asian ideograph -5904East Asian ideograph -864FEast Asian ideograph -53F7East Asian ideograph -4E8FEast Asian ideograph -65E6East Asian ideograph -8680East Asian ideograph -E912Duplicate simplified ideograph -867EEast Asian ideograph -8424East Asian ideograph -8682East Asian ideograph -877CEast Asian ideograph -86F2East Asian ideograph -866BEast Asian ideograph -8749East Asian ideograph -8681East Asian ideograph -8747East Asian ideograph -86CEEast Asian ideograph -8721East Asian ideograph -86CAEast Asian ideograph -8695East Asian ideograph -86EEEast Asian ideograph -672EEast Asian ideograph -4E8DEast Asian ideograph -536BEast Asian ideograph -E913Duplicate simplified ideograph -8865East Asian ideograph -91CCEast Asian ideograph -88C5East Asian ideograph -5236East Asian ideograph -8934East Asian ideograph -88E4East Asian ideograph -4EB5East Asian ideograph -891BEast Asian ideograph -88C6East Asian ideograph -8884East Asian ideograph -889CEast Asian ideograph -886CEast Asian ideograph -88ADEast Asian ideograph -89C1East Asian ideograph -89C4East Asian ideograph -89C5East Asian ideograph -89C6East Asian ideograph -4EB2East Asian ideograph -89CEEast Asian ideograph -89CAEast Asian ideograph -89D0East Asian ideograph -89C9East Asian ideograph -89C8East Asian ideograph -89C2East Asian ideograph -89DEEast Asian ideograph -8BA1East Asian ideograph -8BA2East Asian ideograph -8BA3East Asian ideograph -8BA6East Asian ideograph -8BB0East Asian ideograph -8BA8East Asian ideograph -8BA7East Asian ideograph -8BAAEast Asian ideograph -8BAFEast Asian ideograph -8BABEast Asian ideograph -8BADEast Asian ideograph -8BBFEast Asian ideograph -8BC0East Asian ideograph -8BB6East Asian ideograph -8BB7East Asian ideograph -8BB8East Asian ideograph -8BBEEast Asian ideograph -8BB9East Asian ideograph -8BBCEast Asian ideograph -6CE8East Asian ideograph -8BC4East Asian ideograph -8BCDEast Asian ideograph -8BC2East Asian ideograph -8BCFEast Asian ideograph -8BC5East Asian ideograph -8BC8East Asian ideograph -8BCBEast Asian ideograph -8BC9East Asian ideograph -8BCAEast Asian ideograph -8BE7East Asian ideograph -8BE5East Asian ideograph -8BE6East Asian ideograph -8BD5East Asian ideograph -8BD7East Asian ideograph -8BD8East Asian ideograph -8BE3East Asian ideograph -8BD9East Asian ideograph -8BDAEast Asian ideograph -5938East Asian ideograph -8BDBEast Asian ideograph -8BE1East Asian ideograph -8BE2East Asian ideograph -8BDDEast Asian ideograph -8BE0East Asian ideograph -8BDFEast Asian ideograph -8BF4East Asian ideograph -8BF5East Asian ideograph -8BEBEast Asian ideograph -8BEDEast Asian ideograph -5FD7East Asian ideograph -8BECEast Asian ideograph -8BA4East Asian ideograph -8BEFEast Asian ideograph -8BF2East Asian ideograph -8BF0East Asian ideograph -8BF1East Asian ideograph -8BF3East Asian ideograph -8C0AEast Asian ideograph -8C06East Asian ideograph -8C05East Asian ideograph -8C08East Asian ideograph -8BF7East Asian ideograph -8BF8East Asian ideograph -8BFEEast Asian ideograph -8C03East Asian ideograph -8BFFEast Asian ideograph -8C04East Asian ideograph -8C01East Asian ideograph -8BDEEast Asian ideograph -8BBAEast Asian ideograph -8C1BEast Asian ideograph -8C1AEast Asian ideograph -8C0FEast Asian ideograph -8BB3East Asian ideograph -8C10East Asian ideograph -8C0DEast Asian ideograph -8C0BEast Asian ideograph -8C12East Asian ideograph -8C13East Asian ideograph -8BFAEast Asian ideograph -8BBDEast Asian ideograph -8C15East Asian ideograph -8C24East Asian ideograph -8C26East Asian ideograph -8C1CEast Asian ideograph -8BB2East Asian ideograph -8C0EEast Asian ideograph -8C23East Asian ideograph -8A8AEast Asian ideograph -8C22East Asian ideograph -8C28East Asian ideograph -8C2CEast Asian ideograph -8C1FEast Asian ideograph -8BC6East Asian ideograph -8C31East Asian ideograph -8C32East Asian ideograph -8BC1East Asian ideograph -8C2DEast Asian ideograph -8BA5East Asian ideograph -8BAEEast Asian ideograph -8BD1East Asian ideograph -8C34East Asian ideograph -62A4East Asian ideograph -8A89East Asian ideograph -8BFBEast Asian ideograph -53D8East Asian ideograph -8BA9East Asian ideograph -8C36East Asian ideograph -8C17East Asian ideograph -5C82East Asian ideograph -7AD6East Asian ideograph -4E30East Asian ideograph -4E88East Asian ideograph -7683East Asian ideograph -8D1DEast Asian ideograph -8D1EEast Asian ideograph -8D1FEast Asian ideograph -8D21East Asian ideograph -8D22East Asian ideograph -8D23East Asian ideograph -8D2FEast Asian ideograph -8D27East Asian ideograph -8D2AEast Asian ideograph -8D2BEast Asian ideograph -8D29East Asian ideograph -8D39East Asian ideograph -8D32East Asian ideograph -8D3AEast Asian ideograph -8D35East Asian ideograph -8D34East Asian ideograph -4E70East Asian ideograph -8D2CEast Asian ideograph -8D3BEast Asian ideograph -8D37East Asian ideograph -8D38East Asian ideograph -8D45East Asian ideograph -8D44East Asian ideograph -8D3CEast Asian ideograph -8D3EEast Asian ideograph -8D3FEast Asian ideograph -8D40East Asian ideograph -8D41East Asian ideograph -8D42East Asian ideograph -5BBEEast Asian ideograph -8D48East Asian ideograph -8D4AEast Asian ideograph -8D54East Asian ideograph -8D4BEast Asian ideograph -5356East Asian ideograph -8D24East Asian ideograph -8D31East Asian ideograph -8D4FEast Asian ideograph -8D50East Asian ideograph -8D28East Asian ideograph -8D4CEast Asian ideograph -8D56East Asian ideograph -8D5BEast Asian ideograph -8D5AEast Asian ideograph -8D58East Asian ideograph -8D2DEast Asian ideograph -8D60East Asian ideograph -8D5DEast Asian ideograph -8D5EEast Asian ideograph -8D62East Asian ideograph -8D61East Asian ideograph -8D43East Asian ideograph -8D4EEast Asian ideograph -8D63East Asian ideograph -8D75East Asian ideograph -8D76East Asian ideograph -8D8BEast Asian ideograph -8DF5East Asian ideograph -8E0AEast Asian ideograph -8E52East Asian ideograph -8DF7East Asian ideograph -8DB8East Asian ideograph -8E0CEast Asian ideograph -8DC3East Asian ideograph -8E2FEast Asian ideograph -8E51East Asian ideograph -8E8FEast Asian ideograph -8EAFEast Asian ideograph -8F66East Asian ideograph -8F67East Asian ideograph -519BEast Asian ideograph -8F68East Asian ideograph -8F69East Asian ideograph -8F6BEast Asian ideograph -8F6FEast Asian ideograph -8F6DEast Asian ideograph -8F72East Asian ideograph -8F74East Asian ideograph -8F76East Asian ideograph -8F83East Asian ideograph -8F7CEast Asian ideograph -8F7DEast Asian ideograph -8F7EEast Asian ideograph -8F85East Asian ideograph -8F84East Asian ideograph -8F7BEast Asian ideograph -8F87East Asian ideograph -8F86East Asian ideograph -8F8DEast Asian ideograph -8F89East Asian ideograph -8F88East Asian ideograph -8F6EEast Asian ideograph -8F8EEast Asian ideograph -8F90East Asian ideograph -8F91East Asian ideograph -8F93East Asian ideograph -8F96East Asian ideograph -8F97East Asian ideograph -8F95East Asian ideograph -6BC2East Asian ideograph -8206East Asian ideograph -8F99East Asian ideograph -8F6CEast Asian ideograph -8F9AEast Asian ideograph -8F7FEast Asian ideograph -8F70East Asian ideograph -8F94East Asian ideograph -529EEast Asian ideograph -8F9EEast Asian ideograph -8FA9East Asian ideograph -519CEast Asian ideograph -8FF0East Asian ideograph -8FD9East Asian ideograph -8FDEEast Asian ideograph -8FDBEast Asian ideograph -8FD0East Asian ideograph -8FBEEast Asian ideograph -8FDDEast Asian ideograph -8FC2East Asian ideograph -8FC7East Asian ideograph -8FDCEast Asian ideograph -900AEast Asian ideograph -9012East Asian ideograph -9002East Asian ideograph -9009East Asian ideograph -8FDFEast Asian ideograph -8FC1East Asian ideograph -8FBDEast Asian ideograph -9057East Asian ideograph -8FC8East Asian ideograph -8FD8East Asian ideograph -E9758FE9Variant of 2D5C5A which maps to 8FE9 -8FB9East Asian ideograph -9026East Asian ideograph -903BEast Asian ideograph -5369East Asian ideograph -90AEEast Asian ideograph -4E61East Asian ideograph -90B9East Asian ideograph -90D1East Asian ideograph -90BBEast Asian ideograph -9093East Asian ideograph -9154East Asian ideograph -915DEast Asian ideograph -4E11East Asian ideograph -533BEast Asian ideograph -9171East Asian ideograph -917FEast Asian ideograph -8845East Asian ideograph -91CAEast Asian ideograph -5398East Asian ideograph -9488East Asian ideograph -9489East Asian ideograph -948AEast Asian ideograph -9497East Asian ideograph -9493East Asian ideograph -948FEast Asian ideograph -9499East Asian ideograph -949DEast Asian ideograph -94AEEast Asian ideograph -94A0East Asian ideograph -949EEast Asian ideograph -94A7East Asian ideograph -94A4East Asian ideograph -94B4East Asian ideograph -94B9East Asian ideograph -94B8East Asian ideograph -94C0East Asian ideograph -94BEEast Asian ideograph -94C5East Asian ideograph -94A9East Asian ideograph -94C2East Asian ideograph -94C3East Asian ideograph -94F0East Asian ideograph -94F6East Asian ideograph -94D0East Asian ideograph -94DCEast Asian ideograph -94EDEast Asian ideograph -94E2East Asian ideograph -94ECEast Asian ideograph -94E8East Asian ideograph -8854East Asian ideograph -950CEast Asian ideograph -9511East Asian ideograph -9510East Asian ideograph -94FAEast Asian ideograph -9500East Asian ideograph -94DDEast Asian ideograph -9504East Asian ideograph -9509East Asian ideograph -950BEast Asian ideograph -952DEast Asian ideograph -952FEast Asian ideograph -9530East Asian ideograph -9519East Asian ideograph -94B1East Asian ideograph -94A2East Asian ideograph -9521East Asian ideograph -94EEEast Asian ideograph -5F55East Asian ideograph -9525East Asian ideograph -9526East Asian ideograph -9540East Asian ideograph -9541East Asian ideograph -952EEast Asian ideograph -9532East Asian ideograph -9505East Asian ideograph -951AEast Asian ideograph -953EEast Asian ideograph -949FEast Asian ideograph -9524East Asian ideograph -9539East Asian ideograph -953BEast Asian ideograph -9551East Asian ideograph -9547East Asian ideograph -9501East Asian ideograph -94A8East Asian ideograph -954DEast Asian ideograph -955CEast Asian ideograph -955DEast Asian ideograph -955EEast Asian ideograph -94F2East Asian ideograph -94FFEast Asian ideograph -94FEEast Asian ideograph -9556East Asian ideograph -9557East Asian ideograph -9542East Asian ideograph -9558East Asian ideograph -9559East Asian ideograph -9535East Asian ideograph -94D9East Asian ideograph -9570East Asian ideograph -9508East Asian ideograph -956DEast Asian ideograph -94C1East Asian ideograph -94DBEast Asian ideograph -94CEEast Asian ideograph -956FEast Asian ideograph -94F8East Asian ideograph -9573East Asian ideograph -94C4East Asian ideograph -9576East Asian ideograph -94A5East Asian ideograph -92AEEast Asian ideograph -9523East Asian ideograph -94BBEast Asian ideograph -51FFEast Asian ideograph -957FEast Asian ideograph -95E8East Asian ideograph -95E9East Asian ideograph -95EAEast Asian ideograph -95EDEast Asian ideograph -95F5East Asian ideograph -95F0East Asian ideograph -5F00East Asian ideograph -95F2East Asian ideograph -95F4East Asian ideograph -95F8East Asian ideograph -9602East Asian ideograph -95FAEast Asian ideograph -95FDEast Asian ideograph -9601East Asian ideograph -9600East Asian ideograph -5408East Asian ideograph -9605East Asian ideograph -95FEEast Asian ideograph -960EEast Asian ideograph -9614East Asian ideograph -9615East Asian ideograph -9611East Asian ideograph -95F1East Asian ideograph -677FEast Asian ideograph -95EFEast Asian ideograph -9617East Asian ideograph -5173East Asian ideograph -9610East Asian ideograph -E914Duplicate simplified ideograph -9635East Asian ideograph -9648East Asian ideograph -9646East Asian ideograph -9634East Asian ideograph -961FEast Asian ideograph -9636East Asian ideograph -9633East Asian ideograph -9645East Asian ideograph -968FEast Asian ideograph -9669East Asian ideograph -9690East Asian ideograph -9647East Asian ideograph -96B6East Asian ideograph -E915Duplicate simplified ideograph -867DEast Asian ideograph -6742East Asian ideograph -9E21East Asian ideograph -96CFEast Asian ideograph -53CCEast Asian ideograph -79BBEast Asian ideograph -96BEEast Asian ideograph -4E91East Asian ideograph -7535East Asian ideograph -96FEEast Asian ideograph -9701East Asian ideograph -972DEast Asian ideograph -96F3East Asian ideograph -7075East Asian ideograph -9765East Asian ideograph -5DE9East Asian ideograph -9791East Asian ideograph -97E6East Asian ideograph -97E7East Asian ideograph -97E9East Asian ideograph -97ECEast Asian ideograph -827DEast Asian ideograph -54CDEast Asian ideograph -9875East Asian ideograph -9876East Asian ideograph -9877East Asian ideograph -9879East Asian ideograph -987AEast Asian ideograph -987BEast Asian ideograph -9884East Asian ideograph -987CEast Asian ideograph -987DEast Asian ideograph -987FEast Asian ideograph -9881East Asian ideograph -9882East Asian ideograph -9887East Asian ideograph -9886East Asian ideograph -9889East Asian ideograph -5934East Asian ideograph -988AEast Asian ideograph -9888East Asian ideograph -9891East Asian ideograph -9893East Asian ideograph -9894East Asian ideograph -9890East Asian ideograph -9897East Asian ideograph -989CEast Asian ideograph -989DEast Asian ideograph -9898East Asian ideograph -989AEast Asian ideograph -989BEast Asian ideograph -7C7BEast Asian ideograph -98A0East Asian ideograph -613FEast Asian ideograph -987EEast Asian ideograph -98A4East Asian ideograph -663EEast Asian ideograph -9885East Asian ideograph -98A6East Asian ideograph -98CEEast Asian ideograph -98D2East Asian ideograph -E916Duplicate simplified ideograph -522EEast Asian ideograph -98D3East Asian ideograph -98D5East Asian ideograph -98D8East Asian ideograph -98DEEast Asian ideograph -9965East Asian ideograph -9968East Asian ideograph -996CEast Asian ideograph -996AEast Asian ideograph -996EEast Asian ideograph -996DEast Asian ideograph -9972East Asian ideograph -9974East Asian ideograph -9971East Asian ideograph -9970East Asian ideograph -997AEast Asian ideograph -517BEast Asian ideograph -9975East Asian ideograph -9977East Asian ideograph -9981East Asian ideograph -4F59East Asian ideograph -997FEast Asian ideograph -997CEast Asian ideograph -9986East Asian ideograph -996FEast Asian ideograph -9984East Asian ideograph -9985East Asian ideograph -998FEast Asian ideograph -998AEast Asian ideograph -9992East Asian ideograph -9976East Asian ideograph -990DEast Asian ideograph -998BEast Asian ideograph -9A6CEast Asian ideograph -51AFEast Asian ideograph -9A6DEast Asian ideograph -9A70East Asian ideograph -9A6EEast Asian ideograph -9A6FEast Asian ideograph -9A73East Asian ideograph -9A7BEast Asian ideograph -9A7CEast Asian ideograph -9A7EEast Asian ideograph -9A77East Asian ideograph -9A76East Asian ideograph -9A79East Asian ideograph -9A78East Asian ideograph -9A7DEast Asian ideograph -9A87East Asian ideograph -9A86East Asian ideograph -9A8BEast Asian ideograph -9A8FEast Asian ideograph -9A88East Asian ideograph -9A91East Asian ideograph -9A97East Asian ideograph -9A9BEast Asian ideograph -9A9EEast Asian ideograph -817EEast Asian ideograph -9A9AEast Asian ideograph -9AA0East Asian ideograph -9A71East Asian ideograph -84E6East Asian ideograph -9AA1East Asian ideograph -9A84East Asian ideograph -60CAEast Asian ideograph -9A7FEast Asian ideograph -9A8CEast Asian ideograph -9AA4East Asian ideograph -9A74East Asian ideograph -9AA5East Asian ideograph -9A8AEast Asian ideograph -80AEEast Asian ideograph -9AC5East Asian ideograph -4F53East Asian ideograph -810FEast Asian ideograph -E917Duplicate simplified ideograph -E918Duplicate simplified ideograph -E919Duplicate simplified ideograph -E91ADuplicate simplified ideograph -9B13East Asian ideograph -6597East Asian ideograph -95F9East Asian ideograph -90C1East Asian ideograph -9B47East Asian ideograph -9C7CEast Asian ideograph -9C7FEast Asian ideograph -9C81East Asian ideograph -9C8DEast Asian ideograph -9C9BEast Asian ideograph -9C9CEast Asian ideograph -9C94East Asian ideograph -9CA8East Asian ideograph -9CA4East Asian ideograph -9CB8East Asian ideograph -9CB3East Asian ideograph -9CC3East Asian ideograph -9CC5East Asian ideograph -9CABEast Asian ideograph -9CCDEast Asian ideograph -9CCFEast Asian ideograph -9CA2East Asian ideograph -9CD4East Asian ideograph -9CD7East Asian ideograph -9CDDEast Asian ideograph -9CDEEast Asian ideograph -9CDCEast Asian ideograph -9CD6East Asian ideograph -9C88East Asian ideograph -9E1FEast Asian ideograph -9E20East Asian ideograph -9E22East Asian ideograph -9E23East Asian ideograph -51E4East Asian ideograph -9E29East Asian ideograph -9E26East Asian ideograph -9E35East Asian ideograph -9E2AEast Asian ideograph -9E2DEast Asian ideograph -9E2FEast Asian ideograph -9E33East Asian ideograph -9E3FEast Asian ideograph -9E3DEast Asian ideograph -9E49East Asian ideograph -9E43East Asian ideograph -9E44East Asian ideograph -9E45East Asian ideograph -9E51East Asian ideograph -9E4AEast Asian ideograph -9E4CEast Asian ideograph -9E4FEast Asian ideograph -9E64East Asian ideograph -83BAEast Asian ideograph -9E5EEast Asian ideograph -9E67East Asian ideograph -9E25East Asian ideograph -9E36East Asian ideograph -9E70East Asian ideograph -9E6DEast Asian ideograph -9E66East Asian ideograph -9E3EEast Asian ideograph -54B8East Asian ideograph -76D0East Asian ideograph -7877East Asian ideograph -4E3DEast Asian ideograph -9EA6East Asian ideograph -9EB8East Asian ideograph -9762East Asian ideograph -4E48East Asian ideograph -70B9East Asian ideograph -515AEast Asian ideograph -9EE9East Asian ideograph -51ACEast Asian ideograph -9F50East Asian ideograph -658EEast Asian ideograph -9F7FEast Asian ideograph -9F83East Asian ideograph -9F84East Asian ideograph -9F88East Asian ideograph -9F87East Asian ideograph -9F89East Asian ideograph -9F8AEast Asian ideograph -9F8CEast Asian ideograph -9F8BEast Asian ideograph -9F99East Asian ideograph -9F9AEast Asian ideograph -9F9FEast Asian ideograph -4F1CEast Asian ideograph -4F65East Asian ideograph -4F1BEast Asian ideograph -507BEast Asian ideograph -507EEast Asian ideograph -4FAAEast Asian ideograph -50A9East Asian ideograph -50A5East Asian ideograph -522DEast Asian ideograph -5250East Asian ideograph -672DEast Asian ideograph -523FEast Asian ideograph -523DEast Asian ideograph -5326East Asian ideograph -538DEast Asian ideograph -53A3East Asian ideograph -5459East Asian ideograph -5457East Asian ideograph -5522East Asian ideograph -551BEast Asian ideograph -54D4East Asian ideograph -54D3East Asian ideograph -E91BDuplicate simplified ideograph -5452East Asian ideograph -54D2East Asian ideograph -54D5East Asian ideograph -54D9East Asian ideograph -54DCEast Asian ideograph -556EEast Asian ideograph -5456East Asian ideograph -55BEEast Asian ideograph -5181East Asian ideograph -56F5East Asian ideograph -57ADEast Asian ideograph -57DAEast Asian ideograph -57D8East Asian ideograph -57D9East Asian ideograph -57B2East Asian ideograph -5785East Asian ideograph -5786East Asian ideograph -5956East Asian ideograph -5A05East Asian ideograph -5A32East Asian ideograph -59ABEast Asian ideograph -5A06East Asian ideograph -5AF1East Asian ideograph -5AD2East Asian ideograph -5A08East Asian ideograph -5C66East Asian ideograph -5C98East Asian ideograph -5D03East Asian ideograph -5D5DEast Asian ideograph -5D02East Asian ideograph -5CE4East Asian ideograph -5CC4East Asian ideograph -5D58East Asian ideograph -5CBFEast Asian ideograph -5DEFEast Asian ideograph -5E0FEast Asian ideograph -5E3BEast Asian ideograph -5E31East Asian ideograph -5E91East Asian ideograph -5F2AEast Asian ideograph -607DEast Asian ideograph -607AEast Asian ideograph -6004East Asian ideograph -60ADEast Asian ideograph -60ABEast Asian ideograph -6126East Asian ideograph -6003East Asian ideograph -603FEast Asian ideograph -6079East Asian ideograph -603CEast Asian ideograph -6206East Asian ideograph -620BEast Asian ideograph -6217East Asian ideograph -629FEast Asian ideograph -62A0East Asian ideograph -63BAEast Asian ideograph -63BCEast Asian ideograph -63B8East Asian ideograph -6322East Asian ideograph -63FFEast Asian ideograph -6448East Asian ideograph -64B7East Asian ideograph -6445East Asian ideograph -6484East Asian ideograph -64BAEast Asian ideograph -6512East Asian ideograph -6593East Asian ideograph -6619East Asian ideograph -6654East Asian ideograph -4E2BEast Asian ideograph -E91CDuplicate simplified ideograph -67A7East Asian ideograph -67A8East Asian ideograph -6966East Asian ideograph -6769East Asian ideograph -6864East Asian ideograph -6920East Asian ideograph -67FDEast Asian ideograph -6861East Asian ideograph -6A2FEast Asian ideograph -68BCEast Asian ideograph -680EEast Asian ideograph -6A7CEast Asian ideograph -6987East Asian ideograph -680AEast Asian ideograph -69E0East Asian ideograph -67A5East Asian ideograph -680CEast Asian ideograph -68C2East Asian ideograph -6989East Asian ideograph -6924East Asian ideograph -6B9AEast Asian ideograph -6BF5East Asian ideograph -6BE1East Asian ideograph -6C07East Asian ideograph -6C29East Asian ideograph -6D43East Asian ideograph -6D9EEast Asian ideograph -6D48East Asian ideograph -8365East Asian ideograph -6D52East Asian ideograph -6CA4East Asian ideograph -988DEast Asian ideograph -6D9DEast Asian ideograph -6D54East Asian ideograph -6DA0East Asian ideograph -6CA9East Asian ideograph -6ED7East Asian ideograph -6E11East Asian ideograph -6CF6East Asian ideograph -6F4BEast Asian ideograph -6D4DEast Asian ideograph -6F4DEast Asian ideograph -6EE2East Asian ideograph -6CF7East Asian ideograph -6CF8East Asian ideograph -6CA3East Asian ideograph -6EE0East Asian ideograph -6F13East Asian ideograph -704FEast Asian ideograph -6EDFEast Asian ideograph -70C3East Asian ideograph -709CEast Asian ideograph -8367East Asian ideograph -709DEast Asian ideograph -70E8East Asian ideograph -70ECEast Asian ideograph -72B8East Asian ideograph -72F2East Asian ideograph -7303East Asian ideograph -7315East Asian ideograph -73AEEast Asian ideograph -740FEast Asian ideograph -748EEast Asian ideograph -74D2East Asian ideograph -7572East Asian ideograph -75D6East Asian ideograph -7617East Asian ideograph -7618East Asian ideograph -7605East Asian ideograph -762AEast Asian ideograph -75ACEast Asian ideograph -763FEast Asian ideograph -75C8East Asian ideograph -7726East Asian ideograph -770DEast Asian ideograph -7751East Asian ideograph -7817East Asian ideograph -7856East Asian ideograph -7800East Asian ideograph -789BEast Asian ideograph -789CEast Asian ideograph -7857East Asian ideograph -783BEast Asian ideograph -7AADEast Asian ideograph -7B15East Asian ideograph -7BA7East Asian ideograph -7BA6East Asian ideograph -7B5AEast Asian ideograph -7BA8East Asian ideograph -7B3EEast Asian ideograph -7C16East Asian ideograph -7CC1East Asian ideograph -E91DDuplicate simplified ideograph -7C9DEast Asian ideograph -7C74East Asian ideograph -7EA1East Asian ideograph -7EA8East Asian ideograph -7EBEEast Asian ideograph -7EC0East Asian ideograph -7EC1East Asian ideograph -7EC2East Asian ideograph -7ED0East Asian ideograph -7EDBEast Asian ideograph -7ED7East Asian ideograph -7EE8East Asian ideograph -7EE0East Asian ideograph -7EE1East Asian ideograph -7EFBEast Asian ideograph -7EEFEast Asian ideograph -7EF2East Asian ideograph -7EF6East Asian ideograph -7EFAEast Asian ideograph -7F17East Asian ideograph -7F02East Asian ideograph -7F03East Asian ideograph -7F07East Asian ideograph -7F08East Asian ideograph -7F0CEast Asian ideograph -7F11East Asian ideograph -7F0FEast Asian ideograph -7F1FEast Asian ideograph -7F12East Asian ideograph -7F1CEast Asian ideograph -7F19East Asian ideograph -7F1BEast Asian ideograph -7EC9East Asian ideograph -E91EDuplicate simplified ideograph -7F21East Asian ideograph -7D77East Asian ideograph -7F25East Asian ideograph -7F26East Asian ideograph -7F2FEast Asian ideograph -7F30East Asian ideograph -7F32East Asian ideograph -7F33East Asian ideograph -7F34East Asian ideograph -7F31East Asian ideograph -7EA9East Asian ideograph -7F2CEast Asian ideograph -624DEast Asian ideograph -7F35East Asian ideograph -7F42East Asian ideograph -E91FDuplicate simplified ideograph -7F74East Asian ideograph -7F9FEast Asian ideograph -8027East Asian ideograph -8069East Asian ideograph -804DEast Asian ideograph -80EBEast Asian ideograph -80E8East Asian ideograph -8136East Asian ideograph -8114East Asian ideograph -82CCEast Asian ideograph -836DEast Asian ideograph -836EEast Asian ideograph -83B3East Asian ideograph -E920Duplicate simplified ideograph -83BCEast Asian ideograph -835CEast Asian ideograph -848CEast Asian ideograph -8311East Asian ideograph -82C1East Asian ideograph -8368East Asian ideograph -835BEast Asian ideograph -8487East Asian ideograph -8489East Asian ideograph -836CEast Asian ideograph -835EEast Asian ideograph -83B8East Asian ideograph -8297East Asian ideograph -84E3East Asian ideograph -84DFEast Asian ideograph -835FEast Asian ideograph -83B6East Asian ideograph -8360East Asian ideograph -8369East Asian ideograph -830FEast Asian ideograph -82C8East Asian ideograph -8572East Asian ideograph -8539East Asian ideograph -84E0East Asian ideograph -86F1East Asian ideograph -86ACEast Asian ideograph -86F3East Asian ideograph -86F0East Asian ideograph -866EEast Asian ideograph -86CFEast Asian ideograph -867FEast Asian ideograph -86F4East Asian ideograph -877EEast Asian ideograph -8511East Asian ideograph -88E2East Asian ideograph -88E5East Asian ideograph -88E3East Asian ideograph -7962East Asian ideograph -89C7East Asian ideograph -89CBEast Asian ideograph -89CFEast Asian ideograph -89D1East Asian ideograph -89CCEast Asian ideograph -89EFEast Asian ideograph -8BB5East Asian ideograph -8BCEEast Asian ideograph -8BD2East Asian ideograph -8BD6East Asian ideograph -8BD3East Asian ideograph -8BE9East Asian ideograph -8BD4East Asian ideograph -8BDCEast Asian ideograph -8BEEEast Asian ideograph -8C07East Asian ideograph -8BF9East Asian ideograph -8BFCEast Asian ideograph -8BE4East Asian ideograph -8BFDEast Asian ideograph -8C00East Asian ideograph -8C02East Asian ideograph -8C19East Asian ideograph -8BE8East Asian ideograph -8C0CEast Asian ideograph -8C14East Asian ideograph -8C11East Asian ideograph -8C16East Asian ideograph -8C1DEast Asian ideograph -8C21East Asian ideograph -8BCCEast Asian ideograph -8C27East Asian ideograph -8BB4East Asian ideograph -8C29East Asian ideograph -8C2EEast Asian ideograph -8C2FEast Asian ideograph -8C35East Asian ideograph -8C30East Asian ideograph -8C20East Asian ideograph -8C33East Asian ideograph -8D33East Asian ideograph -8D36East Asian ideograph -8D47East Asian ideograph -8D53East Asian ideograph -8D55East Asian ideograph -8D49East Asian ideograph -8D59East Asian ideograph -8D3DEast Asian ideograph -8D5CEast Asian ideograph -8D46East Asian ideograph -8DB1East Asian ideograph -8DC4East Asian ideograph -8DF8East Asian ideograph -8E70East Asian ideograph -8DFBEast Asian ideograph -8DF9East Asian ideograph -8DDEEast Asian ideograph -8E2CEast Asian ideograph -8E7FEast Asian ideograph -8E9CEast Asian ideograph -8F71East Asian ideograph -8F7AEast Asian ideograph -8F75East Asian ideograph -8F77East Asian ideograph -8F78East Asian ideograph -8F82East Asian ideograph -8F81East Asian ideograph -8F8BEast Asian ideograph -8F8AEast Asian ideograph -8F8FEast Asian ideograph -8F98East Asian ideograph -8F79East Asian ideograph -8F73East Asian ideograph -8FF8East Asian ideograph -90CFEast Asian ideograph -90D3East Asian ideograph -90E7East Asian ideograph -90ACEast Asian ideograph -90F8East Asian ideograph -90BAEast Asian ideograph -90D0East Asian ideograph -909DEast Asian ideograph -90E6East Asian ideograph -917EEast Asian ideograph -917DEast Asian ideograph -9487East Asian ideograph -9486East Asian ideograph -948CEast Asian ideograph -948BEast Asian ideograph -948DEast Asian ideograph -948EEast Asian ideograph -9492East Asian ideograph -9495East Asian ideograph -9490East Asian ideograph -94ADEast Asian ideograph -94AAEast Asian ideograph -94ABEast Asian ideograph -94ACEast Asian ideograph -94AFEast Asian ideograph -949BEast Asian ideograph -94A3East Asian ideograph -94C8East Asian ideograph -94C9East Asian ideograph -94CBEast Asian ideograph -94CAEast Asian ideograph -94B0East Asian ideograph -94CCEast Asian ideograph -94B6East Asian ideograph -94B7East Asian ideograph -94B2East Asian ideograph -94BAEast Asian ideograph -94CDEast Asian ideograph -94BDEast Asian ideograph -94BFEast Asian ideograph -94C6East Asian ideograph -94F3East Asian ideograph -94F1East Asian ideograph -94F5East Asian ideograph -94D6East Asian ideograph -94D2East Asian ideograph -94D1East Asian ideograph -94D5East Asian ideograph -94DEEast Asian ideograph -94DFEast Asian ideograph -94EBEast Asian ideograph -94EFEast Asian ideograph -94E5East Asian ideograph -94E3East Asian ideograph -94EAEast Asian ideograph -94F7East Asian ideograph -9512East Asian ideograph -950DEast Asian ideograph -94FDEast Asian ideograph -9513East Asian ideograph -9514East Asian ideograph -94D8East Asian ideograph -94D7East Asian ideograph -9503East Asian ideograph -94A1East Asian ideograph -9502East Asian ideograph -950AEast Asian ideograph -94E4East Asian ideograph -9506East Asian ideograph -9507East Asian ideograph -952BEast Asian ideograph -9529East Asian ideograph -952CEast Asian ideograph -9516East Asian ideograph -9515East Asian ideograph -94FCEast Asian ideograph -951BEast Asian ideograph -951DEast Asian ideograph -951EEast Asian ideograph -951FEast Asian ideograph -9494East Asian ideograph -9522East Asian ideograph -9528East Asian ideograph -9531East Asian ideograph -9534East Asian ideograph -9545East Asian ideograph -9517East Asian ideograph -94E1East Asian ideograph -9536East Asian ideograph -9537East Asian ideograph -9518East Asian ideograph -9538East Asian ideograph -9550East Asian ideograph -9553East Asian ideograph -9552East Asian ideograph -84E5East Asian ideograph -9549East Asian ideograph -94E0East Asian ideograph -954FEast Asian ideograph -953CEast Asian ideograph -955BEast Asian ideograph -955FEast Asian ideograph -956AEast Asian ideograph -933EEast Asian ideograph -9546East Asian ideograph -94E9East Asian ideograph -94F4East Asian ideograph -9566East Asian ideograph -9568East Asian ideograph -94F9East Asian ideograph -956BEast Asian ideograph -950EEast Asian ideograph -950FEast Asian ideograph -9561East Asian ideograph -9562East Asian ideograph -9563East Asian ideograph -94E7East Asian ideograph -9564East Asian ideograph -9571East Asian ideograph -9554East Asian ideograph -9572East Asian ideograph -956CEast Asian ideograph -9565East Asian ideograph -9567East Asian ideograph -9569East Asian ideograph -954AEast Asian ideograph -95F3East Asian ideograph -9606East Asian ideograph -9603East Asian ideograph -960FEast Asian ideograph -9608East Asian ideograph -9609East Asian ideograph -960AEast Asian ideograph -960CEast Asian ideograph -960DEast Asian ideograph -9612East Asian ideograph -9619East Asian ideograph -961AEast Asian ideograph -95FCEast Asian ideograph -9655East Asian ideograph -9649East Asian ideograph -9753East Asian ideograph -97AFEast Asian ideograph -97EAEast Asian ideograph -97EBEast Asian ideograph -9878East Asian ideograph -9883East Asian ideograph -9880East Asian ideograph -988FEast Asian ideograph -98A1East Asian ideograph -989FEast Asian ideograph -98A2East Asian ideograph -98A5East Asian ideograph -989EEast Asian ideograph -98A7East Asian ideograph -98D9East Asian ideograph -996BEast Asian ideograph -997DEast Asian ideograph -9967East Asian ideograph -9969East Asian ideograph -9990East Asian ideograph -9991East Asian ideograph -998DEast Asian ideograph -9994East Asian ideograph -9993East Asian ideograph -98E8East Asian ideograph -9A75East Asian ideograph -9A80East Asian ideograph -9A90East Asian ideograph -9A92East Asian ideograph -9A93East Asian ideograph -9A9FEast Asian ideograph -9A98East Asian ideograph -9A7AEast Asian ideograph -9A9DEast Asian ideograph -9A9CEast Asian ideograph -9A96East Asian ideograph -9AA2East Asian ideograph -9AA3East Asian ideograph -9A81East Asian ideograph -9A85East Asian ideograph -9AA7East Asian ideograph -9ACBEast Asian ideograph -960BEast Asian ideograph -9604East Asian ideograph -9B49East Asian ideograph -9C82East Asian ideograph -9C86East Asian ideograph -9C87East Asian ideograph -9C90East Asian ideograph -9C8BEast Asian ideograph -9C9EEast Asian ideograph -9C91East Asian ideograph -9C92East Asian ideograph -9C95East Asian ideograph -9CA9East Asian ideograph -9CA0East Asian ideograph -9CA7East Asian ideograph -9CADEast Asian ideograph -9CB0East Asian ideograph -9CAEEast Asian ideograph -9CBAEast Asian ideograph -9CB2East Asian ideograph -9CB4East Asian ideograph -9CB1East Asian ideograph -9CB7East Asian ideograph -9CB5East Asian ideograph -9CB6East Asian ideograph -9CBBEast Asian ideograph -9CCAEast Asian ideograph -9CBDEast Asian ideograph -9CC4East Asian ideograph -9CC6East Asian ideograph -9CC7East Asian ideograph -9CCBEast Asian ideograph -9CA5East Asian ideograph -9CCEEast Asian ideograph -9CD9East Asian ideograph -9CCCEast Asian ideograph -9CD5East Asian ideograph -9CA3East Asian ideograph -9CD3East Asian ideograph -9CD8East Asian ideograph -9CDFEast Asian ideograph -9C85East Asian ideograph -9C9FEast Asian ideograph -9CBCEast Asian ideograph -9CE2East Asian ideograph -9C8EEast Asian ideograph -9C9AEast Asian ideograph -9CA1East Asian ideograph -9E28East Asian ideograph -9E32East Asian ideograph -9E31East Asian ideograph -9E38East Asian ideograph -9E39East Asian ideograph -9E3AEast Asian ideograph -9E48East Asian ideograph -9E41East Asian ideograph -9E46East Asian ideograph -9E2BEast Asian ideograph -9E4EEast Asian ideograph -9E5CEast Asian ideograph -9E5BEast Asian ideograph -9E55East Asian ideograph -9E57East Asian ideograph -9E4BEast Asian ideograph -9E63East Asian ideograph -9E5AEast Asian ideograph -9E58East Asian ideograph -9E37East Asian ideograph -9E68East Asian ideograph -9E47East Asian ideograph -9E6BEast Asian ideograph -9E6CEast Asian ideograph -9E69East Asian ideograph -9E6AEast Asian ideograph -9E71East Asian ideograph -9E2CEast Asian ideograph -9E73East Asian ideograph -9E42East Asian ideograph -5364East Asian ideograph -9E7EEast Asian ideograph -9EEAEast Asian ideograph -9EFEEast Asian ideograph -9F0BEast Asian ideograph -9F0DEast Asian ideograph -9F51East Asian ideograph -9F80East Asian ideograph -9F86East Asian ideograph -9F85East Asian ideograph -9F9BEast Asian ideograph -5F0CEast Asian ideograph -4E17East Asian ideograph -7ADDEast Asian ideograph -4E57East Asian ideograph -5F0DEast Asian ideograph -4E3CEast Asian ideograph -4E9CEast Asian ideograph -4EBEEast Asian ideograph -4EB0East Asian ideograph -8B8EEast Asian ideograph -4ECFEast Asian ideograph -62BBEast Asian ideograph -4F32East Asian ideograph -5002East Asian ideograph -5008East Asian ideograph -4FA3East Asian ideograph -7AE2East Asian ideograph -EA04East Asian ideography not found in unified han -5E78East Asian ideograph -7B87East Asian ideograph -510CEast Asian ideograph -50E3East Asian ideograph -E97650BBVariant of 4B325F which maps to 50BB -5039East Asian ideograph -4FADEast Asian ideograph -706EEast Asian ideograph -514EEast Asian ideograph -634CEast Asian ideograph -4E0CEast Asian ideograph -5190East Asian ideograph -5202East Asian ideograph -E9F4East Asian ideograph not in Unicode -52B5East Asian ideograph -5234East Asian ideograph -5C05East Asian ideograph -5265East Asian ideograph -8CF8East Asian ideograph -5294East Asian ideograph -5226East Asian ideograph -8274East Asian ideograph -52F3East Asian ideograph -52A2East Asian ideograph -52E7East Asian ideograph -758BEast Asian ideograph -62FEEast Asian ideograph -4EDFEast Asian ideograph -6607East Asian ideograph -5349East Asian ideograph -613DEast Asian ideograph -5918East Asian ideograph -5373East Asian ideograph -5374East Asian ideograph -52FEEast Asian ideograph -6B62East Asian ideograph -4EDDEast Asian ideograph -55ABEast Asian ideograph -7343East Asian ideograph -5434East Asian ideograph -8A36East Asian ideograph -546AEast Asian ideograph -8AEEEast Asian ideograph -95A7East Asian ideograph -8A7BEast Asian ideograph -6B38East Asian ideograph -5557East Asian ideograph -6199East Asian ideograph -751EEast Asian ideograph -8B5FEast Asian ideograph -5650East Asian ideograph -54BDEast Asian ideograph -8086East Asian ideograph -56ECEast Asian ideograph -5700East Asian ideograph -962CEast Asian ideograph -962FEast Asian ideograph -573BEast Asian ideograph -575AEast Asian ideograph -5872East Asian ideograph -51A2East Asian ideograph -5896East Asian ideograph -58CAEast Asian ideograph -58F7East Asian ideograph -5900East Asian ideograph -591FEast Asian ideograph -6B80East Asian ideograph -7287East Asian ideograph -67F0East Asian ideograph -7AD2East Asian ideograph -511EEast Asian ideograph -59ACEast Asian ideograph -7385East Asian ideograph -59D9East Asian ideograph -4F84East Asian ideograph -5A63East Asian ideograph -5B43East Asian ideograph -5A31East Asian ideograph -5A3FEast Asian ideograph -58FBEast Asian ideograph -5AFAEast Asian ideograph -5ACBEast Asian ideograph -6588East Asian ideograph -51A8East Asian ideograph -5EBDEast Asian ideograph -8A67East Asian ideograph -5C02East Asian ideograph -E9775C06Variant of 273B40 which maps to 5C06 -6EBAEast Asian ideograph -5C4AEast Asian ideograph -5D17East Asian ideograph -5CE9East Asian ideograph -5CEFEast Asian ideograph -5D8BEast Asian ideograph -5D08East Asian ideograph -57FCEast Asian ideograph -5D10East Asian ideograph -5D18East Asian ideograph -5DE3East Asian ideograph -9245East Asian ideograph -83F7East Asian ideograph -6A66East Asian ideograph -5E47East Asian ideograph -79CAEast Asian ideograph -51FCEast Asian ideograph -E921Duplicate simplified ideograph -7240East Asian ideograph -576BEast Asian ideograph -83F4East Asian ideograph -53A2East Asian ideograph -53A0East Asian ideograph -53AEEast Asian ideograph -5EBFEast Asian ideograph -5396East Asian ideograph -539BEast Asian ideograph -5EFEEast Asian ideograph -5F4AEast Asian ideograph -7BF2East Asian ideograph -5F5CEast Asian ideograph -9AF4East Asian ideograph -9015East Asian ideograph -5F93East Asian ideograph -60EAEast Asian ideograph -5FB4East Asian ideograph -6060East Asian ideograph -803BEast Asian ideograph -6052East Asian ideograph -6075East Asian ideograph -661AEast Asian ideograph -6120East Asian ideograph -5ABFEast Asian ideograph -6159East Asian ideograph -6185East Asian ideograph -61D0East Asian ideograph -621EEast Asian ideograph -6226East Asian ideograph -622FEast Asian ideograph -78A5East Asian ideograph -5214East Asian ideograph -64A6East Asian ideograph -67C6East Asian ideograph -6255East Asian ideograph -67B4East Asian ideograph -6283East Asian ideograph -6294East Asian ideograph -63CEEast Asian ideograph -62CFEast Asian ideograph -6485East Asian ideograph -642FEast Asian ideograph -63B2East Asian ideograph -6271East Asian ideograph -6428East Asian ideograph -6447East Asian ideograph -64E3East Asian ideograph -635CEast Asian ideograph -6534East Asian ideograph -62CAEast Asian ideograph -6483East Asian ideograph -5117East Asian ideograph -53D9East Asian ideograph -555FEast Asian ideograph -65E3East Asian ideograph -65EEEast Asian ideograph -6630East Asian ideograph -668EEast Asian ideograph -66ECEast Asian ideograph -6662East Asian ideograph -667BEast Asian ideograph -6636East Asian ideograph -6681East Asian ideograph -66A6East Asian ideograph -6716East Asian ideograph -6722East Asian ideograph -671EEast Asian ideograph -6736East Asian ideograph -686EEast Asian ideograph -6780East Asian ideograph -67FEEast Asian ideograph -6942East Asian ideograph -6822East Asian ideograph -69C5East Asian ideograph -6852East Asian ideograph -8308East Asian ideograph -6746East Asian ideograph -6973East Asian ideograph -6936East Asian ideograph -68CAEast Asian ideograph -E978690DVariant of 214474 which maps to 690D -684CEast Asian ideograph -6406East Asian ideograph -6760East Asian ideograph -6901East Asian ideograph -697DEast Asian ideograph -58ABEast Asian ideograph -681DEast Asian ideograph -68B9East Asian ideograph -6AC9East Asian ideograph -5FFBEast Asian ideograph -61FDEast Asian ideograph -6B7AEast Asian ideograph -6BD8East Asian ideograph -51B3East Asian ideograph -51B2East Asian ideograph -6CB2East Asian ideograph -6D29East Asian ideograph -51B5East Asian ideograph -6C4EEast Asian ideograph -6FFCEast Asian ideograph -6C79East Asian ideograph -6F94East Asian ideograph -51C9East Asian ideograph -51C4East Asian ideograph -E9796D45Variant of 274768 which maps to 6D45 -51CFEast Asian ideograph -6E07East Asian ideograph -6FD5East Asian ideograph -6E29East Asian ideograph -6EDAEast Asian ideograph -7001East Asian ideograph -6F44East Asian ideograph -6F82East Asian ideograph -E9F5East Asian ideograph not in Unicode -6F5CEast Asian ideograph -702CEast Asian ideograph -7AC8East Asian ideograph -70F1East Asian ideograph -70B0East Asian ideograph -70DFEast Asian ideograph -70A4East Asian ideograph -713CEast Asian ideograph -8B8CEast Asian ideograph -718FEast Asian ideograph -4E89East Asian ideograph -5C12East Asian ideograph -58BBEast Asian ideograph -7F9DEast Asian ideograph -7282East Asian ideograph -6C02East Asian ideograph -736AEast Asian ideograph -73C9East Asian ideograph -73CEEast Asian ideograph -746FEast Asian ideograph -6BECEast Asian ideograph -78AFEast Asian ideograph -7F3EEast Asian ideograph -7506East Asian ideograph -583AEast Asian ideograph -756EEast Asian ideograph -7567East Asian ideograph -53E0East Asian ideograph -758EEast Asian ideograph -7661East Asian ideograph -4F70East Asian ideograph -7681East Asian ideograph -76C7East Asian ideograph -76D7East Asian ideograph -771FEast Asian ideograph -7741East Asian ideograph -53E1East Asian ideograph -7792East Asian ideograph -7719East Asian ideograph -6998East Asian ideograph -78AAEast Asian ideograph -945BEast Asian ideograph -5FA1East Asian ideograph -9F9DEast Asian ideograph -7980East Asian ideograph -7A3EEast Asian ideograph -4E69East Asian ideograph -9834East Asian ideograph -7A42East Asian ideograph -7AB0East Asian ideograph -7AF8East Asian ideograph -7B5EEast Asian ideograph -693EEast Asian ideograph -7B5DEast Asian ideograph -84D1East Asian ideograph -7C58East Asian ideograph -7CFAEast Asian ideograph -5E0BEast Asian ideograph -7D25East Asian ideograph -6DD6East Asian ideograph -7D2CEast Asian ideograph -7DB3East Asian ideograph -7E62East Asian ideograph -7D99East Asian ideograph -9262East Asian ideograph -9475East Asian ideograph -8FA0East Asian ideograph -7F78East Asian ideograph -898AEast Asian ideograph -7FA1East Asian ideograph -7FA3East Asian ideograph -7FC4East Asian ideograph -98DCEast Asian ideograph -6537East Asian ideograph -79D0East Asian ideograph -79CFEast Asian ideograph -7085East Asian ideograph -8EADEast Asian ideograph -8074East Asian ideograph -7C9BEast Asian ideograph -5B8DEast Asian ideograph -6BD3East Asian ideograph -812CEast Asian ideograph -8107East Asian ideograph -80F7East Asian ideograph -8193East Asian ideograph -811AEast Asian ideograph -81C8East Asian ideograph -9AD7East Asian ideograph -5367East Asian ideograph -64E7East Asian ideograph -6841East Asian ideograph -8229East Asian ideograph -824AEast Asian ideograph -8306East Asian ideograph -6959East Asian ideograph -83C0East Asian ideograph -8318East Asian ideograph -E97A830EVariant of 275529 which maps to 830E -8358East Asian ideograph -E97B8393Variant of 21552E which maps to 8393 -837DEast Asian ideograph -585FEast Asian ideograph -855AEast Asian ideograph -8386East Asian ideograph -8385East Asian ideograph -76D6East Asian ideograph -83D4East Asian ideograph -8024East Asian ideograph -846FEast Asian ideograph -8613East Asian ideograph -6A97East Asian ideograph -9F04East Asian ideograph -9F05East Asian ideograph -8717East Asian ideograph -8797East Asian ideograph -8748East Asian ideograph -87C7East Asian ideograph -60F7East Asian ideograph -885EEast Asian ideograph -890EEast Asian ideograph -886EEast Asian ideograph -5E2CEast Asian ideograph -88E1East Asian ideograph -7D5DEast Asian ideograph -89A7East Asian ideograph -752AEast Asian ideograph -89E6East Asian ideograph -548FEast Asian ideograph -612CEast Asian ideograph -8ACCEast Asian ideograph -8B01East Asian ideograph -8AE9East Asian ideograph -5629East Asian ideograph -8B72East Asian ideograph -8B83East Asian ideograph -7AEAEast Asian ideograph -8277East Asian ideograph -732AEast Asian ideograph -72B2East Asian ideograph -8C98East Asian ideograph -72F8East Asian ideograph -8CADEast Asian ideograph -8CDBEast Asian ideograph -8D71East Asian ideograph -8D82East Asian ideograph -8E5FEast Asian ideograph -8DE5East Asian ideograph -8E7BEast Asian ideograph -8EB1East Asian ideograph -8F19East Asian ideograph -8EFDEast Asian ideograph -8FA2East Asian ideograph -8FA7East Asian ideograph -5EF5East Asian ideograph -8FEFEast Asian ideograph -8FE8East Asian ideograph -5FA7East Asian ideograph -5FA8East Asian ideograph -9013East Asian ideograph -8FE9East Asian ideograph -9089East Asian ideograph -96A3East Asian ideograph -9167East Asian ideograph -9196East Asian ideograph -920EEast Asian ideograph -8216East Asian ideograph -8021East Asian ideograph -9418East Asian ideograph -7145East Asian ideograph -7194East Asian ideograph -93C1East Asian ideograph -92B9East Asian ideograph -92F3East Asian ideograph -945AEast Asian ideograph -9587East Asian ideograph -6FF6East Asian ideograph -9665East Asian ideograph -5826East Asian ideograph -964FEast Asian ideograph -661CEast Asian ideograph -78D2East Asian ideograph -96A0East Asian ideograph -9CEBEast Asian ideograph -96BDEast Asian ideograph -96D1East Asian ideograph -9DC4East Asian ideograph -873AEast Asian ideograph -E9D2975AUnrelated variant of EACC 234C76 which maps to 975A -978CEast Asian ideograph -976DEast Asian ideograph -97EEEast Asian ideograph -980BEast Asian ideograph -9920East Asian ideograph -8218East Asian ideograph -99EEEast Asian ideograph -99DEEast Asian ideograph -99C8East Asian ideograph -9AC4East Asian ideograph -8EC6East Asian ideograph -9A0CEast Asian ideograph -6B1DEast Asian ideograph -9C0CEast Asian ideograph -9C53East Asian ideograph -9F08East Asian ideograph -9D76East Asian ideograph -9D5EEast Asian ideograph -5869East Asian ideograph -78B1East Asian ideograph -83FBEast Asian ideograph -5E85East Asian ideograph -9EC4East Asian ideograph -76B7East Asian ideograph -658BEast Asian ideograph -5C28East Asian ideograph -4E80East Asian ideograph -E9F6East Asian ideograph not in Unicode -5273East Asian ideograph -8123East Asian ideograph -55E2East Asian ideograph -E97C55D4Variant of 217164 which maps to 55D4 -56D3East Asian ideograph -9654East Asian ideograph -579BEast Asian ideograph -598DEast Asian ideograph -51A4East Asian ideograph -5D1FEast Asian ideograph -5ECFEast Asian ideograph -5F51East Asian ideograph -605AEast Asian ideograph -609BEast Asian ideograph -6128East Asian ideograph -6738East Asian ideograph -634DEast Asian ideograph -640BEast Asian ideograph -6332East Asian ideograph -651FEast Asian ideograph -5261East Asian ideograph -6528East Asian ideograph -630EEast Asian ideograph -52C5East Asian ideograph -69E3East Asian ideograph -657FEast Asian ideograph -65B5East Asian ideograph -714AEast Asian ideograph -66CDEast Asian ideograph -661DEast Asian ideograph -80ADEast Asian ideograph -690FEast Asian ideograph -684AEast Asian ideograph -7A1CEast Asian ideograph -7BA0East Asian ideograph -69B2East Asian ideograph -6AC1East Asian ideograph -6AA9East Asian ideograph -6CD0East Asian ideograph -6C73East Asian ideograph -E97D6C67Variant of 224739 which maps to 6C67 -6D64East Asian ideograph -6FA3East Asian ideograph -6CD9East Asian ideograph -6E7CEast Asian ideograph -6EA6East Asian ideograph -6DE5East Asian ideograph -6E86East Asian ideograph -6D38East Asian ideograph -7032East Asian ideograph -9800East Asian ideograph -6DE0East Asian ideograph -6F74East Asian ideograph -70B1East Asian ideograph -715BEast Asian ideograph -71FEEast Asian ideograph -73B3East Asian ideograph -74A2East Asian ideograph -75B8East Asian ideograph -7690East Asian ideograph -76A1East Asian ideograph -772DEast Asian ideograph -77C1East Asian ideograph -8020East Asian ideograph -7A19East Asian ideograph -7B04East Asian ideograph -7BE0East Asian ideograph -7B2EEast Asian ideograph -7B59East Asian ideograph -7BE6East Asian ideograph -6CD4East Asian ideograph -9908East Asian ideograph -7D4FEast Asian ideograph -7E27East Asian ideograph -7D63East Asian ideograph -5FADEast Asian ideograph -7D56East Asian ideograph -7E89East Asian ideograph -7516East Asian ideograph -7F48East Asian ideograph -7F82East Asian ideograph -7F58East Asian ideograph -8037East Asian ideograph -831CEast Asian ideograph -83F0East Asian ideograph -6A22East Asian ideograph -8507East Asian ideograph -E9D3868BUnrelated variant of EACC 23293D which maps to 868B -87B5East Asian ideograph -87CAEast Asian ideograph -88B5East Asian ideograph -7E48East Asian ideograph -89BBEast Asian ideograph -E9D489F5Unrelated variant of EACC 23315E which maps to 89F5 -8A7EEast Asian ideograph -8B1AEast Asian ideograph -8C7CEast Asian ideograph -8D91East Asian ideograph -8DD7East Asian ideograph -8E6EEast Asian ideograph -E9F7East Asian ideograph not in Unicode -8F3CEast Asian ideograph -900EEast Asian ideograph -914FEast Asian ideograph -E9D58019Unrelated variant of EACC 215266 which maps to 8019 -941AEast Asian ideograph -90B4East Asian ideograph -5F8FEast Asian ideograph -7CC7East Asian ideograph -9AE1East Asian ideograph -9ABEEast Asian ideograph -E9D69C51Unrelated variant of EACC 235945 which maps to 9C51 -9C1BEast Asian ideograph -9CECEast Asian ideograph -9D44East Asian ideograph -6EF7East Asian ideograph -9EA4East Asian ideograph -730AEast Asian ideograph -9EC9East Asian ideograph -9B12East Asian ideograph -6641East Asian ideograph -86A1East Asian ideograph -58F9East Asian ideograph -8FFAEast Asian ideograph -4E79East Asian ideograph -8CB3East Asian ideograph -4EAFEast Asian ideograph -5FC8East Asian ideograph -8B90East Asian ideograph -5F77East Asian ideograph -5FA0East Asian ideograph -4FFBEast Asian ideograph -5FBAEast Asian ideograph -4FA1East Asian ideograph -5150East Asian ideograph -4E21East Asian ideograph -4E93East Asian ideograph -518AEast Asian ideograph -6C37East Asian ideograph -51DBEast Asian ideograph -51FEEast Asian ideograph -5270East Asian ideograph -52E6East Asian ideograph -91FCEast Asian ideograph -5264East Asian ideograph -523CEast Asian ideograph -9628East Asian ideograph -53C1East Asian ideograph -53DCEast Asian ideograph -608BEast Asian ideograph -9A03East Asian ideograph -5449East Asian ideograph -5415East Asian ideograph -8656East Asian ideograph -9F69East Asian ideograph -9B28East Asian ideograph -8A92East Asian ideograph -5405East Asian ideograph -8FF4East Asian ideograph -576FEast Asian ideograph -9029East Asian ideograph -5B2DEast Asian ideograph -59C9East Asian ideograph -7895East Asian ideograph -8CECEast Asian ideograph -53A8East Asian ideograph -5E83East Asian ideograph -5E81East Asian ideograph -7D43East Asian ideograph -5F3AEast Asian ideograph -7030East Asian ideograph -4EFDEast Asian ideograph -5FB3East Asian ideograph -7652East Asian ideograph -E97E6168Variant of 213F22 which maps to 6168 -7718East Asian ideograph -51F4East Asian ideograph -5B3EEast Asian ideograph -61F4East Asian ideograph -6133East Asian ideograph -629BEast Asian ideograph -62D5East Asian ideograph -6425East Asian ideograph -629EEast Asian ideograph -62E1East Asian ideograph -53CEEast Asian ideograph -52B9East Asian ideograph -6559East Asian ideograph -6B5BEast Asian ideograph -89D4East Asian ideograph -65EFEast Asian ideograph -664BEast Asian ideograph -95C7East Asian ideograph -7156East Asian ideograph -6702East Asian ideograph -5932East Asian ideograph -76C3East Asian ideograph -6144East Asian ideograph -6918East Asian ideograph -7F47East Asian ideograph -826AEast Asian ideograph -8B99East Asian ideograph -E97F6B8BVariant of 274633 which maps to 6B8B -6BBBEast Asian ideograph -6C61East Asian ideograph -76C5East Asian ideograph -6CA1East Asian ideograph -6E2BEast Asian ideograph -6E5FEast Asian ideograph -6D1AEast Asian ideograph -6D1FEast Asian ideograph -6FECEast Asian ideograph -6FB9East Asian ideograph -60BDEast Asian ideograph -6D44East Asian ideograph -5A6CEast Asian ideograph -904AEast Asian ideograph -6CDDEast Asian ideograph -67D2East Asian ideograph -6F81East Asian ideograph -70D6East Asian ideograph -7133East Asian ideograph -934AEast Asian ideograph -91BCEast Asian ideograph -89DDEast Asian ideograph -754DEast Asian ideograph -E980753BVariant of 274C36 which maps to 753B -8E6FEast Asian ideograph -8E08East Asian ideograph -767AEast Asian ideograph -784EEast Asian ideograph -79A5East Asian ideograph -5EE9East Asian ideograph -7A49East Asian ideograph -7A93East Asian ideograph -7A91East Asian ideograph -54B2East Asian ideograph -9257East Asian ideograph -724BEast Asian ideograph -7A45East Asian ideograph -7E8DEast Asian ideograph -7D4CEast Asian ideograph -7EEEEast Asian ideograph -7DD1East Asian ideograph -7DABEast Asian ideograph -7DD0East Asian ideograph -6374East Asian ideograph -7D89East Asian ideograph -7E8EEast Asian ideograph -94B5East Asian ideograph -E9817F6EVariant of 215230 which maps to 7F6E -99E1East Asian ideograph -8989East Asian ideograph -8B71East Asian ideograph -7E59East Asian ideograph -71FFEast Asian ideograph -8061East Asian ideograph -80BBEast Asian ideograph -81D9East Asian ideograph -9AD5East Asian ideograph -67C1East Asian ideograph -8221East Asian ideograph -6CD6East Asian ideograph -8462East Asian ideograph -8406East Asian ideograph -8602East Asian ideograph -85ACEast Asian ideograph -87C1East Asian ideograph -8671East Asian ideograph -880EEast Asian ideograph -880FEast Asian ideograph -88E0East Asian ideograph -8943East Asian ideograph -88B4East Asian ideograph -97C8East Asian ideograph -658DEast Asian ideograph -89E7East Asian ideograph -54D7East Asian ideograph -8C4AEast Asian ideograph -8E28East Asian ideograph -5EF8East Asian ideograph -8A76East Asian ideograph -57DCEast Asian ideograph -9221East Asian ideograph -5257East Asian ideograph -9244East Asian ideograph -9452East Asian ideograph -90C4East Asian ideograph -96B7East Asian ideograph -9D08East Asian ideograph -9D70East Asian ideograph -9759East Asian ideograph -985BEast Asian ideograph -9855East Asian ideograph -98C3East Asian ideograph -8EB0East Asian ideograph -9A23East Asian ideograph -9C7BEast Asian ideograph -9EAAEast Asian ideograph -8534East Asian ideograph -76BCEast Asian ideograph -6589East Asian ideograph -6B6FEast Asian ideograph -7ADCEast Asian ideograph -524FEast Asian ideograph -6031East Asian ideograph -9F67East Asian ideograph -5CBDEast Asian ideograph -5FDEEast Asian ideograph -572CEast Asian ideograph -7BDAEast Asian ideograph -8022East Asian ideograph -8264East Asian ideograph -6D34East Asian ideograph -7162East Asian ideograph -7118East Asian ideograph -756DEast Asian ideograph -80ACEast Asian ideograph -75FEEast Asian ideograph -6900East Asian ideograph -589DEast Asian ideograph -7C7CEast Asian ideograph -7E1AEast Asian ideograph -58DCEast Asian ideograph -90C5East Asian ideograph -83C7East Asian ideograph -8B5BEast Asian ideograph -8B2DEast Asian ideograph -91BEEast Asian ideograph -98C8East Asian ideograph -9C76East Asian ideograph -8C8EEast Asian ideograph -82BEEast Asian ideograph -534BEast Asian ideograph -5EFCEast Asian ideograph -4E81East Asian ideograph -65BCEast Asian ideograph -4F0DEast Asian ideograph -9AE3East Asian ideograph -4F1DEast Asian ideograph -5227East Asian ideograph -61C3East Asian ideograph -965EEast Asian ideograph -604AEast Asian ideograph -5611East Asian ideograph -9FA2East Asian ideograph -8AE0East Asian ideograph -559EEast Asian ideograph -56F2East Asian ideograph -59B3East Asian ideograph -5BF3East Asian ideograph -5C97East Asian ideograph -E922Duplicate simplified ideograph -8D26East Asian ideograph -8907East Asian ideograph -8CC9East Asian ideograph -6142East Asian ideograph -60AAEast Asian ideograph -7609East Asian ideograph -6443East Asian ideograph -646DEast Asian ideograph -62E0East Asian ideograph -4FF2East Asian ideograph -5554East Asian ideograph -6644East Asian ideograph -8988East Asian ideograph -6AC2East Asian ideograph -826BEast Asian ideograph -E9826B96Variant of 214634 which maps to 6B96 -6C3EEast Asian ideograph -51C0East Asian ideograph -9061East Asian ideograph -6D5CEast Asian ideograph -6B12East Asian ideograph -792EEast Asian ideograph -9AE6East Asian ideograph -7546East Asian ideograph -7BEDEast Asian ideograph -9B3BEast Asian ideograph -9939East Asian ideograph -7D75East Asian ideograph -5BD8East Asian ideograph -66DCEast Asian ideograph -7094East Asian ideograph -85A6East Asian ideograph -5D0BEast Asian ideograph -6726East Asian ideograph -83DDEast Asian ideograph -854BEast Asian ideograph -56CCEast Asian ideograph -4E55East Asian ideograph -87A1East Asian ideograph -7DAFEast Asian ideograph -97E4East Asian ideograph -69FBEast Asian ideograph -8A3CEast Asian ideograph -58F2East Asian ideograph -983CEast Asian ideograph -91BBEast Asian ideograph -5277East Asian ideograph -9295East Asian ideograph -9274East Asian ideograph -7A7DEast Asian ideograph -5742East Asian ideograph -5F6BEast Asian ideograph -8987East Asian ideograph -55B0East Asian ideograph -9B2AEast Asian ideograph -5C20East Asian ideograph -E9839BFDVariant of 216223 which maps to 9BFD -521FEast Asian ideograph -E9F8East Asian ideograph not in Unicode -60A4East Asian ideograph -E98453A9Variant of 4C284C which maps to 53A9 -64C0East Asian ideograph -67B1East Asian ideograph -6855East Asian ideograph -7BEAEast Asian ideograph -80FCEast Asian ideograph -81D5East Asian ideograph -8842East Asian ideograph -8DB5East Asian ideograph -5E79East Asian ideograph -5023East Asian ideograph -84E1East Asian ideograph -8B3CEast Asian ideograph -8986East Asian ideograph -5379East Asian ideograph -614EEast Asian ideograph -638AEast Asian ideograph -E985542FVariant of 27424F which maps to 542F -7881East Asian ideograph -8263East Asian ideograph -9A69East Asian ideograph -4E97East Asian ideograph -5E30East Asian ideograph -51C8East Asian ideograph -6E08East Asian ideograph -7832East Asian ideograph -9DF0East Asian ideograph -7266East Asian ideograph -7582East Asian ideograph -6403East Asian ideograph -61DEEast Asian ideograph -517FEast Asian ideograph -8276East Asian ideograph -9586East Asian ideograph -E9F9East Asian ideograph not in Unicode -6B9EEast Asian ideograph -7431East Asian ideograph -99C5East Asian ideograph -5C1FEast Asian ideograph -69A6East Asian ideograph -8D30East Asian ideograph -5B82East Asian ideograph -5271East Asian ideograph -5AD0East Asian ideograph -56AEEast Asian ideograph -5EFBEast Asian ideograph -5F66East Asian ideograph -52E0East Asian ideograph -63DBEast Asian ideograph -6A10East Asian ideograph -7688East Asian ideograph -6C2FEast Asian ideograph -6CFAEast Asian ideograph -6E15East Asian ideograph -7523East Asian ideograph -7589East Asian ideograph -E986788CVariant of 214E43 which maps to 788C -7984East Asian ideograph -9896East Asian ideograph -7D0DEast Asian ideograph -53BFEast Asian ideograph -E987865EVariant of 21564B which maps to 865E -672FEast Asian ideograph -8BA0East Asian ideograph -E9888A25Variant of 215847 which maps to 8A25 -9485East Asian ideograph -953AEast Asian ideograph -97FFEast Asian ideograph -984FEast Asian ideograph -9963East Asian ideograph -98F0East Asian ideograph -9980East Asian ideograph -5E7AEast Asian ideograph -9F61East Asian ideograph -5ED0East Asian ideograph -76B2East Asian ideograph -E9898801Variant of 232C4D which maps to 8801 -8C2AEast Asian ideograph -8C2BEast Asian ideograph -8B9EEast Asian ideograph -8D4DEast Asian ideograph -949AEast Asian ideograph -94BCEast Asian ideograph -95F6East Asian ideograph -E98A97DEVariant of 234E5C which maps to 97DE -9957East Asian ideograph -E98B9BD6Variant of 23577A which maps to 9BD6 -9C3AEast Asian ideograph -58F1East Asian ideograph -4E8AEast Asian ideograph -5F10East Asian ideograph -6275East Asian ideograph -4E99East Asian ideograph -96E0East Asian ideograph -E98C4EE4Variant of 21306E which maps to 4EE4 -4EEDEast Asian ideograph -4F2BEast Asian ideograph -4FABEast Asian ideograph -E98D4F36Variant of 213144 which maps to 4F36 -5F95East Asian ideograph -723CEast Asian ideograph -E98E5029Variant of 213178 which maps to 5029 -5024East Asian ideograph -4EEEEast Asian ideograph -E9FAEast Asian ideograph not in Unicode -E98F50E7Variant of 21324E which maps to 50E7 -50BBEast Asian ideograph -5185East Asian ideograph -E9905168Variant of 213322 which maps to 5168 -E991634CVariant of 2D3324 which maps to 634C -F92EEast Asian ideograph -5204East Asian ideograph -82C5East Asian ideograph -520BEast Asian ideograph -522BEast Asian ideograph -5263East Asian ideograph -52B4East Asian ideograph -52F2East Asian ideograph -5DF5East Asian ideograph -E992537FVariant of 213474 which maps to 537F -55ECEast Asian ideograph -54CCEast Asian ideograph -8C18East Asian ideograph -8BF6East Asian ideograph -5A1AEast Asian ideograph -5358East Asian ideograph -5606East Asian ideograph -5C1CEast Asian ideograph -E9935668Variant of 213749 which maps to 5668 -5662East Asian ideograph -E99456A5Variant of 213758 which maps to 56A5 -53B3East Asian ideograph -56D8East Asian ideograph -56FDEast Asian ideograph -5186East Asian ideograph -56E3East Asian ideograph -56F3East Asian ideograph -57C0East Asian ideograph -E995586BVariant of 213850 which maps to 586B -E9FBEast Asian ideograph not in Unicode -5897East Asian ideograph -58C7East Asian ideograph -5727East Asian ideograph -5841East Asian ideograph -58CCEast Asian ideograph -57BBEast Asian ideograph -591BEast Asian ideograph -5942East Asian ideograph -5F09East Asian ideograph -5965East Asian ideograph -5333East Asian ideograph -5B22East Asian ideograph -5A2FEast Asian ideograph -805FEast Asian ideograph -88CAEast Asian ideograph -5B37East Asian ideograph -51A6East Asian ideograph -5B9FEast Asian ideograph -51A9East Asian ideograph -5BFEEast Asian ideograph -8132East Asian ideograph -5C64East Asian ideograph -6B67East Asian ideograph -5D8CEast Asian ideograph -5D15East Asian ideograph -5D5CEast Asian ideograph -5CE5East Asian ideograph -5DBAEast Asian ideograph -5DD3East Asian ideograph -5DCCEast Asian ideograph -949CEast Asian ideograph -5E2FEast Asian ideograph -5E64East Asian ideograph -53A6East Asian ideograph -5EC3East Asian ideograph -5EE3East Asian ideograph -53B0East Asian ideograph -5EF0East Asian ideograph -5F3EEast Asian ideograph -E9965F25Variant of 273D4C which maps to 5F25 -5F83East Asian ideograph -E9975F84Variant of 273D67 which maps to 5F84 -6035East Asian ideograph -6046East Asian ideograph -60C5East Asian ideograph -60A9East Asian ideograph -E998618EVariant of 213F40 which maps to 618E -5FDCEast Asian ideograph -E999601CVariant of 273F4B which maps to 601C -E99A61CAVariant of 213F50 which maps to 61CA -61D1East Asian ideograph -61F2East Asian ideograph -623BEast Asian ideograph -62DDEast Asian ideograph -629CEast Asian ideograph -62D0East Asian ideograph -627AEast Asian ideograph -62F4East Asian ideograph -6323East Asian ideograph -6368East Asian ideograph -6362East Asian ideograph -633FEast Asian ideograph -6442East Asian ideograph -643AEast Asian ideograph -64B9East Asian ideograph -6674East Asian ideograph -66A8East Asian ideograph -663FEast Asian ideograph -66F5East Asian ideograph -66FDEast Asian ideograph -67A9East Asian ideograph -6813East Asian ideograph -685FEast Asian ideograph -E99B6994Variant of 214534 which maps to 6994 -6804East Asian ideograph -69D8East Asian ideograph -6982East Asian ideograph -6955East Asian ideograph -6A2AEast Asian ideograph -9792East Asian ideograph -691CEast Asian ideograph -6A71East Asian ideograph -E99C6ADBVariant of 21456C which maps to 6ADB -823BEast Asian ideograph -685CEast Asian ideograph -6A29East Asian ideograph -6B53East Asian ideograph -6B74East Asian ideograph -6B81East Asian ideograph -6BB1East Asian ideograph -6C17East Asian ideograph -6C32East Asian ideograph -6C89East Asian ideograph -51BDEast Asian ideograph -6D99East Asian ideograph -6E05East Asian ideograph -E99D6DB5Variant of 214767 which maps to 6DB5 -51C5East Asian ideograph -6DA3East Asian ideograph -78C6East Asian ideograph -6E13East Asian ideograph -51D6East Asian ideograph -6F91East Asian ideograph -6F22East Asian ideograph -6E80East Asian ideograph -E99E6EDEVariant of 27485F which maps to 6EDE -6E89East Asian ideograph -6FF3East Asian ideograph -6CA2East Asian ideograph -E99F6FB3Variant of 214925 which maps to 6FB3 -6FEBEast Asian ideograph -6E0BEast Asian ideograph -6E16East Asian ideograph -56A0East Asian ideograph -6F45East Asian ideograph -7AC3East Asian ideograph -932CEast Asian ideograph -83F8East Asian ideograph -7115East Asian ideograph -6427East Asian ideograph -7188East Asian ideograph -55B6East Asian ideograph -71D7East Asian ideograph -7235East Asian ideograph -5C13East Asian ideograph -72A0East Asian ideograph -E9A0731CVariant of 214A74 which maps to 731C -72F0East Asian ideograph -7363East Asian ideograph -731FEast Asian ideograph -F9ADEast Asian ideograph -749CEast Asian ideograph -E9A17F3EVariant of 2D4B71 which maps to 7F3E -4EC0East Asian ideograph -7575East Asian ideograph -7573East Asian ideograph -75CAEast Asian ideograph -75F3East Asian ideograph -E9A2761FVariant of 214C67 which maps to 761F -7672East Asian ideograph -862FEast Asian ideograph -E9A376F4Variant of 214D45 which maps to 76F4 -8846East Asian ideograph -E9A4775BVariant of 214D59 which maps to 775B -66B8East Asian ideograph -E9A577D7Variant of 214D7B which maps to 77D7 -7B36East Asian ideograph -7814East Asian ideograph -5CFAEast Asian ideograph -78FAEast Asian ideograph -783FEast Asian ideograph -79D8East Asian ideograph -E9A67985Variant of 274E7B which maps to 7985 -7A50East Asian ideograph -E9A779F0Variant of 274F3C which maps to 79F0 -7A32East Asian ideograph -7A4FEast Asian ideograph -7B7AEast Asian ideograph -7C14East Asian ideograph -7C12East Asian ideograph -E9A87C27Variant of 215044 which maps to 7C27 -7C56East Asian ideograph -7CBEEast Asian ideograph -7CABEast Asian ideograph -7CF8East Asian ideograph -7DF4East Asian ideograph -7E01East Asian ideograph -770CEast Asian ideograph -7EF7East Asian ideograph -7DCFEast Asian ideograph -7E26East Asian ideograph -7E04East Asian ideograph -7F0BEast Asian ideograph -7E92East Asian ideograph -7D9AEast Asian ideograph -7E4AEast Asian ideograph -6B20East Asian ideograph -7F36East Asian ideograph -7F87East Asian ideograph -E9A97F9AVariant of 21523E which maps to 7F9A -7FAEEast Asian ideograph -7FCEEast Asian ideograph -7FFAEast Asian ideograph -E9AA66DCVariant of 39525B which maps to 66DC -8002East Asian ideograph -E9AB8046Variant of 21526E which maps to 8046 -8068East Asian ideograph -8080East Asian ideograph -695CEast Asian ideograph -E923Duplicate simplified ideograph -8133East Asian ideograph -9ACCEast Asian ideograph -81D3East Asian ideograph -E9AC81EDVariant of 215428 which maps to 81ED -6319East Asian ideograph -820EEast Asian ideograph -E9AD82D3Variant of 21546D which maps to 82D3 -8332East Asian ideograph -8392East Asian ideograph -E9AE83C1Variant of 21553A which maps to 83C1 -E9AF83BDVariant of 21553F which maps to 83BD -8420East Asian ideograph -77C7East Asian ideograph -85CDEast Asian ideograph -8535East Asian ideograph -82B8East Asian ideograph -7C54East Asian ideograph -E9B082A6Variant of 27563A which maps to 82A6 -6A98East Asian ideograph -51E6East Asian ideograph -E9B18708Variant of 21566A which maps to 8708 -E9B2873BVariant of 215671 which maps to 873B -86CDEast Asian ideograph -877FEast Asian ideograph -8827East Asian ideograph -8853East Asian ideograph -523EEast Asian ideograph -E9B38910Variant of 21576F which maps to 8910 -7ED4East Asian ideograph -7E7FEast Asian ideograph -897EEast Asian ideograph -E9B48983Variant of 215826 which maps to 8983 -899AEast Asian ideograph -89B3East Asian ideograph -4F89East Asian ideograph -8AA4East Asian ideograph -8ACBEast Asian ideograph -8B20East Asian ideograph -8A33East Asian ideograph -8AADEast Asian ideograph -5909East Asian ideograph -8273East Asian ideograph -734FEast Asian ideograph -72E2East Asian ideograph -8D2EEast Asian ideograph -621DEast Asian ideograph -8CCEEast Asian ideograph -8D08East Asian ideograph -E9B58DF5Variant of 275A68 which maps to 8DF5 -5C69East Asian ideograph -8E8DEast Asian ideograph -8F0CEast Asian ideograph -8F42East Asian ideograph -8EE2East Asian ideograph -8EE3East Asian ideograph -5F01East Asian ideograph -9038East Asian ideograph -9039East Asian ideograph -9059East Asian ideograph -9045East Asian ideograph -E924Duplicate simplified ideograph -8FBAEast Asian ideograph -961DEast Asian ideograph -E9B69119Variant of 215C72 which maps to 9119 -9139East Asian ideograph -9162East Asian ideograph -91B8East Asian ideograph -91C6East Asian ideograph -91C8East Asian ideograph -91E1East Asian ideograph -9234East Asian ideograph -8217East Asian ideograph -92ADEast Asian ideograph -93ADEast Asian ideograph -9421East Asian ideograph -922CEast Asian ideograph -95D4East Asian ideograph -95A2East Asian ideograph -E925Duplicate simplified ideograph -E9B79686Variant of 215F30 which maps to 9686 -6B92East Asian ideograph -967AEast Asian ideograph -51CBEast Asian ideograph -9D8FEast Asian ideograph -96E3East Asian ideograph -F9B2East Asian ideograph -7668East Asian ideograph -970AEast Asian ideograph -9752East Asian ideograph -9756East Asian ideograph -975BEast Asian ideograph -E9B8975CVariant of 215F73 which maps to 975C -9771East Asian ideograph -9818East Asian ideograph -981AEast Asian ideograph -985EEast Asian ideograph -991DEast Asian ideograph -994BEast Asian ideograph -99C4East Asian ideograph -9A08East Asian ideograph -9A12East Asian ideograph -99C6East Asian ideograph -9A13East Asian ideograph -81B8East Asian ideograph -9AEAEast Asian ideograph -95D8East Asian ideograph -9599East Asian ideograph -9D12East Asian ideograph -9D2CEast Asian ideograph -9D49East Asian ideograph -68BAEast Asian ideograph -E9B99EB8Variant of 27625C which maps to 9EB8 -9EBDEast Asian ideograph -9ED2East Asian ideograph -9ED9East Asian ideograph -9F21East Asian ideograph -9F62East Asian ideograph -4EB6East Asian ideography -4FE3East Asian ideograph -4EC2East Asian ideograph -7F83East Asian ideograph -6C8DEast Asian ideograph -F9A9East Asian ideograph -57D3East Asian ideograph -E9BA57F4Variant of 21763D which maps to 57F4 -590AEast Asian ideograph -5968East Asian ideograph -E9BB5BC3Variant of 217E6A which maps to 5BC3 -5C53East Asian ideograph -5C76East Asian ideograph -5D5BEast Asian ideograph -5D73East Asian ideograph -53A9East Asian ideograph -5EDBEast Asian ideograph -E9BC5F4DVariant of 222962 which maps to 5F4D -622CEast Asian ideograph -631DEast Asian ideograph -64B8East Asian ideograph -65D9East Asian ideograph -E9BD80ADVariant of 2E3A33 which maps to 80AD -6741East Asian ideograph -6859East Asian ideograph -6860East Asian ideograph -6798East Asian ideograph -6764East Asian ideograph -69C7East Asian ideograph -6922East Asian ideograph -8538East Asian ideograph -8223East Asian ideograph -6AAAEast Asian ideograph -69DEEast Asian ideograph -6A65East Asian ideograph -67A6East Asian ideograph -6B05East Asian ideograph -6B4EEast Asian ideograph -6CADEast Asian ideograph -6E0CEast Asian ideograph -6F62East Asian ideograph -6F99East Asian ideograph -6F46East Asian ideograph -6EDDEast Asian ideograph -701EEast Asian ideograph -8315East Asian ideograph -717AEast Asian ideograph -E9BE71E0Variant of 225447 which maps to 71E0 -4E2CEast Asian ideograph -729FEast Asian ideograph -73F1East Asian ideograph -E9BF74F4Variant of 225C61 which maps to 74F4 -7640East Asian ideograph -75EBEast Asian ideograph -7596East Asian ideograph -76B9East Asian ideograph -778BEast Asian ideograph -7839East Asian ideograph -78D9East Asian ideograph -78B9East Asian ideograph -E9D77962Unrelated variant of EACC 293032 which maps to 7962 -79EBEast Asian ideograph -7A06East Asian ideograph -7A63East Asian ideograph -E9C07B4CVariant of 226B62 which maps to 7B4C -7B9FEast Asian ideograph -7C31East Asian ideograph -7CCDEast Asian ideograph -7CE8East Asian ideograph -7EE6East Asian ideograph -7A39East Asian ideograph -7DFCEast Asian ideograph -E9C15FADVariant of 2E7328 which maps to 5FAD -7D4BEast Asian ideograph -80B7East Asian ideograph -817DEast Asian ideograph -815FEast Asian ideograph -82AEEast Asian ideograph -8343East Asian ideograph -8323East Asian ideograph -83B5East Asian ideograph -8770East Asian ideograph -E9C286C9Variant of 232962 which maps to 86C9 -87E5East Asian ideograph -E9C38872Variant of 232D75 which maps to 8872 -E9C48941Variant of 232F5D which maps to 8941 -7E5DEast Asian ideograph -891DEast Asian ideograph -88AEEast Asian ideograph -56AFEast Asian ideograph -8C25East Asian ideograph -544BEast Asian ideograph -8FB6East Asian ideograph -919BEast Asian ideograph -91DBEast Asian ideograph -E9C59306Variant of 23445B which maps to 9306 -954EEast Asian ideograph -952AEast Asian ideograph -9544East Asian ideograph -943EEast Asian ideograph -953FEast Asian ideograph -954CEast Asian ideograph -9229East Asian ideograph -9667East Asian ideograph -7EF1East Asian ideograph -988CEast Asian ideograph -98D1East Asian ideograph -98DAEast Asian ideograph -9942East Asian ideograph -9B2EEast Asian ideograph -9BE3East Asian ideograph -9CD0East Asian ideograph -9CA6East Asian ideograph -9BF5East Asian ideograph -51EBEast Asian ideograph -9D46East Asian ideograph -9DABEast Asian ideograph -9DC6East Asian ideograph -9D50East Asian ideograph -9E81East Asian ideograph -9F44East Asian ideograph -97F2East Asian ideograph -816DEast Asian ideograph -8CAEEast Asian ideograph -4E98East Asian ideograph -91D6East Asian ideograph -8BC3East Asian ideograph -51C3East Asian ideograph -8885East Asian ideograph -6C3DEast Asian ideograph -8FF3East Asian ideograph -822EEast Asian ideograph -852BEast Asian ideograph -9271East Asian ideograph -7E9FEast Asian ideograph -8616East Asian ideograph -9616East Asian ideograph -9988East Asian ideograph -51B4East Asian ideograph -734EEast Asian ideograph -E9C67E8AVariant of 22735D which maps to 7E8A -30FBIdeographic centered point -3005Ideographic iteration mark -30FCVowel elongation mark for kana -3008Ideographic less than sign -3009Ideographic greater than sign -300AIdeographic left double angle bracket -300BIdeographic right double angle bracket -3041Hiragana letter small A -3042Hiragana letter A -3043Hiragana letter small I -3044Hiragana letter I -3045Hiragana letter small U -3046Hiragana letter U -3047Hiragana letter small E -3048Hiragana letter E -3049Hiragana letter small O -304AHiragana letter O -304BHiragana letter KA -304CHiragana letter GA -304DHiragana letter KI -304EHiragana letter GI -304FHiragana letter KU -3050Hiragana letter GU -3051Hiragana letter KE -3052Hiragana letter GE -3053Hiragana letter KO -3054Hiragana letter GO -3055Hiragana letter SA -3056Hiragana letter ZA -3057Hiragana letter SI -3058Hiragana letter ZI -3059Hiragana letter SU -305AHiragana letter ZU -305BHiragana letter SE -305CHiragana letter ZE -305DHiragana letter SO -305EHiragana letter ZO -305FHiragana letter TA -3060Hiragana letter DA -3061Hiragana letter TI -3062Hiragana letter DI -3063Hiragana letter small TU -3064Hiragana letter TU -3065Hiragana letter DU -3066Hiragana letter TE -3067Hiragana letter DE -3068Hiragana letter TO -3069Hiragana letter DO -306AHiragana letter NA -306BHiragana letter NI -306CHiragana letter NU -306DHiragana letter NE -306EHiragana letter NO -306FHiragana letter HA -3070Hiragana letter BA -3071Hiragana letter PA -3072Hiragana letter HI -3073Hiragana letter BI -3074Hiragana letter PI -3075Hiragana letter HU -3076Hiragana letter BU -3077Hiragana letter PU -3078Hiragana letter HE -3079Hiragana letter BE -307AHiragana letter PE -307BHiragana letter HO -307CHiragana letter BO -307DHiragana letter PO -307EHiragana letter MA -307FHiragana letter MI -3080Hiragana letter MU -3081Hiragana letter ME -3082Hiragana letter MO -3083Hiragana letter small YA -3084Hiragana letter YA -3085Hiragana letter small YU -3086Hiragana letter YU -3087Hiragana letter small YO -3088Hiragana letter YO -3089Hiragana letter RA -308AHiragana letter RI -308BHiragana letter RU -308CHiragana letter RE -308DHiragana letter RO -308EHiragana letter small WA -308FHiragana letter WA -3090Hiragana letter WI -3091Hiragana letter WE -3092Hiragana letter WO -3093Hiragana letter N -30A1Katakana letter small A -30A2Katakana letter A -30A3Katakana letter small I -30A4Katakana letter I -30A5Katakana letter small U -30A6Katakana letter U -30A7Katakana letter small E -30A8Katakana letter E -30A9Katakana letter small O -30AAKatakana letter O -30ABKatakana letter KA -30ACKatakana letter GA -30ADKatakana letter KI -30AEKatakana letter GI -30AFKatakana letter KU -30B0Katakana letter GU -30B1Katakana letter KE -30B2Katakana letter GE -30B3Katakana letter KO -30B4Katakana letter GO -30B5Katakana letter SA -30B6Katakana letter ZA -30B7Katakana letter SI -30B8Katakana letter ZI -30B9Katakana letter SU -30BAKatakana letter ZU -30BBKatakana letter SE -30BCKatakana letter ZE -30BDKatakana letter SO -30BFKatakana letter TA -30C0Katakana letter DA -30C1Katakana letter TI -30C2Katakana letter DI -30C3Katakana letter small TU -30C4Katakana letter TU -30C5Katakana letter DU -30C6Katakana letter TE -30C7Katakana letter DE -30C8Katakana letter TO -30C9Katakana letter DO -30CAKatakana letter NA -30CBKatakana letter NI -30CCKatakana letter NU -30CDKatakana letter NE -30CEKatakana letter NO -30CFKatakana letter HA -30D0Katakana letter BA -30D1Katakana letter PA -30D2Katakana letter HI -30D3Katakana letter BI -30D4Katakana letter PI -30D5Katakana letter HU -30D6Katakana letter BU -30D7Katakana letter PU -30D8Katakana letter HE -30D9Katakana letter BE -30DAKatakana letter PE -30DBKatakana letter HO -30DCKatakana letter BO -30DDKatakana letter PO -30DEKatakana letter MA -30DFKatakana letter MI -30E0Katakana letter MU -30E1Katakana letter ME -30E2Katakana letter MO -30E3Katakana letter small YA -30E4Katakana letter YA -30E5Katakana letter small YU -30E6Katakana letter YU -30E7Katakana letter small YO -30E8Katakana letter YO -30E9Katakana letter RA -30EAKatakana letter RI -30EBKatakana letter RU -30ECKatakana letter RE -30EDKatakana letter RO -30EEKatakana letter small WA -30EFKatakana letter WA -30F0Katakana letter WI -30F1Katakana letter WE -30F2Katakana letter WO -30F3Katakana letter N -30F4Katakana letter VU -30F5Katakana letter small KA -30F6Katakana letter small KE -309BKatakana-hiragana voiced sound mark -309CKatakana-hiragana semi-voiced sound mark -7C82East Asian ideograph -9D2BEast Asian ideograph -96EBEast Asian ideograph -51EAEast Asian ideograph -5302East Asian ideograph -7872East Asian ideograph -7560East Asian ideograph -567AEast Asian ideograph -9EBFEast Asian ideograph -6762East Asian ideograph -5301East Asian ideograph -9453East Asian ideograph -5116East Asian ideograph -51E9East Asian ideograph -53FAEast Asian ideograph -54D8East Asian ideograph -555DEast Asian ideograph -56CEEast Asian ideograph -5726East Asian ideograph -5737East Asian ideograph -57B3East Asian ideograph -57AAEast Asian ideograph -57B0East Asian ideograph -57D6East Asian ideograph -5870East Asian ideograph -58B9East Asian ideograph -58B8East Asian ideograph -58D7East Asian ideograph -58E5East Asian ideograph -5B36East Asian ideograph -4E62East Asian ideograph -599BEast Asian ideograph -5CBBEast Asian ideograph -5CBCEast Asian ideograph -5CC5East Asian ideograph -5CBEEast Asian ideograph -5D76East Asian ideograph -5D90East Asian ideograph -5F16East Asian ideograph -5F41East Asian ideograph -603AEast Asian ideograph -6327East Asian ideograph -63B5East Asian ideograph -64F6East Asian ideograph -6683East Asian ideograph -66BCEast Asian ideograph -6737East Asian ideograph -6926East Asian ideograph -6925East Asian ideograph -6928East Asian ideograph -6923East Asian ideograph -6921East Asian ideograph -697EEast Asian ideograph -6981East Asian ideograph -69DDEast Asian ideograph -6A2EEast Asian ideograph -6A78East Asian ideograph -6B1FEast Asian ideograph -6E82East Asian ideograph -7195East Asian ideograph -74F2East Asian ideograph -753CEast Asian ideograph -7549East Asian ideograph -7569East Asian ideograph -7874East Asian ideograph -78B5East Asian ideograph -7907East Asian ideograph -7A43East Asian ideograph -7B02East Asian ideograph -7C13East Asian ideograph -7C17East Asian ideograph -7BF6East Asian ideograph -7C90East Asian ideograph -7CADEast Asian ideograph -7CC0East Asian ideograph -7CD8East Asian ideograph -7E05East Asian ideograph -7E83East Asian ideograph -7DD5East Asian ideograph -7E90East Asian ideograph -81A4East Asian ideograph -825DEast Asian ideograph -8422East Asian ideograph -84D9East Asian ideograph -8630East Asian ideograph -86ABEast Asian ideograph -86EFEast Asian ideograph -87D0East Asian ideograph -88B0East Asian ideograph -88C3East Asian ideograph -8904East Asian ideograph -8977East Asian ideograph -8ADAEast Asian ideograph -8EBEEast Asian ideograph -8EC5East Asian ideograph -8EC8East Asian ideograph -8F4CEast Asian ideograph -9027East Asian ideograph -9056East Asian ideograph -91DFEast Asian ideograph -933BEast Asian ideograph -958AEast Asian ideograph -9596East Asian ideograph -9666East Asian ideograph -9779East Asian ideograph -9786East Asian ideograph -9790East Asian ideograph -98AAEast Asian ideograph -99F2East Asian ideograph -9ADEEast Asian ideograph -9AF1East Asian ideograph -9AF7East Asian ideograph -9B96East Asian ideograph -9BB4East Asian ideograph -9BCFEast Asian ideograph -9BD1East Asian ideograph -9BF2East Asian ideograph -9C30East Asian ideograph -9C5AEast Asian ideograph -9D48East Asian ideograph -9D64East Asian ideograph -3131Korean hangul -3134Korean hangul -3137Korean hangul -3139Korean hangul -3141Korean hangul -3142Korean hangul -3145Korean hangul -3147Korean hangul -3148Korean hangul -314AKorean hangul -314BKorean hangul -314CKorean hangul -314DKorean hangul -314EKorean hangul -3132Korean hangul -3138Korean hangul -3143Korean hangul -3146Korean hangul -3149Korean hangul -314FKorean hangul -3150Korean hangul -3151Korean hangul -3153Korean hangul -3154Korean hangul -3155Korean hangul -3157Korean hangul -3158Korean hangul -315BKorean hangul -315CKorean hangul -3160Korean hangul -3161Korean hangul -3162Korean hangul -3163Korean hangul -AC00Korean hangul -AC01Korean hangul -AC02Korean hangul -AC04Korean hangul -AC07Korean hangul -AC08Korean hangul -AC09Korean hangul -AC10Korean hangul -AC11Korean hangul -AC12Korean hangul -AC13Korean hangul -AC14Korean hangul -AC15Korean hangul -AC16Korean hangul -AC17Korean hangul -AC19Korean hangul -AC1AKorean hangul -AC1BKorean hangul -AC1CKorean hangul -AC1DKorean hangul -AC20Korean hangul -AC24Korean hangul -AC2CKorean hangul -AC2DKorean hangul -AC2FKorean hangul -AC30Korean hangul -AC31Korean hangul -AC38Korean hangul -AC39Korean hangul -AC40Korean hangul -AC54Korean hangul -AC70Korean hangul -AC71Korean hangul -AC74Korean hangul -AC77Korean hangul -AC78Korean hangul -AC79Korean hangul -AC80Korean hangul -AC81Korean hangul -AC83Korean hangul -AC84Korean hangul -AC85Korean hangul -AC86Korean hangul -AC89Korean hangul -AC8AKorean hangul -AC8BKorean hangul -AC8CKorean hangul -AC90Korean hangul -AC94Korean hangul -AC9CKorean hangul -AC9FKorean hangul -ACA0Korean hangul -ACA1Korean hangul -ACA8Korean hangul -ACA9Korean hangul -ACAAKorean hangul -ACACKorean hangul -ACAFKorean hangul -ACB0Korean hangul -ACB8Korean hangul -ACB9Korean hangul -ACBCKorean hangul -ACBDKorean hangul -ACC1Korean hangul -ACC4Korean hangul -ACD7Korean hangul -ACE0Korean hangul -ACE1Korean hangul -ACE4Korean hangul -ACE7Korean hangul -ACE8Korean hangul -ACEAKorean hangul -ACECKorean hangul -ACEFKorean hangul -ACF0Korean hangul -ACF1Korean hangul -ACF3Korean hangul -ACF5Korean hangul -ACF6Korean hangul -ACFAKorean hangul -ACFCKorean hangul -ACFDKorean hangul -AD00Korean hangul -AD04Korean hangul -AD0CKorean hangul -AD0DKorean hangul -AD0FKorean hangul -AD11Korean hangul -AD18Korean hangul -AD19Korean hangul -AD1CKorean hangul -AD20Korean hangul -AD28Korean hangul -AD29Korean hangul -AD2DKorean hangul -AD34Korean hangul -AD38Korean hangul -AD3CKorean hangul -AD44Korean hangul -AD49Korean hangul -AD50Korean hangul -AD6CKorean hangul -AD6DKorean hangul -AD70Korean hangul -AD73Korean hangul -AD74Korean hangul -AD75Korean hangul -AD76Korean hangul -AD7CKorean hangul -AD7DKorean hangul -AD7FKorean hangul -AD81Korean hangul -AD82Korean hangul -AD88Korean hangul -AD8CKorean hangul -AD90Korean hangul -ADA4Korean hangul -ADC0Korean hangul -ADC4Korean hangul -ADC8Korean hangul -ADD0Korean hangul -ADD1Korean hangul -ADD3Korean hangul -ADDCKorean hangul -ADE0Korean hangul -ADE4Korean hangul -ADECKorean hangul -ADF8Korean hangul -ADF9Korean hangul -ADFCKorean hangul -ADFFKorean hangul -AE00Korean hangul -AE01Korean hangul -AE08Korean hangul -AE09Korean hangul -AE0BKorean hangul -AE0DKorean hangul -AE30Korean hangul -AE31Korean hangul -AE34Korean hangul -AE37Korean hangul -AE38Korean hangul -AE40Korean hangul -AE41Korean hangul -AE43Korean hangul -AE44Korean hangul -AE45Korean hangul -AE4AKorean hangul -AE4CKorean hangul -AE4DKorean hangul -AE4EKorean hangul -AE50Korean hangul -AE54Korean hangul -AE5CKorean hangul -AE5DKorean hangul -AE60Korean hangul -AE61Korean hangul -AE62Korean hangul -AE65Korean hangul -AE68Korean hangul -AE69Korean hangul -AE6CKorean hangul -AE70Korean hangul -AE78Korean hangul -AE79Korean hangul -AE7BKorean hangul -AE7CKorean hangul -AE7DKorean hangul -AE84Korean hangul -AE85Korean hangul -AEBCKorean hangul -AEBDKorean hangul -AEBEKorean hangul -AEC0Korean hangul -AEC4Korean hangul -AECCKorean hangul -AECDKorean hangul -AECFKorean hangul -AED0Korean hangul -AED1Korean hangul -AED8Korean hangul -AEDCKorean hangul -AEF4Korean hangul -AF0DKorean hangul -AF2CKorean hangul -AF2DKorean hangul -AF30Korean hangul -AF34Korean hangul -AF3CKorean hangul -AF3DKorean hangul -AF3FKorean hangul -AF41Korean hangul -AF42Korean hangul -AF43Korean hangul -AF48Korean hangul -AF49Korean hangul -AF4CKorean hangul -AF58Korean hangul -AF5CKorean hangul -AF5DKorean hangul -AF64Korean hangul -AF65Korean hangul -AF79Korean hangul -AF80Korean hangul -AF84Korean hangul -AF88Korean hangul -AF90Korean hangul -AF95Korean hangul -AF9CKorean hangul -AFB8Korean hangul -AFB9Korean hangul -AFBCKorean hangul -AFC0Korean hangul -AFC7Korean hangul -AFC8Korean hangul -AFC9Korean hangul -AFCBKorean hangul -AFCDKorean hangul -AFCEKorean hangul -AFD4Korean hangul -AFD8Korean hangul -AFE9Korean hangul -AFF0Korean hangul -B000Korean hangul -B00CKorean hangul -B00DKorean hangul -B010Korean hangul -B014Korean hangul -B01CKorean hangul -B01DKorean hangul -B028Korean hangul -B044Korean hangul -B045Korean hangul -B048Korean hangul -B04AKorean hangul -B04CKorean hangul -B053Korean hangul -B054Korean hangul -B055Korean hangul -B057Korean hangul -B059Korean hangul -B05DKorean hangul -B07CKorean hangul -B07DKorean hangul -B080Korean hangul -B084Korean hangul -B08CKorean hangul -B08DKorean hangul -B08FKorean hangul -B090Korean hangul -B091Korean hangul -B098Korean hangul -B099Korean hangul -B09AKorean hangul -B09CKorean hangul -B09FKorean hangul -B0A0Korean hangul -B0A1Korean hangul -B0A8Korean hangul -B0A9Korean hangul -B0ABKorean hangul -B0ACKorean hangul -B0ADKorean hangul -B0AEKorean hangul -B0AFKorean hangul -B0B1Korean hangul -B0B3Korean hangul -B0B4Korean hangul -B0B5Korean hangul -B0B8Korean hangul -B0BBKorean hangul -B0BCKorean hangul -B0C4Korean hangul -B0C5Korean hangul -B0C7Korean hangul -B0C8Korean hangul -B0C9Korean hangul -B0D0Korean hangul -B0D1Korean hangul -B0E0Korean hangul -B0E5Korean hangul -B0ECKorean hangul -B108Korean hangul -B109Korean hangul -B10BKorean hangul -B10CKorean hangul -B10FKorean hangul -B110Korean hangul -B113Korean hangul -B118Korean hangul -B119Korean hangul -B11BKorean hangul -B11CKorean hangul -B11DKorean hangul -B11EKorean hangul -B123Korean hangul -B124Korean hangul -B125Korean hangul -B128Korean hangul -B12CKorean hangul -B134Korean hangul -B135Korean hangul -B137Korean hangul -B140Korean hangul -B141Korean hangul -B144Korean hangul -B150Korean hangul -B151Korean hangul -B153Korean hangul -B154Korean hangul -B155Korean hangul -B158Korean hangul -B15CKorean hangul -B178Korean hangul -B179Korean hangul -B17AKorean hangul -B17CKorean hangul -B180Korean hangul -B188Korean hangul -B189Korean hangul -B18BKorean hangul -B18DKorean hangul -B192Korean hangul -B193Korean hangul -B194Korean hangul -B1A8Korean hangul -B1CCKorean hangul -B1D0Korean hangul -B1D4Korean hangul -B1DCKorean hangul -B1E8Korean hangul -B1FDKorean hangul -B204Korean hangul -B205Korean hangul -B208Korean hangul -B20BKorean hangul -B20CKorean hangul -B213Korean hangul -B214Korean hangul -B215Korean hangul -B217Korean hangul -B220Korean hangul -B233Korean hangul -B234Korean hangul -B258Korean hangul -B25CKorean hangul -B260Korean hangul -B268Korean hangul -B269Korean hangul -B274Korean hangul -B284Korean hangul -B289Korean hangul -B290Korean hangul -B291Korean hangul -B294Korean hangul -B298Korean hangul -B299Korean hangul -B2A0Korean hangul -B2A1Korean hangul -B2A5Korean hangul -B2A6Korean hangul -B2AAKorean hangul -B2ACKorean hangul -B2C8Korean hangul -B2C9Korean hangul -B2CCKorean hangul -B2D0Korean hangul -B2D8Korean hangul -B2D9Korean hangul -B2DBKorean hangul -B2DDKorean hangul -B2E2Korean hangul -B2E4Korean hangul -B2E5Korean hangul -B2E6Korean hangul -B2E8Korean hangul -B2EBKorean hangul -B2ECKorean hangul -B2EDKorean hangul -B2EEKorean hangul -B2F3Korean hangul -B2F4Korean hangul -B2F5Korean hangul -B2F7Korean hangul -B2F9Korean hangul -B2FAKorean hangul -B2FBKorean hangul -B2FFKorean hangul -B300Korean hangul -B301Korean hangul -B304Korean hangul -B308Korean hangul -B310Korean hangul -B311Korean hangul -B313Korean hangul -B314Korean hangul -B315Korean hangul -B354Korean hangul -B355Korean hangul -B358Korean hangul -B35BKorean hangul -B35CKorean hangul -B35FKorean hangul -B364Korean hangul -B365Korean hangul -B367Korean hangul -B368Korean hangul -B369Korean hangul -B36AKorean hangul -B36BKorean hangul -B36EKorean hangul -B370Korean hangul -B371Korean hangul -B374Korean hangul -B378Korean hangul -B380Korean hangul -B383Korean hangul -B385Korean hangul -B38CKorean hangul -B3C4Korean hangul -B3C5Korean hangul -B3C8Korean hangul -B3CBKorean hangul -B3CCKorean hangul -B3D0Korean hangul -B3D4Korean hangul -B3D5Korean hangul -B3D7Korean hangul -B3D9Korean hangul -B3DBKorean hangul -B3FCKorean hangul -B400Korean hangul -B410Korean hangul -B418Korean hangul -B41CKorean hangul -B420Korean hangul -B428Korean hangul -B429Korean hangul -B42BKorean hangul -B42CKorean hangul -B450Korean hangul -B451Korean hangul -B454Korean hangul -B458Korean hangul -B460Korean hangul -B461Korean hangul -B463Korean hangul -B465Korean hangul -B46CKorean hangul -B480Korean hangul -B488Korean hangul -B4A4Korean hangul -B4B7Korean hangul -B4C0Korean hangul -B4D0Korean hangul -B4DCKorean hangul -B4DDKorean hangul -B4E0Korean hangul -B4E3Korean hangul -B4E4Korean hangul -B4ECKorean hangul -B4EDKorean hangul -B4EFKorean hangul -B4F1Korean hangul -B514Korean hangul -B515Korean hangul -B518Korean hangul -B51BKorean hangul -B51CKorean hangul -B524Korean hangul -B525Korean hangul -B527Korean hangul -B528Korean hangul -B529Korean hangul -B52AKorean hangul -B530Korean hangul -B531Korean hangul -B532Korean hangul -B534Korean hangul -B537Korean hangul -B538Korean hangul -B540Korean hangul -B541Korean hangul -B543Korean hangul -B544Korean hangul -B545Korean hangul -B54BKorean hangul -B54CKorean hangul -B54DKorean hangul -B550Korean hangul -B554Korean hangul -B55CKorean hangul -B55DKorean hangul -B55FKorean hangul -B560Korean hangul -B561Korean hangul -B5A0Korean hangul -B5A1Korean hangul -B5A4Korean hangul -B5A8Korean hangul -B5ABKorean hangul -B5B0Korean hangul -B5B1Korean hangul -B5B3Korean hangul -B5B4Korean hangul -B5B5Korean hangul -B5BBKorean hangul -B5BCKorean hangul -B5C0Korean hangul -B5C4Korean hangul -B5CCKorean hangul -B5CFKorean hangul -B5D1Korean hangul -B610Korean hangul -B611Korean hangul -B614Korean hangul -B618Korean hangul -B625Korean hangul -B664Korean hangul -B69CKorean hangul -B69DKorean hangul -B6A4Korean hangul -B6ABKorean hangul -B6ACKorean hangul -B6B1Korean hangul -B6F0Korean hangul -B6F4Korean hangul -B6F8Korean hangul -B700Korean hangul -B701Korean hangul -B728Korean hangul -B729Korean hangul -B72CKorean hangul -B72FKorean hangul -B730Korean hangul -B738Korean hangul -B739Korean hangul -B73BKorean hangul -B744Korean hangul -B748Korean hangul -B760Korean hangul -B764Korean hangul -B768Korean hangul -B770Korean hangul -B771Korean hangul -B775Korean hangul -B77CKorean hangul -B77DKorean hangul -B780Korean hangul -B784Korean hangul -B78CKorean hangul -B78DKorean hangul -B78FKorean hangul -B790Korean hangul -B791Korean hangul -B797Korean hangul -B798Korean hangul -B799Korean hangul -B79CKorean hangul -B7A0Korean hangul -B7A8Korean hangul -B7A9Korean hangul -B7ABKorean hangul -B7ACKorean hangul -B7ADKorean hangul -B7B4Korean hangul -B7B5Korean hangul -B7C9Korean hangul -B7ECKorean hangul -B7EDKorean hangul -B7F0Korean hangul -B7F4Korean hangul -B7FCKorean hangul -B7FDKorean hangul -B7FFKorean hangul -B800Korean hangul -B801Korean hangul -B807Korean hangul -B808Korean hangul -B809Korean hangul -B80CKorean hangul -B810Korean hangul -B818Korean hangul -B819Korean hangul -B81BKorean hangul -B81DKorean hangul -B824Korean hangul -B825Korean hangul -B828Korean hangul -B82CKorean hangul -B834Korean hangul -B835Korean hangul -B837Korean hangul -B838Korean hangul -B839Korean hangul -B840Korean hangul -B85CKorean hangul -B85DKorean hangul -B860Korean hangul -B864Korean hangul -B86CKorean hangul -B86DKorean hangul -B86FKorean hangul -B871Korean hangul -B8B0Korean hangul -B8CCKorean hangul -B8E1Korean hangul -B8E8Korean hangul -B8E9Korean hangul -B8ECKorean hangul -B8F0Korean hangul -B8F8Korean hangul -B8F9Korean hangul -B8FBKorean hangul -B8FDKorean hangul -B904Korean hangul -B93CKorean hangul -B958Korean hangul -B959Korean hangul -B95CKorean hangul -B960Korean hangul -B968Korean hangul -B96DKorean hangul -B974Korean hangul -B975Korean hangul -B978Korean hangul -B97CKorean hangul -B984Korean hangul -B985Korean hangul -B987Korean hangul -B989Korean hangul -B98EKorean hangul -B9ACKorean hangul -B9ADKorean hangul -B9B0Korean hangul -B9B4Korean hangul -B9BCKorean hangul -B9BDKorean hangul -B9BFKorean hangul -B9C1Korean hangul -B9C8Korean hangul -B9C9Korean hangul -B9CCKorean hangul -B9CEKorean hangul -B9CFKorean hangul -B9D0Korean hangul -B9D1Korean hangul -B9D8Korean hangul -B9D9Korean hangul -B9DBKorean hangul -B9DDKorean hangul -B9DEKorean hangul -B9E1Korean hangul -B9E3Korean hangul -B9E4Korean hangul -B9E5Korean hangul -B9E8Korean hangul -B9ECKorean hangul -B9F4Korean hangul -B9F5Korean hangul -B9F7Korean hangul -B9F8Korean hangul -B9F9Korean hangul -B9FAKorean hangul -BA00Korean hangul -BA38Korean hangul -BA39Korean hangul -BA3CKorean hangul -BA40Korean hangul -BA48Korean hangul -BA49Korean hangul -BA4BKorean hangul -BA4DKorean hangul -BA4EKorean hangul -BA53Korean hangul -BA54Korean hangul -BA55Korean hangul -BA58Korean hangul -BA5CKorean hangul -BA64Korean hangul -BA65Korean hangul -BA67Korean hangul -BA70Korean hangul -BA71Korean hangul -BA74Korean hangul -BA78Korean hangul -BA83Korean hangul -BA84Korean hangul -BA85Korean hangul -BA87Korean hangul -BAA8Korean hangul -BAA9Korean hangul -BAABKorean hangul -BAACKorean hangul -BAB0Korean hangul -BAB8Korean hangul -BAB9Korean hangul -BABBKorean hangul -BABDKorean hangul -BAC3Korean hangul -BAFCKorean hangul -BB0FKorean hangul -BB18Korean hangul -BB34Korean hangul -BB35Korean hangul -BB36Korean hangul -BB38Korean hangul -BB3BKorean hangul -BB3CKorean hangul -BB3DKorean hangul -BB44Korean hangul -BB47Korean hangul -BB49Korean hangul -BB4DKorean hangul -BB4FKorean hangul -BB50Korean hangul -BB54Korean hangul -BB58Korean hangul -BB61Korean hangul -BB63Korean hangul -BB88Korean hangul -BB8CKorean hangul -BBA4Korean hangul -BBC0Korean hangul -BBC4Korean hangul -BBC8Korean hangul -BBD0Korean hangul -BBF8Korean hangul -BBF9Korean hangul -BBFCKorean hangul -BBFFKorean hangul -BC00Korean hangul -BC08Korean hangul -BC09Korean hangul -BC0BKorean hangul -BC0DKorean hangul -BC0FKorean hangul -BC11Korean hangul -BBB4Korean hangul -BC14Korean hangul -BC15Korean hangul -BC16Korean hangul -BC18Korean hangul -BC1BKorean hangul -BC1CKorean hangul -BC1DKorean hangul -BC1FKorean hangul -BC24Korean hangul -BC25Korean hangul -BC27Korean hangul -BC29Korean hangul -BC2DKorean hangul -BC30Korean hangul -BC31Korean hangul -BC34Korean hangul -BC37Korean hangul -BC38Korean hangul -BC40Korean hangul -BC41Korean hangul -BC43Korean hangul -BC44Korean hangul -BC45Korean hangul -BC84Korean hangul -BC85Korean hangul -BC88Korean hangul -BC8BKorean hangul -BC8CKorean hangul -BC94Korean hangul -BC95Korean hangul -BC97Korean hangul -BC98Korean hangul -BC99Korean hangul -BC9AKorean hangul -BCA0Korean hangul -BCA1Korean hangul -BCA4Korean hangul -BCA7Korean hangul -BCA8Korean hangul -BCB0Korean hangul -BCB1Korean hangul -BCB3Korean hangul -BCB5Korean hangul -BCBCKorean hangul -BCBDKorean hangul -BCC0Korean hangul -BCC4Korean hangul -BCCCKorean hangul -BCCDKorean hangul -BCCFKorean hangul -BCD0Korean hangul -BCD1Korean hangul -BCD2Korean hangul -BCD5Korean hangul -BCF4Korean hangul -BCF5Korean hangul -BCF6Korean hangul -BCF8Korean hangul -BCFCKorean hangul -BD04Korean hangul -BD05Korean hangul -BD07Korean hangul -BD09Korean hangul -BD10Korean hangul -BD14Korean hangul -BD24Korean hangul -BD48Korean hangul -BD49Korean hangul -BD4CKorean hangul -BD50Korean hangul -BD58Korean hangul -BD59Korean hangul -BD64Korean hangul -BD80Korean hangul -BD81Korean hangul -BD84Korean hangul -BD87Korean hangul -BD88Korean hangul -BD89Korean hangul -BD90Korean hangul -BD91Korean hangul -BD93Korean hangul -BD95Korean hangul -BD99Korean hangul -BD9CKorean hangul -BDD4Korean hangul -BDF0Korean hangul -BE0CKorean hangul -BE0DKorean hangul -BE10Korean hangul -BE14Korean hangul -BE1CKorean hangul -BE1DKorean hangul -BE1FKorean hangul -BE44Korean hangul -BE45Korean hangul -BE48Korean hangul -BE4BKorean hangul -BE4CKorean hangul -BE4EKorean hangul -BE54Korean hangul -BE55Korean hangul -BE57Korean hangul -BE59Korean hangul -BE5AKorean hangul -BE5BKorean hangul -BE60Korean hangul -BE61Korean hangul -BE64Korean hangul -BE68Korean hangul -BE70Korean hangul -BE71Korean hangul -BE73Korean hangul -BE74Korean hangul -BE75Korean hangul -BE7BKorean hangul -BE7CKorean hangul -BE7DKorean hangul -BE80Korean hangul -BE84Korean hangul -BE8CKorean hangul -BE8FKorean hangul -BE90Korean hangul -BE91Korean hangul -BE98Korean hangul -BEA8Korean hangul -BED0Korean hangul -BED1Korean hangul -BED4Korean hangul -BED7Korean hangul -BED8Korean hangul -BEE0Korean hangul -BEE3Korean hangul -BEE4Korean hangul -BEE5Korean hangul -BEECKorean hangul -BF08Korean hangul -BF09Korean hangul -BF18Korean hangul -BF1DKorean hangul -BF40Korean hangul -BF41Korean hangul -BF44Korean hangul -BF48Korean hangul -BF50Korean hangul -BF51Korean hangul -BF55Korean hangul -BFB0Korean hangul -BFC0Korean hangul -BFC5Korean hangul -BFCCKorean hangul -BFCDKorean hangul -BFD0Korean hangul -BFD4Korean hangul -BFDCKorean hangul -BFDDKorean hangul -BFE1Korean hangul -C058Korean hangul -C059Korean hangul -C05CKorean hangul -C060Korean hangul -C068Korean hangul -C069Korean hangul -C090Korean hangul -C091Korean hangul -C094Korean hangul -C098Korean hangul -C0A0Korean hangul -C0A3Korean hangul -C0A5Korean hangul -C0ACKorean hangul -C0ADKorean hangul -C0AEKorean hangul -C0AFKorean hangul -C0B0Korean hangul -C0B3Korean hangul -C0B4Korean hangul -C0B5Korean hangul -C0B6Korean hangul -C0BCKorean hangul -C0BDKorean hangul -C0BFKorean hangul -C0C0Korean hangul -C0C1Korean hangul -C0C5Korean hangul -C0C8Korean hangul -C0C9Korean hangul -C0CCKorean hangul -C0CFKorean hangul -C0D0Korean hangul -C0D8Korean hangul -C0D9Korean hangul -C0DBKorean hangul -C0DCKorean hangul -C0DDKorean hangul -C0E4Korean hangul -C0E5Korean hangul -C0E8Korean hangul -C0ECKorean hangul -C0F4Korean hangul -C0F7Korean hangul -C0F9Korean hangul -C11CKorean hangul -C11DKorean hangul -C11EKorean hangul -C120Korean hangul -C123Korean hangul -C124Korean hangul -C125Korean hangul -C126Korean hangul -C127Korean hangul -C12AKorean hangul -C12CKorean hangul -C12DKorean hangul -C12FKorean hangul -C130Korean hangul -C131Korean hangul -C136Korean hangul -C138Korean hangul -C139Korean hangul -C13CKorean hangul -C140Korean hangul -C148Korean hangul -C149Korean hangul -C14BKorean hangul -C14DKorean hangul -C151Korean hangul -C154Korean hangul -C158Korean hangul -C167Korean hangul -C168Korean hangul -C170Korean hangul -C18CKorean hangul -C18DKorean hangul -C18EKorean hangul -C190Korean hangul -C194Korean hangul -C19CKorean hangul -C19DKorean hangul -C19FKorean hangul -C1A1Korean hangul -C1A5Korean hangul -C1A8Korean hangul -C1A9Korean hangul -C1B0Korean hangul -C1C4Korean hangul -C1C8Korean hangul -C1D7Korean hangul -C1E0Korean hangul -C1E4Korean hangul -C1E8Korean hangul -C1F0Korean hangul -C1F1Korean hangul -C1F3Korean hangul -C1FCKorean hangul -C1FDKorean hangul -C200Korean hangul -C204Korean hangul -C20DKorean hangul -C218Korean hangul -C219Korean hangul -C21CKorean hangul -C21FKorean hangul -C220Korean hangul -C228Korean hangul -C229Korean hangul -C22BKorean hangul -C22DKorean hangul -C22FKorean hangul -C231Korean hangul -C232Korean hangul -C234Korean hangul -C250Korean hangul -C258Korean hangul -C26CKorean hangul -C270Korean hangul -C274Korean hangul -C27CKorean hangul -C27DKorean hangul -C27FKorean hangul -C281Korean hangul -C288Korean hangul -C289Korean hangul -C290Korean hangul -C298Korean hangul -C29BKorean hangul -C29DKorean hangul -C2A4Korean hangul -C2A5Korean hangul -C2A8Korean hangul -C2ACKorean hangul -C2ADKorean hangul -C2B4Korean hangul -C2B5Korean hangul -C2B7Korean hangul -C2B9Korean hangul -C2DCKorean hangul -C2DDKorean hangul -C2E0Korean hangul -C2E3Korean hangul -C2E4Korean hangul -C2EBKorean hangul -C2ECKorean hangul -C2EDKorean hangul -C2EFKorean hangul -C2F1Korean hangul -C2F6Korean hangul -C2F8Korean hangul -C2F9Korean hangul -C2FCKorean hangul -C300Korean hangul -C308Korean hangul -C309Korean hangul -C30BKorean hangul -C30CKorean hangul -C30DKorean hangul -C313Korean hangul -C314Korean hangul -C315Korean hangul -C318Korean hangul -C31CKorean hangul -C324Korean hangul -C327Korean hangul -C328Korean hangul -C329Korean hangul -C330Korean hangul -C343Korean hangul -C345Korean hangul -C368Korean hangul -C369Korean hangul -C36CKorean hangul -C370Korean hangul -C372Korean hangul -C378Korean hangul -C379Korean hangul -C37CKorean hangul -C37DKorean hangul -C384Korean hangul -C388Korean hangul -C399Korean hangul -C3D8Korean hangul -C3D9Korean hangul -C3DCKorean hangul -C3DFKorean hangul -C3E0Korean hangul -C3E8Korean hangul -C3EDKorean hangul -C3F4Korean hangul -C3F5Korean hangul -C410Korean hangul -C42CKorean hangul -C430Korean hangul -C434Korean hangul -C43CKorean hangul -C43FKorean hangul -C464Korean hangul -C465Korean hangul -C468Korean hangul -C46CKorean hangul -C474Korean hangul -C479Korean hangul -C480Korean hangul -C494Korean hangul -C4D4Korean hangul -C4D5Korean hangul -C4F0Korean hangul -C4F1Korean hangul -C4F4Korean hangul -C4F8Korean hangul -C500Korean hangul -C501Korean hangul -C50CKorean hangul -C510Korean hangul -C528Korean hangul -C529Korean hangul -C52CKorean hangul -C530Korean hangul -C538Korean hangul -C539Korean hangul -C53BKorean hangul -C53DKorean hangul -C544Korean hangul -C545Korean hangul -C548Korean hangul -C549Korean hangul -C54AKorean hangul -C54CKorean hangul -C54EKorean hangul -C553Korean hangul -C554Korean hangul -C555Korean hangul -C557Korean hangul -C558Korean hangul -C559Korean hangul -C55EKorean hangul -C55FKorean hangul -C560Korean hangul -C561Korean hangul -C564Korean hangul -C568Korean hangul -C570Korean hangul -C571Korean hangul -C573Korean hangul -C574Korean hangul -C575Korean hangul -C57CKorean hangul -C57DKorean hangul -C580Korean hangul -C584Korean hangul -C587Korean hangul -C58CKorean hangul -C58DKorean hangul -C58FKorean hangul -C590Korean hangul -C591Korean hangul -C595Korean hangul -C597Korean hangul -C598Korean hangul -C59CKorean hangul -C5B4Korean hangul -C5B5Korean hangul -C5B6Korean hangul -C5B8Korean hangul -C5B9Korean hangul -C5BAKorean hangul -C5BBKorean hangul -C5BCKorean hangul -C5BDKorean hangul -C5C4Korean hangul -C5C5Korean hangul -C5C6Korean hangul -C5C7Korean hangul -C5C8Korean hangul -C5C9Korean hangul -C5CAKorean hangul -C5CCKorean hangul -C5CEKorean hangul -C5D0Korean hangul -C5D1Korean hangul -C5D4Korean hangul -C5D8Korean hangul -C5E0Korean hangul -C5E1Korean hangul -C5E3Korean hangul -C5E5Korean hangul -C5ECKorean hangul -C5EDKorean hangul -C5EEKorean hangul -C5F0Korean hangul -C5F4Korean hangul -C5F6Korean hangul -C5F7Korean hangul -C5FCKorean hangul -C5FDKorean hangul -C5FEKorean hangul -C5FFKorean hangul -C600Korean hangul -C601Korean hangul -C606Korean hangul -C607Korean hangul -C608Korean hangul -C60CKorean hangul -C610Korean hangul -C61BKorean hangul -C624Korean hangul -C625Korean hangul -C628Korean hangul -C62CKorean hangul -C62DKorean hangul -C62EKorean hangul -C633Korean hangul -C634Korean hangul -C635Korean hangul -C637Korean hangul -C639Korean hangul -C63AKorean hangul -C63BKorean hangul -C640Korean hangul -C641Korean hangul -C644Korean hangul -C648Korean hangul -C650Korean hangul -C651Korean hangul -C653Korean hangul -C654Korean hangul -C65CKorean hangul -C65DKorean hangul -C660Korean hangul -C671Korean hangul -C678Korean hangul -C679Korean hangul -C67CKorean hangul -C680Korean hangul -C688Korean hangul -C68BKorean hangul -C68DKorean hangul -C694Korean hangul -C695Korean hangul -C698Korean hangul -C6A5Korean hangul -C6A7Korean hangul -C6A9Korean hangul -C6B0Korean hangul -C6B1Korean hangul -C6B4Korean hangul -C6B7Korean hangul -C6B8Korean hangul -C6B9Korean hangul -C6BAKorean hangul -C6C0Korean hangul -C6C1Korean hangul -C6C3Korean hangul -C6C5Korean hangul -C6CCKorean hangul -C6CDKorean hangul -C6D0Korean hangul -C6D4Korean hangul -C6DCKorean hangul -C6DDKorean hangul -C6DFKorean hangul -C6E0Korean hangul -C6E1Korean hangul -C6E8Korean hangul -C6E9Korean hangul -C6ECKorean hangul -C6F0Korean hangul -C6F8Korean hangul -C704Korean hangul -C705Korean hangul -C708Korean hangul -C70CKorean hangul -C714Korean hangul -C717Korean hangul -C719Korean hangul -C720Korean hangul -C721Korean hangul -C724Korean hangul -C728Korean hangul -C730Korean hangul -C735Korean hangul -C737Korean hangul -C73CKorean hangul -C73DKorean hangul -C740Korean hangul -C744Korean hangul -C74AKorean hangul -C74CKorean hangul -C74DKorean hangul -C751Korean hangul -C758Korean hangul -C774Korean hangul -C775Korean hangul -C778Korean hangul -C77CKorean hangul -C77DKorean hangul -C783Korean hangul -C784Korean hangul -C785Korean hangul -C787Korean hangul -C788Korean hangul -C789Korean hangul -C78AKorean hangul -C78EKorean hangul -C655Korean hangul -C790Korean hangul -C791Korean hangul -C794Korean hangul -C796Korean hangul -C798Korean hangul -C7A0Korean hangul -C7A1Korean hangul -C7A3Korean hangul -C7A4Korean hangul -C7A5Korean hangul -C7A6Korean hangul -C7A7Korean hangul -C7ACKorean hangul -C7ADKorean hangul -C7B0Korean hangul -C7B4Korean hangul -C7BCKorean hangul -C7BDKorean hangul -C7BFKorean hangul -C7C0Korean hangul -C7C1Korean hangul -C7C8Korean hangul -C7C9Korean hangul -C7CCKorean hangul -C7D8Korean hangul -C800Korean hangul -C801Korean hangul -C804Korean hangul -C808Korean hangul -C80AKorean hangul -C810Korean hangul -C811Korean hangul -C813Korean hangul -C814Korean hangul -C815Korean hangul -C816Korean hangul -C81CKorean hangul -C81DKorean hangul -C820Korean hangul -C824Korean hangul -C82CKorean hangul -C82DKorean hangul -C82FKorean hangul -C838Korean hangul -C83CKorean hangul -C84CKorean hangul -C870Korean hangul -C871Korean hangul -C874Korean hangul -C878Korean hangul -C87AKorean hangul -C880Korean hangul -C881Korean hangul -C885Korean hangul -C886Korean hangul -C887Korean hangul -C88BKorean hangul -C88CKorean hangul -C88DKorean hangul -C890Korean hangul -C894Korean hangul -C89CKorean hangul -C89DKorean hangul -C89FKorean hangul -C8A0Korean hangul -C8A8Korean hangul -C8ACKorean hangul -C8B0Korean hangul -C8B8Korean hangul -C8C4Korean hangul -C8C8Korean hangul -C8CCKorean hangul -C8D4Korean hangul -C8D5Korean hangul -C8D7Korean hangul -C8E0Korean hangul -C8E4Korean hangul -C8F0Korean hangul -C8F1Korean hangul -C8F5Korean hangul -C8FCKorean hangul -C8FDKorean hangul -C900Korean hangul -C904Korean hangul -C906Korean hangul -C90CKorean hangul -C90DKorean hangul -C90FKorean hangul -C911Korean hangul -C918Korean hangul -C92CKorean hangul -C950Korean hangul -C954Korean hangul -C958Korean hangul -C960Korean hangul -C961Korean hangul -C96CKorean hangul -C970Korean hangul -C974Korean hangul -C988Korean hangul -C989Korean hangul -C98CKorean hangul -C990Korean hangul -C998Korean hangul -C999Korean hangul -C99DKorean hangul -C9C0Korean hangul -C9C1Korean hangul -C9C4Korean hangul -C9C7Korean hangul -C9C8Korean hangul -C9CAKorean hangul -C9D0Korean hangul -C9D1Korean hangul -C9D3Korean hangul -C9D5Korean hangul -C9D6Korean hangul -C9D9Korean hangul -C9DAKorean hangul -C9DCKorean hangul -C9DDKorean hangul -C9E0Korean hangul -C9E2Korean hangul -C9E4Korean hangul -C9E7Korean hangul -C9ECKorean hangul -C9EDKorean hangul -C9EFKorean hangul -C9F0Korean hangul -C9F1Korean hangul -C9F8Korean hangul -C9F9Korean hangul -C9FCKorean hangul -CA00Korean hangul -CA08Korean hangul -CA09Korean hangul -CA0BKorean hangul -CA0CKorean hangul -CA0DKorean hangul -CA18Korean hangul -CA4CKorean hangul -CA4DKorean hangul -CA50Korean hangul -CA54Korean hangul -CA5CKorean hangul -CA5DKorean hangul -CA61Korean hangul -CA84Korean hangul -CA98Korean hangul -CABCKorean hangul -CABDKorean hangul -CAC0Korean hangul -CAC4Korean hangul -CACCKorean hangul -CACDKorean hangul -CAD1Korean hangul -CAD2Korean hangul -CAD3Korean hangul -CAD8Korean hangul -CAD9Korean hangul -CB10Korean hangul -CB14Korean hangul -CB18Korean hangul -CB20Korean hangul -CB21Korean hangul -CB41Korean hangul -CB48Korean hangul -CB49Korean hangul -CB50Korean hangul -CB58Korean hangul -CB59Korean hangul -CB5DKorean hangul -CB64Korean hangul -CBB8Korean hangul -CBD4Korean hangul -CBE4Korean hangul -CBE7Korean hangul -CC0CKorean hangul -CC0DKorean hangul -CC10Korean hangul -CC14Korean hangul -CC1CKorean hangul -CC1DKorean hangul -CC21Korean hangul -CC22Korean hangul -CC27Korean hangul -CC28Korean hangul -CC29Korean hangul -CC2CKorean hangul -CC2EKorean hangul -CC2FKorean hangul -CC30Korean hangul -CC38Korean hangul -CC39Korean hangul -CC3BKorean hangul -CC3CKorean hangul -CC3DKorean hangul -CC3EKorean hangul -CC3FKorean hangul -CC44Korean hangul -CC45Korean hangul -CC48Korean hangul -CC4CKorean hangul -CC54Korean hangul -CC55Korean hangul -CC58Korean hangul -CC59Korean hangul -CC60Korean hangul -CC64Korean hangul -CC70Korean hangul -CC71Korean hangul -CC98Korean hangul -CC99Korean hangul -CC9CKorean hangul -CCA0Korean hangul -CCA8Korean hangul -CCA9Korean hangul -CCABKorean hangul -CCADKorean hangul -CCB4Korean hangul -CCB5Korean hangul -CCB8Korean hangul -CCBCKorean hangul -CCC7Korean hangul -CCD0Korean hangul -CCE4Korean hangul -CD08Korean hangul -CD09Korean hangul -CD0CKorean hangul -CD10Korean hangul -CD18Korean hangul -CD19Korean hangul -CD1BKorean hangul -CD1DKorean hangul -CD2CKorean hangul -CD5CKorean hangul -CD78Korean hangul -CD94Korean hangul -CD95Korean hangul -CD98Korean hangul -CD9CKorean hangul -CDA4Korean hangul -CDA5Korean hangul -CDA7Korean hangul -CDA9Korean hangul -CDB0Korean hangul -CDC4Korean hangul -CDCCKorean hangul -CDE8Korean hangul -CE04Korean hangul -CE20Korean hangul -CE21Korean hangul -CE30Korean hangul -CE35Korean hangul -CE58Korean hangul -CE59Korean hangul -CE5CKorean hangul -CE60Korean hangul -CE61Korean hangul -CE68Korean hangul -CE69Korean hangul -CE6BKorean hangul -CE6DKorean hangul -CE74Korean hangul -CE75Korean hangul -CE78Korean hangul -CE7CKorean hangul -CE84Korean hangul -CE85Korean hangul -CE87Korean hangul -CE89Korean hangul -CE90Korean hangul -CE91Korean hangul -CE94Korean hangul -CE98Korean hangul -CEA0Korean hangul -CEA1Korean hangul -CEA3Korean hangul -CEA5Korean hangul -CEACKorean hangul -CEADKorean hangul -CEE4Korean hangul -CEE8Korean hangul -CEECKorean hangul -CEF4Korean hangul -CEF5Korean hangul -CEF7Korean hangul -CEF9Korean hangul -CF00Korean hangul -CF01Korean hangul -CF04Korean hangul -CF08Korean hangul -CF10Korean hangul -CF11Korean hangul -CF13Korean hangul -CF15Korean hangul -CF1CKorean hangul -CF20Korean hangul -CF24Korean hangul -CF2CKorean hangul -CF2DKorean hangul -CF2FKorean hangul -CF30Korean hangul -CF54Korean hangul -CF55Korean hangul -CF58Korean hangul -CF5CKorean hangul -CF64Korean hangul -CF65Korean hangul -CF67Korean hangul -CF69Korean hangul -CF70Korean hangul -CF71Korean hangul -CF74Korean hangul -CF78Korean hangul -CF80Korean hangul -CF85Korean hangul -CF8CKorean hangul -CF8DKorean hangul -CFA1Korean hangul -CFB0Korean hangul -CFC4Korean hangul -CFE0Korean hangul -CFE1Korean hangul -CFE4Korean hangul -CFE8Korean hangul -CFF0Korean hangul -CFF3Korean hangul -CFF5Korean hangul -CFFCKorean hangul -D018Korean hangul -D02DKorean hangul -D034Korean hangul -D035Korean hangul -D038Korean hangul -D050Korean hangul -D06CKorean hangul -D070Korean hangul -D074Korean hangul -D07CKorean hangul -D07DKorean hangul -D081Korean hangul -D0A4Korean hangul -D0A5Korean hangul -D0A8Korean hangul -D0ACKorean hangul -D0B4Korean hangul -D0B5Korean hangul -D0B7Korean hangul -D0B9Korean hangul -D0C0Korean hangul -D0C1Korean hangul -D0C4Korean hangul -D0C8Korean hangul -D0C9Korean hangul -D0D0Korean hangul -D0D1Korean hangul -D0D3Korean hangul -D0D4Korean hangul -D0D5Korean hangul -D0DCKorean hangul -D0DDKorean hangul -D0E0Korean hangul -D0E4Korean hangul -D0ECKorean hangul -D0EDKorean hangul -D0EFKorean hangul -D0F0Korean hangul -D0F1Korean hangul -D130Korean hangul -D131Korean hangul -D134Korean hangul -D138Korean hangul -D140Korean hangul -D141Korean hangul -D143Korean hangul -D144Korean hangul -D145Korean hangul -D14CKorean hangul -D14DKorean hangul -D150Korean hangul -D154Korean hangul -D15CKorean hangul -D15DKorean hangul -D15FKorean hangul -D160Korean hangul -D161Korean hangul -D168Korean hangul -D1A0Korean hangul -D1A1Korean hangul -D1A4Korean hangul -D1A8Korean hangul -D1B0Korean hangul -D1B1Korean hangul -D1B3Korean hangul -D1B5Korean hangul -D1D8Korean hangul -D1F4Korean hangul -D22CKorean hangul -D22DKorean hangul -D230Korean hangul -D234Korean hangul -D23CKorean hangul -D23DKorean hangul -D23FKorean hangul -D241Korean hangul -D264Korean hangul -D277Korean hangul -D280Korean hangul -D284Korean hangul -D288Korean hangul -D290Korean hangul -D291Korean hangul -D293Korean hangul -D295Korean hangul -D29CKorean hangul -D2ACKorean hangul -D2B8Korean hangul -D2B9Korean hangul -D2BCKorean hangul -D2BFKorean hangul -D2C0Korean hangul -D2C8Korean hangul -D2C9Korean hangul -D2CBKorean hangul -D2D4Korean hangul -D1F8Korean hangul -D2F0Korean hangul -D2F1Korean hangul -D2F4Korean hangul -D2F8Korean hangul -D300Korean hangul -D301Korean hangul -D305Korean hangul -D30CKorean hangul -D30DKorean hangul -D30EKorean hangul -D310Korean hangul -D314Korean hangul -D31CKorean hangul -D31DKorean hangul -D31FKorean hangul -D320Korean hangul -D321Korean hangul -D325Korean hangul -D328Korean hangul -D329Korean hangul -D32CKorean hangul -D330Korean hangul -D338Korean hangul -D339Korean hangul -D33BKorean hangul -D33CKorean hangul -D33DKorean hangul -D37CKorean hangul -D37DKorean hangul -D380Korean hangul -D384Korean hangul -D38CKorean hangul -D38DKorean hangul -D38FKorean hangul -D390Korean hangul -D391Korean hangul -D398Korean hangul -D399Korean hangul -D39CKorean hangul -D3A0Korean hangul -D3A8Korean hangul -D3A9Korean hangul -D3ABKorean hangul -D3ADKorean hangul -D3B4Korean hangul -D3B5Korean hangul -D3B8Korean hangul -D3BCKorean hangul -D3C4Korean hangul -D3C5Korean hangul -D3C8Korean hangul -D3C9Korean hangul -D3D0Korean hangul -D3ECKorean hangul -D3EDKorean hangul -D3F0Korean hangul -D3F4Korean hangul -D3FCKorean hangul -D3FDKorean hangul -D3FFKorean hangul -D401Korean hangul -D440Korean hangul -D444Korean hangul -D45CKorean hangul -D46FKorean hangul -D478Korean hangul -D479Korean hangul -D47CKorean hangul -D480Korean hangul -D488Korean hangul -D489Korean hangul -D48BKorean hangul -D48DKorean hangul -D4CCKorean hangul -D4E8Korean hangul -D504Korean hangul -D508Korean hangul -D50CKorean hangul -D514Korean hangul -D515Korean hangul -D53CKorean hangul -D53DKorean hangul -D540Korean hangul -D544Korean hangul -D54CKorean hangul -D54DKorean hangul -D54FKorean hangul -D551Korean hangul -D558Korean hangul -D559Korean hangul -D55CKorean hangul -D560Korean hangul -D565Korean hangul -D568Korean hangul -D569Korean hangul -D56BKorean hangul -D56CKorean hangul -D56DKorean hangul -D571Korean hangul -D574Korean hangul -D575Korean hangul -D578Korean hangul -D57CKorean hangul -D584Korean hangul -D585Korean hangul -D587Korean hangul -D588Korean hangul -D589Korean hangul -D590Korean hangul -D5A5Korean hangul -D5C8Korean hangul -D5C9Korean hangul -D5CCKorean hangul -D5D0Korean hangul -D5D2Korean hangul -D5D8Korean hangul -D5D9Korean hangul -D5DBKorean hangul -D5DDKorean hangul -D5E4Korean hangul -D5E5Korean hangul -D5E8Korean hangul -D5ECKorean hangul -D5F4Korean hangul -D5F5Korean hangul -D5F7Korean hangul -D5F9Korean hangul -D600Korean hangul -D601Korean hangul -D604Korean hangul -D608Korean hangul -D610Korean hangul -D611Korean hangul -D613Korean hangul -D614Korean hangul -D615Korean hangul -D61CKorean hangul -D638Korean hangul -D639Korean hangul -D63CKorean hangul -D640Korean hangul -D648Korean hangul -D649Korean hangul -D64BKorean hangul -D64DKorean hangul -D654Korean hangul -D655Korean hangul -D658Korean hangul -D65CKorean hangul -D667Korean hangul -D669Korean hangul -D670Korean hangul -D671Korean hangul -D683Korean hangul -D68CKorean hangul -D68DKorean hangul -D69FKorean hangul -D6A1Korean hangul -D6A8Korean hangul -D6C4Korean hangul -D6C5Korean hangul -D6C8Korean hangul -D6CCKorean hangul -D6D1Korean hangul -D6D4Korean hangul -D6D7Korean hangul -D6E0Korean hangul -D6E4Korean hangul -D6E8Korean hangul -D6F0Korean hangul -D6FCKorean hangul -D700Korean hangul -D711Korean hangul -D718Korean hangul -D719Korean hangul -D71CKorean hangul -D720Korean hangul -D728Korean hangul -D729Korean hangul -D72DKorean hangul -D734Korean hangul -D73CKorean hangul -D744Korean hangul -D749Korean hangul -D750Korean hangul -D751Korean hangul -D754Korean hangul -D757Korean hangul -D758Korean hangul -D759Korean hangul -D760Korean hangul -D761Korean hangul -D763Korean hangul -D765Korean hangul -D769Korean hangul -D76CKorean hangul -D770Korean hangul -D774Korean hangul -D788Korean hangul -D789Korean hangul -D78CKorean hangul -D790Korean hangul -D798Korean hangul -D799Korean hangul -D79BKorean hangul -D79DKorean hangul -3181Korean hangul -3186Korean hangul -317FKorean hangul -E8B0Korean hangul -E8B1Korean hangul -E8B2Korean hangul -E8B3Korean hangul -E8B4Korean hangul -E8B5Korean hangul -E8B6Korean hangul -E8B7Korean hangul -E8B8Korean hangul -E8B9Korean hangul -E8BAKorean hangul -E8BBKorean hangul -E8BCKorean hangul -E8BDKorean hangul -E8BEKorean hangul -E8BFKorean hangul -E8C0Korean hangul -E8C1Korean hangul -E8C2Korean hangul -E8C3Korean hangul -E8C4Korean hangul -E8C5Korean hangul -E8C6Korean hangul -E8C7Korean hangul -E8C8Korean hangul -E8C9Korean hangul -AD35Korean hangul -AD7BKorean hangul -E8CAKorean hangul -AD89Korean hangul -AD9DKorean hangul -ADB9Korean hangul -ADD5Korean hangul -AE07Korean hangul -AE0EKorean hangul -AE0FKorean hangul -AE11Korean hangul -AE14Korean hangul -AE5FKorean hangul -AEEDKorean hangul -AF09Korean hangul -AF50Korean hangul -AFBFKorean hangul -B060Korean hangul -B9C4Korean hangul -C54DKorean hangul -C54FKorean hangul -C552Korean hangul -C5ABKorean hangul -C5B1Korean hangul -C61CKorean hangul -C61DKorean hangul -C6FDKorean hangul -E8CBKorean hangul -C733Korean hangul -CB4CKorean hangul -915EEast Asian ideograph -4EEBEast Asian ideograph -57B4East Asian ideograph -82CAEast Asian ideograph -82C4East Asian ideograph -841CEast Asian ideograph -8488East Asian ideograph -7519East Asian ideograph -5416East Asian ideograph -549DEast Asian ideograph -54D0East Asian ideograph -54B4East Asian ideograph -54A3East Asian ideograph -54DAEast Asian ideograph -55B9East Asian ideograph -55EAEast Asian ideograph -55F5East Asian ideograph -5623East Asian ideograph -562DEast Asian ideograph -567BEast Asian ideograph -5C9CEast Asian ideograph -7339East Asian ideograph -9987East Asian ideograph -9995East Asian ideograph -61B7East Asian ideograph -80ECEast Asian ideograph -80BCEast Asian ideograph -80BDEast Asian ideograph -80E9East Asian ideograph -810EEast Asian ideograph -8112East Asian ideograph -8159East Asian ideograph -70BBEast Asian ideograph -70C0East Asian ideograph -7818East Asian ideograph -781CEast Asian ideograph -783CEast Asian ideograph -87A8East Asian ideograph -7B7BEast Asian ideograph -7BA2East Asian ideograph -823EEast Asian ideograph -9170East Asian ideograph -8E3AEast Asian ideograph -9B0FEast Asian ideograph - \ No newline at end of file diff --git a/util/cql2pqf.c b/util/cql2pqf.c new file mode 100644 index 0000000..a63d30d --- /dev/null +++ b/util/cql2pqf.c @@ -0,0 +1,60 @@ +/* $Id: cql2pqf.c,v 1.1 2003-10-27 12:21:39 adam Exp $ + Copyright (C) 2002-2003 + Index Data Aps + +This file is part of the YAZ toolkit. + +See the file LICENSE. +*/ + +#include +#include + +#include + +int main(int argc, char **argv) +{ + cql_transform_t ct; + int r; + int i, it = 1; + CQL_parser cp = cql_parser_create(); + + if (argc < 2) + { + fprintf (stderr, "usage\n cqltransform [] [interations]\n"); + exit (1); + } + ct = cql_transform_open_fname(argv[1]); + if (!ct) + { + fprintf (stderr, "failed to read properties %s\n", argv[1]); + exit (1); + } + if (argc >= 4) + it = atoi(argv[3]); + + for (i = 0; i= 3) + r = cql_parser_string(cp, argv[2]); + else + r = cql_parser_stdio(cp, stdin); + + if (r) + fprintf (stderr, "Syntax error\n"); + else + { + r = cql_transform_FILE(ct, cql_parser_result(cp), stdout); + printf("\n"); + if (r) + { + const char *addinfo; + cql_transform_error(ct, &addinfo); + printf ("Transform error %d %s\n", r, addinfo ? addinfo : ""); + } + } + } + cql_transform_close(ct); + cql_parser_destroy(cp); + return 0; +} diff --git a/util/cql2xcql.c b/util/cql2xcql.c new file mode 100644 index 0000000..e389069 --- /dev/null +++ b/util/cql2xcql.c @@ -0,0 +1,28 @@ +/* $Id: cql2xcql.c,v 1.1 2003-10-27 12:21:39 adam Exp $ + Copyright (C) 2002-2003 + Index Data Aps + +This file is part of the YAZ toolkit. + +See the file LICENSE. +*/ + +#include + +#include + +int main(int argc, char **argv) +{ + int r; + CQL_parser cp = cql_parser_create(); + if (argc == 2) + r = cql_parser_string(cp, argv[1]); + else + r = cql_parser_stdio(cp, stdin); + if (r) + fprintf (stderr, "Syntax error\n"); + else + cql_to_xml_stdio(cql_parser_result(cp), stdout); + cql_parser_destroy(cp); + return 0; +} diff --git a/util/cvs-date.tcl b/util/cvs-date.tcl deleted file mode 100755 index 6950a4b..0000000 --- a/util/cvs-date.tcl +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# the next line restarts using tclsh \ -exec tclsh "$0" "$@" -# -# $Id: cvs-date.tcl,v 1.4 2001-09-11 12:44:22 adam Exp $ -set sec 0 - -proc cvslog {} { - global sec - - set f [open {|cvs log} r] - while {[gets $f line] >= 0} { - if {[regexp {^date: ([0-9]+)[ /]+([0-9]+)[ /]+([0-9]+)[ /]} $line dummy year month day]} { - set this $year$month$day - if {$this > $sec} { - set sec $this - } - } - } -} - -cvslog - -if {$sec} { - set fname [lindex $argv 0] - if {[string length $fname]} { - set f [open [lindex $argv 0] w] - puts $f "#define YAZ_DATE ${sec}L" - puts $f "#define YAZ_DATE_STR \"$sec\"" - puts $f "" - close $f - } else { - puts $sec - } -} diff --git a/util/log.c b/util/log.c deleted file mode 100644 index 90a2c5b..0000000 --- a/util/log.c +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * - * $Id: log.c,v 1.39 2003-10-09 15:51:36 adam Exp $ - */ - -#if HAVE_CONFIG_H -#include -#endif - -#ifdef WIN32 -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define HAS_STRERROR 1 - -#if HAS_STRERROR - -#else -char *strerror(int n) -{ - extern char *sys_errlist[]; - return sys_errlist[n]; -} - -#endif - -static int l_level = LOG_DEFAULT_LEVEL; -static FILE *l_file = NULL; -static char l_prefix[512] = ""; -static char l_prefix2[512] = ""; -static char l_fname[512] = ""; - -static struct { - int mask; - char *name; -} mask_names[] = -{ - { LOG_FATAL, "fatal"}, - { LOG_DEBUG, "debug"}, - { LOG_WARN, "warn" }, - { LOG_LOG, "log" }, - { LOG_ERRNO, ""}, - { LOG_MALLOC, "malloc"}, - { LOG_APP, "app" }, - { LOG_NOTIME, "" }, - { LOG_APP2 , "app2" }, - { LOG_APP3 , "app3" }, - { LOG_ALL, "all" }, - { 0, "none" }, - { 0, NULL } -}; - -FILE *yaz_log_file(void) -{ - if (!l_file) - l_file = stderr; - return l_file; -} - -void yaz_log_init_file (const char *fname) -{ - if (fname) - { - strncpy(l_fname, fname, sizeof(l_fname)-1); - l_fname[sizeof(l_fname)-1] = '\0'; - } - else - l_fname[0] = '\0'; - yaz_log_reopen(); -} - -void yaz_log_reopen(void) -{ - FILE *new_file; - if (!l_file) - l_file = stderr; - - if (!*l_fname) - new_file=stderr; - else if (!(new_file = fopen(l_fname, "a"))) - return; - if (l_file != stderr) - { - fclose (l_file); - } - setvbuf(new_file, 0, _IONBF, 0); - l_file = new_file; -} - -void yaz_log_init_level (int level) -{ - l_level = level; -} - -void yaz_log_init_prefix (const char *prefix) -{ - if (prefix && *prefix) - sprintf(l_prefix, "%.511s ", prefix); - else - *l_prefix = 0; -} - -void yaz_log_init_prefix2 (const char *prefix) -{ - if (prefix && *prefix) - sprintf(l_prefix2, "%.511s ", prefix); - else - *l_prefix2 = 0; -} - -void yaz_log_init(int level, const char *prefix, const char *fname) -{ - yaz_log_init_level (level); - yaz_log_init_prefix (prefix); - if (fname && *fname) - yaz_log_init_file (fname); -} - -static void (*start_hook_func)(int, const char *, void *) = NULL; -static void *start_hook_info; -static void (*end_hook_func)(int, const char *, void *) = NULL; -static void *end_hook_info; - -void log_event_start (void (*func)(int, const char *, void *), void *info) -{ - start_hook_func = func; - start_hook_info = info; -} - -void log_event_end (void (*func)(int, const char *, void *), void *info) -{ - end_hook_func = func; - end_hook_info = info; -} - -void yaz_log(int level, const char *fmt, ...) -{ - va_list ap; - char buf[4096], flags[1024]; - int i; - time_t ti; - struct tm *tim; - char tbuf[50]=""; - int o_level = level; - - if (!(level & l_level)) - return; - if (!l_file) - l_file = stderr; - *flags = '\0'; - for (i = 0; level && mask_names[i].name; i++) - if (mask_names[i].mask & level) - { - if (*mask_names[i].name) - sprintf(flags + strlen(flags), "[%s]", mask_names[i].name); - level -= mask_names[i].mask; - } - va_start(ap, fmt); -#ifdef WIN32 - _vsnprintf(buf, sizeof(buf)-1, fmt, ap); -#else -/* !WIN32 */ -#if HAVE_VSNPRINTF - vsnprintf(buf, sizeof(buf), fmt, ap); -#else - vsprintf(buf, fmt, ap); -#endif -#endif -/* WIN32 */ - if (o_level & LOG_ERRNO) - { - strcat(buf, " ["); - yaz_strerror(buf+strlen(buf), 2048); - strcat(buf, "]"); - } - va_end (ap); - if (start_hook_func) - (*start_hook_func)(o_level, buf, start_hook_info); - ti = time(0); - tim = localtime(&ti); - if (l_level & LOG_NOTIME) - tbuf[0]='\0'; - else - strftime(tbuf, 50, "%H:%M:%S-%d/%m: ", tim); - fprintf(l_file, "%s%s%s %s%s\n", tbuf, l_prefix, flags, - l_prefix2, buf); - fflush(l_file); - if (end_hook_func) - (*end_hook_func)(o_level, buf, end_hook_info); -} - -int yaz_log_mask_str (const char *str) -{ - return yaz_log_mask_str_x (str, LOG_DEFAULT_LEVEL); -} - -int yaz_log_mask_str_x (const char *str, int level) -{ - const char *p; - int i; - - while (*str) - { - for (p = str; *p && *p != ','; p++) - ; - if (*str == '-' || isdigit(*str)) - level = atoi (str); - else - for (i = 0; mask_names[i].name; i++) - if (strlen (mask_names[i].name) == (size_t) (p-str) && - memcmp (mask_names[i].name, str, p-str) == 0) - { - if (mask_names[i].mask) - level |= mask_names[i].mask; - else - level = 0; - } - if (*p == ',') - p++; - str = p; - } - return level; -} diff --git a/util/marcdisp.c b/util/marcdisp.c deleted file mode 100644 index b728872..0000000 --- a/util/marcdisp.c +++ /dev/null @@ -1,467 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * - * $Id: marcdisp.c,v 1.30 2003-07-14 12:59:23 adam Exp $ - */ - -#if HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include - -struct yaz_marc_t_ { - WRBUF m_wr; - int xml; - int debug; -}; - -yaz_marc_t yaz_marc_create(void) -{ - yaz_marc_t mt = (yaz_marc_t) xmalloc(sizeof(*mt)); - mt->xml = YAZ_MARC_LINE; - mt->debug = 0; - mt->m_wr = wrbuf_alloc(); - return mt; -} - -void yaz_marc_destroy(yaz_marc_t mt) -{ - if (!mt) - return ; - wrbuf_free (mt->m_wr, 1); - xfree (mt); -} - -static void marc_cdata (yaz_marc_t mt, const char *buf, size_t len, WRBUF wr) -{ - size_t i; - for (i = 0; ixml) - { - switch (buf[i]) { - case '<': - wrbuf_puts(wr, "<"); - break; - case '>': - wrbuf_puts(wr, ">"); - break; - case '&': - wrbuf_puts(wr, "&"); - break; - case '"': - wrbuf_puts(wr, """); - break; - case '\'': - wrbuf_puts(wr, "'"); - break; - default: - wrbuf_putc(wr, buf[i]); - } - } - else - wrbuf_putc(wr, buf[i]); - } -} - -#if 0 -static void marc_cdata (yaz_marc_t mt, const char *buf, size_t len) -{ - if (!mt->cd) - marc_cdata2 (mt, buf, len); - else - { - char outbuf[12]; - size_t inbytesleft = len; - const char *inp = buf; - - while (inbytesleft) - { - size_t outbytesleft = sizeof(outbuf); - char *outp = outbuf; - size_t r = yaz_iconv (mt->cd, (char**) &inp, &inbytesleft, - &outp, &outbytesleft); - if (r == (size_t) (-1)) - { - int e = yaz_iconv_error(mt->cd); - if (e != YAZ_ICONV_E2BIG) - break; - } - marc_cdata2 (mt, outbuf, outp - outbuf); - } - } -} -#endif - -int yaz_marc_decode_wrbuf (yaz_marc_t mt, const char *buf, int bsize, WRBUF wr) -{ - int entry_p; - int record_length; - int indicator_length; - int identifier_length; - int base_address; - int length_data_entry; - int length_starting; - int length_implementation; - - wrbuf_rewind(wr); - - record_length = atoi_n (buf, 5); - if (record_length < 25) - { - if (mt->debug) - { - char str[40]; - - sprintf (str, "Record length %d - aborting\n", record_length); - wrbuf_puts (wr, str); - } - return -1; - } - /* ballout if bsize is known and record_length is than that */ - if (bsize != -1 && record_length > bsize) - return -1; - if (isdigit(buf[10])) - indicator_length = atoi_n (buf+10, 1); - else - indicator_length = 2; - if (isdigit(buf[11])) - identifier_length = atoi_n (buf+11, 1); - else - identifier_length = 2; - base_address = atoi_n (buf+12, 5); - - length_data_entry = atoi_n (buf+20, 1); - length_starting = atoi_n (buf+21, 1); - length_implementation = atoi_n (buf+22, 1); - - if (mt->xml) - { - char str[80]; - int i; - switch(mt->xml) - { - case YAZ_MARC_SIMPLEXML: - wrbuf_puts (wr, "\n"); - break; - case YAZ_MARC_OAIMARC: - wrbuf_puts( - wr, - "\n", - buf[5], buf[6], buf[7]); - wrbuf_puts (wr, str); - break; - case YAZ_MARC_MARCXML: - wrbuf_printf( - wr, - "\n" - " %.24s\n", buf); - break; - } - } - if (mt->debug) - { - char str[40]; - - if (mt->xml) - wrbuf_puts (wr, "\n"); - } - - for (entry_p = 24; buf[entry_p] != ISO2709_FS; ) - { - entry_p += 3+length_data_entry+length_starting; - if (entry_p >= record_length) - return -1; - } - base_address = entry_p+1; - for (entry_p = 24; buf[entry_p] != ISO2709_FS; ) - { - int data_length; - int data_offset; - int end_offset; - int i, j; - char tag[4]; - int identifier_flag = 1; - - memcpy (tag, buf+entry_p, 3); - entry_p += 3; - tag[3] = '\0'; - data_length = atoi_n (buf+entry_p, length_data_entry); - entry_p += length_data_entry; - data_offset = atoi_n (buf+entry_p, length_starting); - entry_p += length_starting; - i = data_offset + base_address; - end_offset = i+data_length-1; - - if (indicator_length < 4 && indicator_length > 0) - { - if (buf[i + indicator_length] != ISO2709_IDFS) - identifier_flag = 0; - } - else if (!memcmp (tag, "00", 2)) - identifier_flag = 0; - - switch(mt->xml) - { - case YAZ_MARC_LINE: - if (mt->debug) - wrbuf_puts (wr, "Tag: "); - wrbuf_puts (wr, tag); - wrbuf_puts (wr, " "); - break; - case YAZ_MARC_SIMPLEXML: - wrbuf_printf (wr, "xml) - { - case YAZ_MARC_LINE: - if (mt->debug) - wrbuf_puts (wr, " Ind: "); - wrbuf_putc (wr, buf[i]); - break; - case YAZ_MARC_SIMPLEXML: - wrbuf_printf (wr, " Indicator%d=\"%c\"", j+1, buf[i]); - break; - case YAZ_MARC_OAIMARC: - wrbuf_printf (wr, " i%d=\"%c\"", j+1, buf[i]); - break; - case YAZ_MARC_MARCXML: - wrbuf_printf (wr, " ind%d=\"%c\"", j+1, buf[i]); - } - } - } - if (mt->xml) - { - wrbuf_puts (wr, ">"); - if (identifier_flag) - wrbuf_puts (wr, "\n"); - } - else - { - if (mt->debug && !mt->xml) - wrbuf_puts (wr, " Fields: "); - } - if (identifier_flag) - { - while (buf[i] != ISO2709_RS && buf[i] != ISO2709_FS && i < end_offset) - { - int i0; - i++; - switch(mt->xml) - { - case YAZ_MARC_LINE: - wrbuf_puts (wr, " $"); - for (j = 1; j"); - break; - case YAZ_MARC_OAIMARC: - wrbuf_puts (wr, " "); - break; - case YAZ_MARC_MARCXML: - wrbuf_puts (wr, " "); - break; - } - i0 = i; - while (buf[i] != ISO2709_RS && buf[i] != ISO2709_IDFS && - buf[i] != ISO2709_FS && i < end_offset) - i++; - marc_cdata(mt, buf + i0, i - i0, wr); - - if (mt->xml) - wrbuf_puts (wr, "\n"); - } - } - else - { - int i0 = i; - while (buf[i] != ISO2709_RS && buf[i] != ISO2709_FS && i < end_offset) - i++; - marc_cdata(mt, buf + i0, i - i0, wr); - } - if (!mt->xml) - wrbuf_putc (wr, '\n'); - if (i < end_offset) - wrbuf_puts (wr, " \n"); - if (buf[i] != ISO2709_RS && buf[i] != ISO2709_FS) - wrbuf_puts (wr, " \n"); - switch(mt->xml) - { - case YAZ_MARC_SIMPLEXML: - wrbuf_puts (wr, "\n"); - break; - case YAZ_MARC_OAIMARC: - if (identifier_flag) - wrbuf_puts (wr, " \n"); - else - wrbuf_puts (wr, " \n"); - break; - case YAZ_MARC_MARCXML: - if (identifier_flag) - wrbuf_puts (wr, " \n"); - else - wrbuf_puts (wr, " \n"); - break; - } - } - switch (mt->xml) - { - case YAZ_MARC_LINE: - wrbuf_puts (wr, ""); - break; - case YAZ_MARC_SIMPLEXML: - wrbuf_puts (wr, "\n"); - break; - case YAZ_MARC_OAIMARC: - wrbuf_puts (wr, "\n"); - break; - case YAZ_MARC_MARCXML: - wrbuf_puts (wr, "\n"); - break; - } - return record_length; -} - -int yaz_marc_decode_buf (yaz_marc_t mt, const char *buf, int bsize, - char **result, int *rsize) -{ - int r = yaz_marc_decode_wrbuf(mt, buf, bsize, mt->m_wr); - if (r > 0) - { - if (result) - *result = wrbuf_buf(mt->m_wr); - if (rsize) - *rsize = wrbuf_len(mt->m_wr); - } - return r; -} - -void yaz_marc_xml(yaz_marc_t mt, int xmlmode) -{ - if (mt) - mt->xml = xmlmode; -} - -void yaz_marc_debug(yaz_marc_t mt, int level) -{ - if (mt) - mt->debug = level; -} - -/* depricated */ -int yaz_marc_decode(const char *buf, WRBUF wr, int debug, int bsize, int xml) -{ - yaz_marc_t mt = yaz_marc_create(); - int r; - - mt->debug = debug; - mt->xml = xml; - r = yaz_marc_decode_wrbuf(mt, buf, bsize, wr); - yaz_marc_destroy(mt); - return r; -} - -/* depricated */ -int marc_display_wrbuf (const char *buf, WRBUF wr, int debug, int bsize) -{ - return yaz_marc_decode(buf, wr, debug, bsize, 0); -} - -/* depricated */ -int marc_display_exl (const char *buf, FILE *outf, int debug, int bsize) -{ - yaz_marc_t mt = yaz_marc_create(); - int r; - - mt->debug = debug; - r = yaz_marc_decode_wrbuf (mt, buf, bsize, mt->m_wr); - if (!outf) - outf = stdout; - if (r > 0) - fwrite (wrbuf_buf(mt->m_wr), 1, wrbuf_len(mt->m_wr), outf); - yaz_marc_destroy(mt); - return r; -} - -/* depricated */ -int marc_display_ex (const char *buf, FILE *outf, int debug) -{ - return marc_display_exl (buf, outf, debug, -1); -} - -/* depricated */ -int marc_display (const char *buf, FILE *outf) -{ - return marc_display_ex (buf, outf, 0); -} - diff --git a/util/matchstr.c b/util/matchstr.c deleted file mode 100644 index e223132..0000000 --- a/util/matchstr.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: matchstr.c,v 1.7 2003-02-12 21:34:57 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include - -/* - * Match strings, independently of case and occurences of '-'. - * fairly inefficient - will be replaced with an indexing scheme for - * the various subsystems if we get a bottleneck here. - */ - -int yaz_matchstr(const char *s1, const char *s2) -{ - while (*s1 && *s2) - { - char c1 = *s1; - char c2 = *s2; - - if (c2 == '?') - return 0; - if (c1 == '-') - c1 = *++s1; - if (c2 == '-') - c2 = *++s2; - if (!c1 || !c2) - break; - if (c2 != '.') - { - if (isupper(c1)) - c1 = tolower(c1); - if (isupper(c2)) - c2 = tolower(c2); - if (c1 != c2) - break; - } - s1++; - s2++; - } - return *s1 || *s2; -} - -int yaz_strcmp_del(const char *a, const char *b, const char *b_del) -{ - while (*a && *b) - { - if (*a != *b) - return *a - *b; - a++; - b++; - } - if (b_del && strchr(b_del, *b)) - return *a; - return *a - *b; -} - -#ifdef __GNUC__ -#ifdef __CHECKER__ -void __assert_fail (const char *assertion, const char *file, - unsigned int line, const char *function) -{ - fprintf (stderr, "%s in file %s line %d func %s\n", - assertion, file, line, function); - abort (); -} -#endif -#endif diff --git a/util/nmem.c b/util/nmem.c deleted file mode 100644 index 24225c7..0000000 --- a/util/nmem.c +++ /dev/null @@ -1,483 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: nmem.c,v 1.42 2003-09-16 19:46:56 adam Exp $ - */ - -/* - * This is a simple and fairly wasteful little module for nibble memory - * allocation. Evemtually we'll put in something better. - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - -#ifdef WIN32 -#include -#endif - -#if YAZ_POSIX_THREADS -#include -#endif - -#if YAZ_GNU_THREADS -#include -#endif - -#define NMEM_CHUNK (4*1024) - -#ifdef WIN32 -static CRITICAL_SECTION critical_section; -#define NMEM_ENTER EnterCriticalSection(&critical_section) -#define NMEM_LEAVE LeaveCriticalSection(&critical_section) -struct nmem_mutex { - CRITICAL_SECTION m_handle; -}; -#elif YAZ_POSIX_THREADS -static pthread_mutex_t nmem_mutex = PTHREAD_MUTEX_INITIALIZER; -#define NMEM_ENTER pthread_mutex_lock(&nmem_mutex); -#define NMEM_LEAVE pthread_mutex_unlock(&nmem_mutex); -struct nmem_mutex { - pthread_mutex_t m_handle; -}; -#elif YAZ_GNU_THREADS -static pth_mutex_t nmem_mutex = PTH_MUTEX_INIT; -#define NMEM_ENTER pth_mutex_acquire(&nmem_mutex, 0, 0) -#define NMEM_LEAVE pth_mutex_release(&nmem_mutex) -struct nmem_mutex { - pth_mutex_t m_handle; -}; -#else -#define NMEM_ENTER -#define NMEM_LEAVE -struct nmem_mutex { - int dummy; -}; -#endif - -YAZ_EXPORT void nmem_mutex_create(NMEM_MUTEX *p) -{ - NMEM_ENTER; - if (!*p) - { - *p = (NMEM_MUTEX) malloc (sizeof(**p)); -#ifdef WIN32 - InitializeCriticalSection(&(*p)->m_handle); -#elif YAZ_POSIX_THREADS - pthread_mutex_init (&(*p)->m_handle, 0); -#elif YAZ_GNU_THREADS - pth_mutex_init (&(*p)->m_handle); -#endif - } - NMEM_LEAVE; -} - -YAZ_EXPORT void nmem_mutex_enter(NMEM_MUTEX p) -{ - if (p) - { -#ifdef WIN32 - EnterCriticalSection(&p->m_handle); -#elif YAZ_POSIX_THREADS - pthread_mutex_lock(&p->m_handle); -#endif - } -} - -YAZ_EXPORT void nmem_mutex_leave(NMEM_MUTEX p) -{ - if (p) - { -#ifdef WIN32 - LeaveCriticalSection(&p->m_handle); -#elif YAZ_POSIX_THREADS - pthread_mutex_unlock(&p->m_handle); -#endif - } -} - -YAZ_EXPORT void nmem_mutex_destroy(NMEM_MUTEX *p) -{ - NMEM_ENTER; - if (*p) - { -#ifdef WIN32 - DeleteCriticalSection(&(*p)->m_handle); -#endif - free (*p); - *p = 0; - } - NMEM_LEAVE; -} - -static nmem_block *freelist = NULL; /* "global" freelists */ -static nmem_control *cfreelist = NULL; -static int nmem_active_no = 0; -static int nmem_init_flag = 0; - -#if NMEM_DEBUG -struct nmem_debug_info { - void *p; - char file[40]; - int line; - struct nmem_debug_info *next; -}; - -struct nmem_debug_info *nmem_debug_list = 0; -#endif - -static void free_block(nmem_block *p) -{ - p->next = freelist; - freelist = p; -#if NMEM_DEBUG - yaz_log (LOG_DEBUG, "nmem free_block p=%p", p); -#endif -} - -#if NMEM_DEBUG -void nmem_print_list (void) -{ - struct nmem_debug_info *p; - - yaz_log (LOG_DEBUG, "nmem print list"); - NMEM_ENTER; - for (p = nmem_debug_list; p; p = p->next) - yaz_log (LOG_DEBUG, " %s:%d p=%p size=%d", p->file, p->line, p->p, - nmem_total(p->p)); - NMEM_LEAVE; -} -#endif -/* - * acquire a block with a minimum of size free bytes. - */ -static nmem_block *get_block(int size) -{ - nmem_block *r, *l; - -#if NMEM_DEBUG - yaz_log (LOG_DEBUG, "nmem get_block size=%d", size); -#endif - for (r = freelist, l = 0; r; l = r, r = r->next) - if (r->size >= size) - break; - if (r) - { -#if NMEM_DEBUG - yaz_log (LOG_DEBUG, "nmem get_block found free block p=%p", r); -#endif - if (l) - l->next = r->next; - else - freelist = r->next; - } - else - { - int get = NMEM_CHUNK; - - if (get < size) - get = size; -#if NMEM_DEBUG - yaz_log (LOG_DEBUG, "nmem get_block alloc new block size=%d", get); -#endif - r = (nmem_block *)xmalloc(sizeof(*r)); - r->buf = (char *)xmalloc(r->size = get); - } - r->top = 0; - return r; -} - -void nmem_reset(NMEM n) -{ - nmem_block *t; - -#if NMEM_DEBUG - yaz_log (LOG_DEBUG, "nmem_reset p=%p", n); -#endif - if (!n) - return; - NMEM_ENTER; - while (n->blocks) - { - t = n->blocks; - n->blocks = n->blocks->next; - free_block(t); - } - n->total = 0; - NMEM_LEAVE; -} - -#if NMEM_DEBUG -void *nmem_malloc_f (const char *file, int line, NMEM n, int size) -#else -void *nmem_malloc(NMEM n, int size) -#endif -{ - struct nmem_block *p; - char *r; - -#if NMEM_DEBUG - yaz_log (LOG_DEBUG, "%s:%d: nmem_malloc p=%p size=%d", file, line, - n, size); -#endif - if (!n) - { - yaz_log (LOG_FATAL, "calling nmem_malloc with an null pointer"); - abort (); - } -#ifdef WIN32 - assert (nmem_init_flag); -#endif - NMEM_ENTER; - p = n->blocks; - if (!p || p->size - p->top < size) - { - p = get_block(size); - p->next = n->blocks; - n->blocks = p; - } - r = p->buf + p->top; - /* align size */ - p->top += (size + (sizeof(long) - 1)) & ~(sizeof(long) - 1); - n->total += size; - NMEM_LEAVE; - return r; -} - -int nmem_total(NMEM n) -{ - return n->total; -} - -#if NMEM_DEBUG -NMEM nmem_create_f(const char *file, int line) -#else -NMEM nmem_create(void) -#endif -{ - NMEM r; -#if NMEM_DEBUG - struct nmem_debug_info *debug_p; -#endif - - NMEM_ENTER; - nmem_active_no++; - r = cfreelist; - if (r) - cfreelist = cfreelist->next; - else - r = (nmem_control *)xmalloc(sizeof(*r)); - NMEM_LEAVE; - -#if NMEM_DEBUG - yaz_log (LOG_DEBUG, "%s:%d: nmem_create %d p=%p", file, line, - nmem_active_no, r); -#endif - r->blocks = 0; - r->total = 0; - r->next = 0; - -#if NMEM_DEBUG - for (debug_p = nmem_debug_list; debug_p; debug_p = debug_p->next) - if (debug_p->p == r) - { - yaz_log (LOG_FATAL, "multi used block in nmem"); - abort (); - } - debug_p = xmalloc (sizeof(*debug_p)); - strncpy (debug_p->file, file, sizeof(debug_p->file)-1); - debug_p->file[sizeof(debug_p->file)-1] = '\0'; - debug_p->line = line; - debug_p->p = r; - debug_p->next = nmem_debug_list; - nmem_debug_list = debug_p; - - nmem_print_list(); -#endif - return r; -} - -#if NMEM_DEBUG -void nmem_destroy_f(const char *file, int line, NMEM n) -#else -void nmem_destroy(NMEM n) -#endif -{ -#if NMEM_DEBUG - struct nmem_debug_info **debug_p; - int ok = 0; -#endif - if (!n) - return; - -#if NMEM_DEBUG - yaz_log (LOG_DEBUG, "%s:%d: nmem_destroy %d p=%p", file, line, - nmem_active_no-1, n); - NMEM_ENTER; - for (debug_p = &nmem_debug_list; *debug_p; debug_p = &(*debug_p)->next) - if ((*debug_p)->p == n) - { - struct nmem_debug_info *debug_save = *debug_p; - *debug_p = (*debug_p)->next; - xfree (debug_save); - ok = 1; - break; - } - NMEM_LEAVE; - nmem_print_list(); - if (!ok) - { - yaz_log (LOG_WARN, "%s:%d destroying unallocated nmem block p=%p", - file, line, n); - return; - } -#endif - nmem_reset(n); - NMEM_ENTER; - nmem_active_no--; - n->next = cfreelist; - cfreelist = n; - NMEM_LEAVE; -} - -void nmem_transfer (NMEM dst, NMEM src) -{ - nmem_block *t; - while ((t=src->blocks)) - { - src->blocks = t->next; - t->next = dst->blocks; - dst->blocks = t; - } - dst->total += src->total; - src->total = 0; -} - -void nmem_critical_enter (void) -{ - NMEM_ENTER; -} - -void nmem_critical_leave (void) -{ - NMEM_LEAVE; -} - -void nmem_init (void) -{ - if (++nmem_init_flag == 1) - { -#ifdef WIN32 - InitializeCriticalSection(&critical_section); -#elif YAZ_GNU_THREADS - yaz_log (LOG_LOG, "pth_init"); - pth_init (); -#endif - nmem_active_no = 0; - freelist = NULL; - cfreelist = NULL; - } -} - -void nmem_exit (void) -{ - if (--nmem_init_flag == 0) - { - oid_exit(); - while (freelist) - { - struct nmem_block *fl = freelist; - freelist = freelist->next; - xfree (fl->buf); - xfree (fl); - } - while (cfreelist) - { - struct nmem_control *cfl = cfreelist; - cfreelist = cfreelist->next; - xfree (cfl); - } -#ifdef WIN32 - DeleteCriticalSection(&critical_section); -#endif - } -} - - -#ifdef WIN32 -BOOL WINAPI DllMain (HINSTANCE hinstDLL, - DWORD reason, - LPVOID reserved) -{ - switch (reason) - { - case DLL_PROCESS_ATTACH: - nmem_init (); - break; - case DLL_PROCESS_DETACH: - nmem_exit (); - } - return TRUE; -} -#endif - -int yaz_errno(void) -{ - return errno; -} - -void yaz_set_errno(int v) -{ - errno = v; -} - -void yaz_strerror(char *buf, int max) -{ - char *cp; -#ifdef WIN32 - DWORD err = GetLastError(); - if (err) - { - FormatMessage( - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - err, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default lang */ - (LPTSTR) buf, - max-1, - NULL); - } - else - *buf = '\0'; -#else -/* UNIX */ -#if HAVE_STRERROR_R -#if YAZ_POSIX_THREADS - *buf = '\0'; - strerror_r(errno, buf, max); - /* if buffer is unset - use strerror anyway (GLIBC bug) */ - if (*buf == '\0') - strcpy(buf, strerror(yaz_errno())); -#else - strcpy(buf, strerror(yaz_errno())); -#endif -#else - strcpy(buf, strerror(yaz_errno())); -#endif -/* UNIX */ -#endif - if ((cp=strrchr(buf, '\n'))) - *cp = '\0'; - if ((cp=strrchr(buf, '\r'))) - *cp = '\0'; -} diff --git a/util/nmemsdup.c b/util/nmemsdup.c deleted file mode 100644 index 33a643e..0000000 --- a/util/nmemsdup.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 1997-2003, Index Data. - * See the file LICENSE for details. - * - * $Id: nmemsdup.c,v 1.6 2003-03-18 13:34:37 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include - -char *nmem_strdup (NMEM mem, const char *src) -{ - char *dst = (char *)nmem_malloc (mem, strlen(src)+1); - strcpy (dst, src); - return dst; -} - -char *nmem_strdupn (NMEM mem, const char *src, size_t n) -{ - char *dst = (char *)nmem_malloc (mem, n+1); - memcpy (dst, src, n); - dst[n] = '\0'; - return dst; -} - -int *nmem_intdup(NMEM mem, int v) -{ - int *dst = (int*) nmem_malloc (mem, sizeof(int)); - *dst = v; - return dst; -} diff --git a/util/oid.c b/util/oid.c deleted file mode 100644 index 25c198b..0000000 --- a/util/oid.c +++ /dev/null @@ -1,614 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * - * $Id: oid.c,v 1.68 2003-09-11 12:30:59 mike Exp $ - */ - -/* - * More or less protocol-transparent OID database. - * We could (and should?) extend this so that the user app can add new - * entries to the list at initialization. - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - -#include -#include - -static int z3950_prefix[] = { 1, 2, 840, 10003, -1 }; -static int sr_prefix[] = { 1, 0, 10163, -1 }; - -struct oident_list { - struct oident oident; - struct oident_list *next; -}; - -static struct oident_list *oident_table = NULL; -static int oid_value_dynamic = VAL_DYNAMIC; -static int oid_init_flag = 0; -static NMEM_MUTEX oid_mutex = 0; -static NMEM oid_nmem = 0; - -/* - * OID database - */ -static oident standard_oids[] = -{ - /* General definitions */ - {PROTO_GENERAL, CLASS_TRANSYN, VAL_BER, {2,1,1,-1}, - "BER" }, - {PROTO_GENERAL, CLASS_TRANSYN, VAL_ISO2709, {1,0,2709,1,1,-1}, - "ISO2709"}, - {PROTO_GENERAL, CLASS_GENERAL, VAL_ISO_ILL_1, {1,0,10161,2,1,-1}, - "ISOILL-1"}, - /* Z39.50v3 definitions */ - {PROTO_Z3950, CLASS_ABSYN, VAL_APDU, {2,1,-1}, - "Z-APDU"}, - {PROTO_Z3950, CLASS_APPCTX, VAL_BASIC_CTX, {1,1,-1}, - "Z-BASIC"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_BIB1, {3,1,-1}, - "Bib-1"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_EXP1, {3,2,-1}, - "Exp-1"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_EXT1, {3,3,-1}, - "Ext-1"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_CCL1, {3,4,-1}, - "CCL-1"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_GILS, {3,5,-1}, - "GILS-attset"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_GILS, {3,5,-1}, - "GILS"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_STAS, {3,6,-1}, - "STAS-attset"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_COLLECT1, {3,7,-1}, - "Collections-attset"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_CIMI1, {3,8,-1}, - "CIMI-attset"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_GEO, {3,9,-1}, - "Geo-attset"}, - - {PROTO_Z3950, CLASS_ATTSET, VAL_ZBIG, {3,10,-1}, - "ZBIG"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_UTIL, {3,11,-1}, - "Util"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_XD1, {3,12,-1}, - "XD-1"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_ZTHES, {3,13,-1}, - "Zthes"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_FIN1, {3,14,-1}, - "Fin-1"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_DAN1, {3,15,-1}, - "Dan-1"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_HOLDINGS, {3,16,-1}, - "Holdings"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_USMARC, {3,17,-1}, - "MARC"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_BIB2, {3,18,-1}, - "Bib-2"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_ZEEREX, {3,19,-1}, - "ZeeRex"}, - /* New applications should use Zthes-1 instead of this Satan-spawn */ - {PROTO_Z3950, CLASS_ATTSET, VAL_THESAURUS, {3,1000,81,1,-1}, - "Thesaurus-attset"}, - {PROTO_Z3950, CLASS_ATTSET, VAL_IDXPATH, {3,1000,81,2,-1}, - "IDXPATH"}, - {PROTO_Z3950, CLASS_DIAGSET, VAL_BIB1, {4,1,-1}, - "Bib-1"}, - {PROTO_Z3950, CLASS_DIAGSET, VAL_DIAG1, {4,2,-1}, - "Diag-1"}, - {PROTO_Z3950, CLASS_DIAGSET, VAL_DIAG_ES, {4,3,-1}, - "Diag-ES"}, - {PROTO_Z3950, CLASS_DIAGSET, VAL_DIAG_GENERAL, {4,3,-1}, - "Diag-General"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_UNIMARC, {5,1,-1}, - "Unimarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_INTERMARC, {5,2,-1}, - "Intermarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_CCF, {5,3,-1}, - "CCF"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_USMARC, {5,10,-1}, - "USmarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_UKMARC, {5,11,-1}, - "UKmarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_NORMARC, {5,12,-1}, - "Normarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_LIBRISMARC, {5,13,-1}, - "Librismarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_DANMARC, {5,14,-1}, - "Danmarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_FINMARC, {5,15,-1}, - "Finmarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_MAB, {5,16,-1}, - "MAB"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_CANMARC, {5,17,-1}, - "Canmarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_SBN, {5,18,-1}, - "SBN"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_PICAMARC, {5,19,-1}, - "Picamarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_AUSMARC, {5,20,-1}, - "Ausmarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_IBERMARC, {5,21,-1}, - "Ibermarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_CATMARC, {5,22,-1}, - "Carmarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_MALMARC, {5,23,-1}, - "Malmarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_JPMARC, {5,24,-1}, - "JPmarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_SWEMARC, {5,25,-1}, - "SWEmarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_SIGLEMARC, {5,26,-1}, - "SIGLEmarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_ISDSMARC, {5,27,-1}, - "ISDSmarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_RUSMARC, {5,28,-1}, - "RUSmarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_HUNMARC, {5,29,-1}, - "Hunmarc"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_EXPLAIN, {5,100,-1}, - "Explain"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_SUTRS, {5,101,-1}, - "SUTRS"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_OPAC, {5,102,-1}, - "OPAC"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_SUMMARY, {5,103,-1}, - "Summary"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_GRS0, {5,104,-1}, - "GRS-0"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_GRS1, {5,105,-1}, - "GRS-1"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_EXTENDED, {5,106,-1}, - "Extended"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_FRAGMENT, {5,107,-1}, - "Fragment"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_PDF, {5,109,1,-1}, - "pdf"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_POSTSCRIPT, {5,109,2,-1}, - "postscript"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_HTML, {5,109,3,-1}, - "html"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_TIFF, {5,109,4,-1}, - "tiff"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_GIF, {5,109,5,-1}, - "gif"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_JPEG, {5,109,6,-1}, - "jpeg"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_PNG, {5,109,7,-1}, - "png"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_MPEG, {5,109,8,-1}, - "mpeg"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_SGML, {5,109,9,-1}, - "sgml"}, - - {PROTO_Z3950, CLASS_RECSYN, VAL_TIFFB, {5,110,1,-1}, - "tiff-b"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_WAV, {5,110,2,-1}, - "wav"}, - - {PROTO_Z3950, CLASS_RECSYN, VAL_SQLRS, {5,111,-1}, - "SQL-RS"}, - {PROTO_Z3950, CLASS_RECSYN, VAL_SOIF, {5,1000,81,2,-1}, - "SOIF" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_TEXT_XML, {5,109,10,-1}, - "text-XML" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_TEXT_XML, {5,109,10,-1}, - "XML" }, - {PROTO_Z3950, CLASS_RECSYN, VAL_APPLICATION_XML, {5,109,11,-1}, - "application-XML" }, - {PROTO_Z3950, CLASS_RESFORM, VAL_RESOURCE1, {7,1,-1}, - "Resource-1"}, - {PROTO_Z3950, CLASS_RESFORM, VAL_RESOURCE2, {7,2,-1}, - "Resource-2"}, - {PROTO_Z3950, CLASS_RESFORM, VAL_UNIVERSE_REPORT, {7,1000,81,1,-1}, - "UNIverse-Resource-Report"}, - - {PROTO_Z3950, CLASS_ACCFORM, VAL_PROMPT1, {8,1,-1}, - "Prompt-1"}, - {PROTO_Z3950, CLASS_ACCFORM, VAL_DES1, {8,2,-1}, - "Des-1"}, - {PROTO_Z3950, CLASS_ACCFORM, VAL_KRB1, {8,3,-1}, - "Krb-1"}, - {PROTO_Z3950, CLASS_EXTSERV, VAL_PRESSET, {9,1,-1}, - "Pers. set"}, - {PROTO_Z3950, CLASS_EXTSERV, VAL_PQUERY, {9,2,-1}, - "Pers. query"}, - {PROTO_Z3950, CLASS_EXTSERV, VAL_PCQUERY, {9,3,-1}, - "Per'd query"}, - {PROTO_Z3950, CLASS_EXTSERV, VAL_ITEMORDER, {9,4,-1}, - "Item order"}, - {PROTO_Z3950, CLASS_EXTSERV, VAL_DBUPDATE0, {9,5,-1}, - "DB. Update (first version)"}, - {PROTO_Z3950, CLASS_EXTSERV, VAL_DBUPDATE1, {9,5,1,-1}, - "DB. Update (second version)"}, - {PROTO_Z3950, CLASS_EXTSERV, VAL_DBUPDATE, {9,5,1,1,-1}, - "DB. Update"}, - {PROTO_Z3950, CLASS_EXTSERV, VAL_EXPORTSPEC, {9,6,-1}, - "exp. spec."}, - {PROTO_Z3950, CLASS_EXTSERV, VAL_EXPORTINV, {9,7,-1}, - "exp. inv."}, - {PROTO_Z3950, CLASS_EXTSERV, VAL_ADMINSERVICE, {9,1000,81,1,-1}, - "Admin"}, - {PROTO_Z3950, CLASS_USERINFO,VAL_SEARCHRES1, {10,1,-1}, - "searchResult-1"}, - {PROTO_Z3950, CLASS_USERINFO,VAL_CHARLANG, {10,2,-1}, - "CharSetandLanguageNegotiation"}, - {PROTO_Z3950, CLASS_USERINFO,VAL_USERINFO1, {10,3,-1}, - "UserInfo-1"}, - {PROTO_Z3950, CLASS_USERINFO,VAL_MULTISRCH1, {10,4,-1}, - "MultipleSearchTerms-1"}, - {PROTO_Z3950, CLASS_USERINFO,VAL_MULTISRCH2, {10,5,-1}, - "MultipleSearchTerms-2"}, - {PROTO_Z3950, CLASS_USERINFO,VAL_DATETIME, {10,6,-1}, - "DateTime"}, - {PROTO_Z3950, CLASS_USERINFO,VAL_PROXY, {10,1000,81,1,-1}, - "Proxy" }, - {PROTO_Z3950, CLASS_USERINFO,VAL_COOKIE, {10,1000,81,2,-1}, - "Cookie" }, - {PROTO_Z3950, CLASS_USERINFO,VAL_CLIENT_IP, {10,1000,81,3,-1}, - "Client-IP" }, - {PROTO_Z3950, CLASS_ELEMSPEC,VAL_ESPEC1, {11,1,-1}, - "Espec-1"}, - {PROTO_Z3950, CLASS_VARSET, VAL_VAR1, {12,1,-1}, - "Variant-1"}, - {PROTO_Z3950, CLASS_SCHEMA, VAL_WAIS, {13,1,-1}, - "WAIS-schema"}, - {PROTO_Z3950, CLASS_SCHEMA, VAL_GILS, {13,2,-1}, - "GILS-schema"}, - {PROTO_Z3950, CLASS_SCHEMA, VAL_COLLECT1, {13,3,-1}, - "Collections-schema"}, - {PROTO_Z3950, CLASS_SCHEMA, VAL_GEO, {13,4,-1}, - "Geo-schema"}, - {PROTO_Z3950, CLASS_SCHEMA, VAL_CIMI1, {13,5,-1}, - "CIMI-schema"}, - {PROTO_Z3950, CLASS_SCHEMA, VAL_UPDATEES, {13,6,-1}, - "Update ES"}, - {PROTO_Z3950, CLASS_SCHEMA, VAL_HOLDINGS, {13,7,-1}, - "Holdings"}, - {PROTO_Z3950, CLASS_SCHEMA, VAL_ZTHES, {13,8,-1}, - "Zthes"}, - {PROTO_Z3950, CLASS_SCHEMA, VAL_THESAURUS, {13,1000,81,1,-1}, - "thesaurus-schema"}, - {PROTO_Z3950, CLASS_SCHEMA, VAL_EXPLAIN, {13,1000,81,2,-1}, - "Explain-schema"}, - {PROTO_Z3950, CLASS_TAGSET, VAL_SETM, {14,1,-1}, - "TagsetM"}, - {PROTO_Z3950, CLASS_TAGSET, VAL_SETG, {14,2,-1}, - "TagsetG"}, - {PROTO_Z3950, CLASS_TAGSET, VAL_STAS, {14,3,-1}, - "STAS-tagset"}, - {PROTO_Z3950, CLASS_TAGSET, VAL_GILS, {14,4,-1}, - "GILS-tagset"}, - {PROTO_Z3950, CLASS_TAGSET, VAL_COLLECT1, {14,5,-1}, - "Collections-tagset"}, - {PROTO_Z3950, CLASS_TAGSET, VAL_CIMI1, {14,6,-1}, - "CIMI-tagset"}, - {PROTO_Z3950, CLASS_TAGSET, VAL_THESAURUS, {14,1000,81,1,-1}, - "thesaurus-tagset"}, /* What is this Satan-spawn doing here? */ - {PROTO_Z3950, CLASS_TAGSET, VAL_EXPLAIN, {14,1000,81,2,-1}, - "Explain-tagset"}, - {PROTO_Z3950, CLASS_TAGSET, VAL_ZTHES, {14,8,-1}, - "Zthes-tagset"}, - {PROTO_Z3950, CLASS_NEGOT, VAL_CHARNEG3, {15,3,-1}, - "CharSetandLanguageNegotiation-3"}, - {PROTO_Z3950, CLASS_NEGOT, VAL_ID_CHARSET, {15,1000,81,1,-1}, - "ID-Charset" }, - {PROTO_Z3950, CLASS_USERINFO,VAL_CQL, {16, 2, -1}, - "CQL"}, - {PROTO_GENERAL, CLASS_GENERAL, VAL_UCS2, {1,0,10646,1,0,2,-1}, - "UCS-2"}, - {PROTO_GENERAL, CLASS_GENERAL, VAL_UCS4, {1,0,10646,1,0,4,-1}, - "UCS-4"}, - {PROTO_GENERAL, CLASS_GENERAL, VAL_UTF16, {1,0,10646,1,0,5,-1}, - "UTF-16"}, - {PROTO_GENERAL, CLASS_GENERAL, VAL_UTF8, {1,0,10646,1,0,8,-1}, - "UTF-8"}, - {PROTO_Z3950, CLASS_USERINFO,VAL_OCLCUI, {10, 1000, 17, 1, -1}, - "OCLC-userInfo"}, - {PROTO_NOP, CLASS_NOP, VAL_NOP, {-1}, 0 } -}; - -/* OID utilities */ - -void oid_oidcpy(int *t, int *s) -{ - while ((*(t++) = *(s++)) > -1); -} - -void oid_oidcat(int *t, int *s) -{ - while (*t > -1) - t++; - while ((*(t++) = *(s++)) > -1); -} - -int oid_oidcmp(int *o1, int *o2) -{ - while (*o1 == *o2 && *o1 > -1) - { - o1++; - o2++; - } - if (*o1 == *o2) - return 0; - else if (*o1 > *o2) - return 1; - else - return -1; -} - -int oid_oidlen(int *o) -{ - int len = 0; - - while (*(o++) >= 0) - len++; - return len; -} - - -static int match_prefix(int *look, int *prefix) -{ - int len; - - for (len = 0; *look == *prefix; look++, prefix++, len++); - if (*prefix < 0) /* did we reach the end of the prefix? */ - return len; - return 0; -} - -void oid_transfer (struct oident *oidentp) -{ - while (*oidentp->oidsuffix >= 0) - { - oid_addent (oidentp->oidsuffix, oidentp->proto, - oidentp->oclass, - oidentp->desc, oidentp->value); - oidentp++; - } -} - -void oid_init (void) -{ - if (oid_init_flag == 0) - { - /* oid_transfer is thread safe, so there's nothing wrong in having - two threads calling it simultaniously. On the other hand - no thread may exit oid_init before all OID's bave been - transferred - which is why checked is set after oid_transfer... - */ - nmem_mutex_create (&oid_mutex); - nmem_mutex_enter (oid_mutex); - if (!oid_nmem) - oid_nmem = nmem_create (); - nmem_mutex_leave (oid_mutex); - oid_transfer (standard_oids); - oid_init_flag = 1; - } -} - -void oid_exit (void) -{ - if (oid_init_flag) - { - oid_init_flag = 0; - nmem_mutex_destroy (&oid_mutex); - nmem_destroy (oid_nmem); - oid_nmem = 0; - } -} - -static struct oident *oid_getentbyoid_x(int *o) -{ - enum oid_proto proto; - int prelen; - struct oident_list *ol; - - /* determine protocol type */ - if ((prelen = match_prefix(o, z3950_prefix)) != 0) - proto = PROTO_Z3950; - else if ((prelen = match_prefix(o, sr_prefix)) != 0) - proto = PROTO_SR; - else - proto = PROTO_GENERAL; - for (ol = oident_table; ol; ol = ol->next) - { - struct oident *p = &ol->oident; - if (p->proto == proto && !oid_oidcmp(o + prelen, p->oidsuffix)) - return p; - if (p->proto == PROTO_GENERAL && !oid_oidcmp (o, p->oidsuffix)) - return p; - } - return 0; -} - -/* - * To query, fill out proto, class, and value of the ent parameter. - */ -int *oid_ent_to_oid(struct oident *ent, int *ret) -{ - struct oident_list *ol; - - oid_init (); - for (ol = oident_table; ol; ol = ol->next) - { - struct oident *p = &ol->oident; - if (ent->value == p->value && - (p->proto == PROTO_GENERAL || (ent->proto == p->proto && - (ent->oclass == p->oclass || ent->oclass == CLASS_GENERAL)))) - { - if (p->proto == PROTO_Z3950) - oid_oidcpy(ret, z3950_prefix); - else if (p->proto == PROTO_SR) - oid_oidcpy(ret, sr_prefix); - else - ret[0] = -1; - oid_oidcat(ret, p->oidsuffix); - ent->desc = p->desc; - return ret; - } - } - ret[0] = -1; - return 0; -} - -/* - * To query, fill out proto, class, and value of the ent parameter. - */ -int *oid_getoidbyent(struct oident *ent) -{ - static int ret[OID_SIZE]; - - return oid_ent_to_oid (ent, ret); -} - -struct oident *oid_addent (int *oid, enum oid_proto proto, - enum oid_class oclass, - const char *desc, int value) -{ - struct oident *oident = 0; - - nmem_mutex_enter (oid_mutex); - if (!oident) - { - char desc_str[200]; - struct oident_list *oident_list; - oident_list = (struct oident_list *) - nmem_malloc (oid_nmem, sizeof(*oident_list)); - oident = &oident_list->oident; - oident->proto = proto; - oident->oclass = oclass; - - if (!desc) - { - int i; - - sprintf (desc_str, "%d", *oid); - for (i = 1; i < 12 && oid[i] >= 0; i++) - sprintf (desc_str+strlen(desc_str), ".%d", oid[i]); - desc = desc_str; - } - oident->desc = nmem_strdup (oid_nmem, desc); - if (value == VAL_DYNAMIC) - oident->value = (enum oid_value) (++oid_value_dynamic); - else - oident->value = (enum oid_value) value; - oid_oidcpy (oident->oidsuffix, oid); - oident_list->next = oident_table; - oident_table = oident_list; - } - nmem_mutex_leave (oid_mutex); - return oident; -} - -struct oident *oid_getentbyoid(int *oid) -{ - struct oident *oident; - - if (!oid) - return 0; - oid_init (); - oident = oid_getentbyoid_x (oid); - if (!oident) - oident = oid_addent (oid, PROTO_GENERAL, CLASS_GENERAL, - NULL, VAL_DYNAMIC); - return oident; -} - -static oid_value oid_getval_raw(const char *name) -{ - int val = 0, i = 0, oid[OID_SIZE]; - struct oident *oident; - - while (isdigit (*name)) - { - val = val*10 + (*name - '0'); - name++; - if (*name == '.') - { - if (i < OID_SIZE-1) - oid[i++] = val; - val = 0; - name++; - } - } - oid[i] = val; - oid[i+1] = -1; - oident = oid_getentbyoid_x (oid); - if (!oident) - oident = oid_addent (oid, PROTO_GENERAL, CLASS_GENERAL, NULL, - VAL_DYNAMIC); - return oident->value; -} - -oid_value oid_getvalbyname(const char *name) -{ - struct oident_list *ol; - - oid_init (); - if (isdigit (*name)) - return oid_getval_raw (name); - for (ol = oident_table; ol; ol = ol->next) - if (!yaz_matchstr(ol->oident.desc, name)) - { - return ol->oident.value; - } - return VAL_NONE; -} - -void oid_setprivateoids(oident *list) -{ - oid_transfer (list); -} - -void oid_trav (void (*func)(struct oident *oidinfo, void *vp), void *vp) -{ - struct oident_list *ol; - - oid_init (); - for (ol = oident_table; ol; ol = ol->next) - (*func)(&ol->oident, vp); -} - -int *oid_name_to_oid(oid_class oclass, const char *name, int *oid) { - struct oident ent; - - /* Translate syntax to oid_val */ - oid_value value = oid_getvalbyname(name); - - /* Build it into an oident */ - ent.proto = PROTO_Z3950; - ent.oclass = oclass; - ent.value = value; - - /* Translate to an array of int */ - return oid_ent_to_oid(&ent, oid); -} - -char *oid_to_dotstring(const int *oid, char *oidbuf) { - char tmpbuf[20]; - int i; - - oidbuf[0] = '\0'; - for (i = 0; oid[i] != -1; i++) { - sprintf(tmpbuf, "%d", oid[i]); - if (i > 0) strcat(oidbuf, "."); - strcat(oidbuf, tmpbuf); - } - - return oidbuf; -} - -char *oid_name_to_dotstring(oid_class oclass, const char *name, char *oidbuf) { - int oid[OID_SIZE]; - - (void) oid_name_to_oid(oclass, name, oid); - return oid_to_dotstring(oid, oidbuf); -} - diff --git a/util/options.c b/util/options.c deleted file mode 100644 index 591a329..0000000 --- a/util/options.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 1995-2000, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: options.c,v $ - * Revision 1.8 2000-02-29 13:44:55 adam - * Check for config.h (currently not generated). - * - * Revision 1.7 1999/11/30 13:47:12 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.6 1997/09/01 08:54:13 adam - * New windows NT/95 port using MSV5.0. Made prefix query handling - * thread safe. The function options ignores empty arguments when met. - * - * Revision 1.5 1995/12/06 13:00:19 adam - * Minus alone not treated as an option. - * - * Revision 1.4 1995/09/29 17:12:35 quinn - * Smallish - * - * Revision 1.3 1995/09/27 15:03:03 quinn - * Modified function heads & prototypes. - * - * Revision 1.2 1995/05/16 08:51:13 quinn - * License, documentation, and memory fixes - * - * Revision 1.1 1995/03/27 08:35:18 quinn - * Created util library - * Added memory debugging module. Imported options-manager - * - * Revision 1.2 1994/10/04 17:47:10 adam - * Function options now returns arg with error option. - * - * Revision 1.1 1994/08/16 15:57:22 adam - * The first utility modules. - * - */ -#if HAVE_CONFIG_H -#include -#endif - -#include - -#include - -static int arg_no = 1; -static int arg_off = 0; - -int options (const char *desc, char **argv, int argc, char **arg) -{ - int ch, i = 0; - - if (arg_no >= argc) - return -2; - if (arg_off == 0) - { - while (argv[arg_no][0] == '\0') - { - arg_no++; - if (arg_no >= argc) - return -2; - } - if (argv[arg_no][0] != '-' || argv[arg_no][1] == '\0') - { - *arg = argv[arg_no++]; - return 0; - } - arg_off++; - } - ch = argv[arg_no][arg_off++]; - while (desc[i]) - { - int desc_char = desc[i++]; - int type = 0; - if (desc[i] == ':') - { /* string argument */ - type = desc[i++]; - } - if (desc_char == ch) - { /* option with argument */ - if (type) - { - if (argv[arg_no][arg_off]) - { - *arg = argv[arg_no]+arg_off; - arg_no++; - arg_off = 0; - } - else - { - arg_no++; - arg_off = 0; - if (arg_no < argc) - *arg = argv[arg_no++]; - else - *arg = ""; - } - } - else /* option with no argument */ - { - if (argv[arg_no][arg_off]) - arg_off++; - else - { - arg_off = 0; - arg_no++; - } - } - return ch; - } - } - *arg = argv[arg_no]+arg_off-1; - arg_no = arg_no + 1; - arg_off = 0; - return -1; -} diff --git a/util/readconf.c b/util/readconf.c deleted file mode 100644 index ce28536..0000000 --- a/util/readconf.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 1994-2000, Index Data - * All rights reserved. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: readconf.c,v $ - * Revision 1.10 2000-02-29 13:44:55 adam - * Check for config.h (currently not generated). - * - * Revision 1.9 1999/11/30 13:47:12 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.8 1999/08/27 09:40:32 adam - * Renamed logf function to yaz_log. Removed VC++ project files. - * - * Revision 1.7 1999/06/30 09:10:32 adam - * Fixed reading of MS-DOS files. - * - * Revision 1.6 1998/10/13 16:09:55 adam - * Added support for arbitrary OID's for tagsets, schemas and attribute sets. - * Added support for multiple attribute set references and tagset references - * from an abstract syntax file. - * Fixed many bad logs-calls in routines that read the various - * specifications regarding data1 (*.abs,*.att,...) and made the messages - * consistent whenever possible. - * Added extra 'lineno' argument to function readconf_line. - * - * Revision 1.5 1997/09/04 07:53:02 adam - * Added include readconf.h. - * - * Revision 1.4 1997/05/14 06:54:07 adam - * C++ support. - * - * Revision 1.3 1996/05/29 15:48:48 quinn - * Added \n to the isspace rule. - * - * Revision 1.2 1996/05/29 10:05:01 quinn - * Changed space criteria to support 8-bit characters - * - * Revision 1.1 1995/11/01 13:55:06 quinn - * Minor adjustments - * - * Revision 1.2 1995/10/30 13:54:27 quinn - * iRemoved fclose(). - * - * Revision 1.1 1995/10/10 16:28:18 quinn - * Initial revision - * - * - */ -#if HAVE_CONFIG_H -#include -#endif - -#include -#include - -#include -#include - -#define l_isspace(c) ((c) == '\t' || (c) == ' ' || (c) == '\n' || (c) == '\r') - -int readconf_line(FILE *f, int *lineno, char *line, int len, - char *argv[], int num) -{ - char *p; - int argc; - - while ((p = fgets(line, len, f))) - { - (*lineno)++; - while (*p && l_isspace(*p)) - p++; - if (*p && *p != '#') - break; - } - if (!p) - return 0; - - for (argc = 0; *p ; argc++) - { - if (*p == '#') /* trailing comment */ - break; - argv[argc] = p; - while (*p && !l_isspace(*p)) - p++; - if (*p) - { - *(p++) = '\0'; - while (*p && l_isspace(*p)) - p++; - } - } - return argc; -} - -/* - * Read lines of a configuration file. - */ -int readconf(char *name, void *rprivate, - int (*fun)(char *name, void *rprivate, int argc, char *argv[])) -{ - FILE *f; - char line[512], *m_argv[50]; - int m_argc; - int lineno = 0; - - if (!(f = fopen(name, "r"))) - { - yaz_log(LOG_WARN|LOG_ERRNO, "readconf: %s", name); - return -1; - } - for (;;) - { - int res; - - if (!(m_argc = readconf_line(f, &lineno, line, 512, m_argv, 50))) - { - fclose(f); - return 0; - } - - if ((res = (*fun)(name, rprivate, m_argc, m_argv))) - { - fclose(f); - return res; - } - } -} diff --git a/util/siconv.c b/util/siconv.c deleted file mode 100644 index 73d7148..0000000 --- a/util/siconv.c +++ /dev/null @@ -1,541 +0,0 @@ -/* - * Copyright (c) 1997-2003, Index Data - * See the file LICENSE for details. - * - * $Id: siconv.c,v 1.9 2003-01-06 08:20:28 adam Exp $ - */ - -/* mini iconv and wrapper for system iconv library (if present) */ - -#if HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#if HAVE_WCHAR_H -#include -#endif - -#if HAVE_ICONV_H -#include -#endif - -#include - -unsigned long yaz_marc8_conv (unsigned char *inp, size_t inbytesleft, - size_t *no_read); - -struct yaz_iconv_struct { - int my_errno; - int init_flag; - size_t (*init_handle)(yaz_iconv_t cd, unsigned char *inbuf, - size_t inbytesleft, size_t *no_read); - unsigned long (*read_handle)(yaz_iconv_t cd, unsigned char *inbuf, - size_t inbytesleft, size_t *no_read); - size_t (*write_handle)(yaz_iconv_t cd, unsigned long x, - char **outbuf, size_t *outbytesleft); -#if HAVE_ICONV_H - iconv_t iconv_cd; -#endif -}; - -static unsigned long yaz_read_ISO8859_1 (yaz_iconv_t cd, unsigned char *inp, - size_t inbytesleft, size_t *no_read) -{ - unsigned long x = inp[0]; - *no_read = 1; - return x; -} - -static size_t yaz_init_UTF8 (yaz_iconv_t cd, unsigned char *inp, - size_t inbytesleft, size_t *no_read) -{ - if (inp[0] != 0xef) - { - *no_read = 0; - return 0; - } - if (inbytesleft < 3) - { - cd->my_errno = YAZ_ICONV_EINVAL; - return (size_t) -1; - } - if (inp[1] != 0xbb || inp[2] != 0xbf) - { - cd->my_errno = YAZ_ICONV_EILSEQ; - return (size_t) -1; - } - *no_read = 3; - return 0; -} - -static unsigned long yaz_read_UTF8 (yaz_iconv_t cd, unsigned char *inp, - size_t inbytesleft, size_t *no_read) -{ - unsigned long x = 0; - - if (inp[0] <= 0x7f) - { - x = inp[0]; - *no_read = 1; - } - else if (inp[0] <= 0xbf || inp[0] >= 0xfe) - { - *no_read = 0; - cd->my_errno = YAZ_ICONV_EILSEQ; - } - else if (inp[0] <= 0xdf && inbytesleft >= 2) - { - x = ((inp[0] & 0x1f) << 6) | (inp[1] & 0x3f); - if (x >= 0x80) - *no_read = 2; - else - { - *no_read = 0; - cd->my_errno = YAZ_ICONV_EILSEQ; - } - } - else if (inp[0] <= 0xef && inbytesleft >= 3) - { - x = ((inp[0] & 0x0f) << 12) | ((inp[1] & 0x3f) << 6) | - (inp[1] & 0x3f); - if (x >= 0x800) - *no_read = 3; - else - { - *no_read = 0; - cd->my_errno = YAZ_ICONV_EILSEQ; - } - } - else if (inp[0] <= 0xf7 && inbytesleft >= 4) - { - x = ((inp[0] & 0x07) << 18) | ((inp[1] & 0x3f) << 12) | - ((inp[2] & 0x3f) << 6) | (inp[3] & 0x3f); - if (x >= 0x10000) - *no_read = 4; - else - { - *no_read = 0; - cd->my_errno = YAZ_ICONV_EILSEQ; - } - } - else if (inp[0] <= 0xfb && inbytesleft >= 5) - { - x = ((inp[0] & 0x03) << 24) | ((inp[1] & 0x3f) << 18) | - ((inp[2] & 0x3f) << 12) | ((inp[3] & 0x3f) << 6) | - (inp[4] & 0x3f); - if (x >= 0x200000) - *no_read = 5; - else - { - *no_read = 0; - cd->my_errno = YAZ_ICONV_EILSEQ; - } - } - else if (inp[0] <= 0xfd && inbytesleft >= 6) - { - x = ((inp[0] & 0x01) << 30) | ((inp[1] & 0x3f) << 24) | - ((inp[2] & 0x3f) << 18) | ((inp[3] & 0x3f) << 12) | - ((inp[4] & 0x3f) << 6) | (inp[5] & 0x3f); - if (x >= 0x4000000) - *no_read = 6; - else - { - *no_read = 0; - cd->my_errno = YAZ_ICONV_EILSEQ; - } - } - else - { - *no_read = 0; - cd->my_errno = YAZ_ICONV_EINVAL; - } - return x; -} - -static unsigned long yaz_read_UCS4 (yaz_iconv_t cd, unsigned char *inp, - size_t inbytesleft, size_t *no_read) -{ - unsigned long x = 0; - - if (inbytesleft < 4) - { - cd->my_errno = YAZ_ICONV_EINVAL; /* incomplete input */ - *no_read = 0; - } - else - { - x = (inp[0]<<24) | (inp[1]<<16) | (inp[2]<<8) | inp[3]; - *no_read = 4; - } - return x; -} - -static unsigned long yaz_read_UCS4LE (yaz_iconv_t cd, unsigned char *inp, - size_t inbytesleft, size_t *no_read) -{ - unsigned long x = 0; - - if (inbytesleft < 4) - { - cd->my_errno = YAZ_ICONV_EINVAL; /* incomplete input */ - *no_read = 0; - } - else - { - x = (inp[3]<<24) | (inp[2]<<16) | (inp[1]<<8) | inp[0]; - *no_read = 4; - } - return x; -} - -#if HAVE_WCHAR_H -static unsigned long yaz_read_wchar_t (yaz_iconv_t cd, unsigned char *inp, - size_t inbytesleft, size_t *no_read) -{ - unsigned long x = 0; - - if (inbytesleft < sizeof(wchar_t)) - { - cd->my_errno = YAZ_ICONV_EINVAL; /* incomplete input */ - *no_read = 0; - } - else - { - wchar_t wch; - memcpy (&wch, inp, sizeof(wch)); - x = wch; - *no_read = sizeof(wch); - } - return x; -} -#endif - -static unsigned long yaz_read_marc8 (yaz_iconv_t cd, unsigned char *inp, - size_t inbytesleft, size_t *no_read) -{ - return yaz_marc8_conv(inp, inbytesleft, no_read); -} - -static size_t yaz_write_UTF8 (yaz_iconv_t cd, unsigned long x, - char **outbuf, size_t *outbytesleft) -{ - unsigned char *outp = (unsigned char *) *outbuf; - if (x <= 0x7f && *outbytesleft >= 1) - { - *outp++ = (unsigned char) x; - (*outbytesleft)--; - } - else if (x <= 0x7ff && *outbytesleft >= 2) - { - *outp++ = (unsigned char) ((x >> 6) | 0xc0); - *outp++ = (unsigned char) ((x & 0x3f) | 0x80); - (*outbytesleft) -= 2; - } - else if (x <= 0xffff && *outbytesleft >= 3) - { - *outp++ = (unsigned char) ((x >> 12) | 0xe0); - *outp++ = (unsigned char) (((x >> 6) & 0x3f) | 0x80); - *outp++ = (unsigned char) ((x & 0x3f) | 0x80); - (*outbytesleft) -= 3; - } - else if (x <= 0x1fffff && *outbytesleft >= 4) - { - *outp++ = (unsigned char) ((x >> 18) | 0xf0); - *outp++ = (unsigned char) (((x >> 12) & 0x3f) | 0x80); - *outp++ = (unsigned char) (((x >> 6) & 0x3f) | 0x80); - *outp++ = (unsigned char) ((x & 0x3f) | 0x80); - (*outbytesleft) -= 4; - } - else if (x <= 0x3ffffff && *outbytesleft >= 5) - { - *outp++ = (unsigned char) ((x >> 24) | 0xf8); - *outp++ = (unsigned char) (((x >> 18) & 0x3f) | 0x80); - *outp++ = (unsigned char) (((x >> 12) & 0x3f) | 0x80); - *outp++ = (unsigned char) (((x >> 6) & 0x3f) | 0x80); - *outp++ = (unsigned char) ((x & 0x3f) | 0x80); - (*outbytesleft) -= 5; - } - else if (*outbytesleft >= 6) - { - *outp++ = (unsigned char) ((x >> 30) | 0xfc); - *outp++ = (unsigned char) (((x >> 24) & 0x3f) | 0x80); - *outp++ = (unsigned char) (((x >> 18) & 0x3f) | 0x80); - *outp++ = (unsigned char) (((x >> 12) & 0x3f) | 0x80); - *outp++ = (unsigned char) (((x >> 6) & 0x3f) | 0x80); - *outp++ = (unsigned char) ((x & 0x3f) | 0x80); - (*outbytesleft) -= 6; - } - else - { - cd->my_errno = YAZ_ICONV_E2BIG; /* not room for output */ - return (size_t)(-1); - } - *outbuf = (char *) outp; - return 0; -} - -static size_t yaz_write_ISO8859_1 (yaz_iconv_t cd, unsigned long x, - char **outbuf, size_t *outbytesleft) -{ - unsigned char *outp = (unsigned char *) *outbuf; - if (x > 255 || x < 1) - { - cd->my_errno = YAZ_ICONV_EILSEQ; - return (size_t) -1; - } - else if (*outbytesleft >= 1) - { - *outp++ = (unsigned char) x; - (*outbytesleft)--; - } - else - { - cd->my_errno = YAZ_ICONV_E2BIG; - return (size_t)(-1); - } - *outbuf = (char *) outp; - return 0; -} - - -static size_t yaz_write_UCS4 (yaz_iconv_t cd, unsigned long x, - char **outbuf, size_t *outbytesleft) -{ - unsigned char *outp = (unsigned char *) *outbuf; - if (*outbytesleft >= 4) - { - *outp++ = (unsigned char) (x<<24); - *outp++ = (unsigned char) (x<<16); - *outp++ = (unsigned char) (x<<8); - *outp++ = (unsigned char) x; - (*outbytesleft) -= 4; - } - else - { - cd->my_errno = YAZ_ICONV_E2BIG; - return (size_t)(-1); - } - *outbuf = (char *) outp; - return 0; -} - -static size_t yaz_write_UCS4LE (yaz_iconv_t cd, unsigned long x, - char **outbuf, size_t *outbytesleft) -{ - unsigned char *outp = (unsigned char *) *outbuf; - if (*outbytesleft >= 4) - { - *outp++ = (unsigned char) x; - *outp++ = (unsigned char) (x<<8); - *outp++ = (unsigned char) (x<<16); - *outp++ = (unsigned char) (x<<24); - (*outbytesleft) -= 4; - } - else - { - cd->my_errno = YAZ_ICONV_E2BIG; - return (size_t)(-1); - } - *outbuf = (char *) outp; - return 0; -} - -#if HAVE_WCHAR_H -static size_t yaz_write_wchar_t (yaz_iconv_t cd, unsigned long x, - char **outbuf, size_t *outbytesleft) -{ - unsigned char *outp = (unsigned char *) *outbuf; - - if (*outbytesleft >= sizeof(wchar_t)) - { - wchar_t wch = x; - memcpy(outp, &wch, sizeof(wch)); - outp += sizeof(wch); - (*outbytesleft) -= sizeof(wch); - } - else - { - cd->my_errno = YAZ_ICONV_E2BIG; - return (size_t)(-1); - } - *outbuf = (char *) outp; - return 0; -} -#endif - -int yaz_iconv_isbuiltin(yaz_iconv_t cd) -{ - return cd->read_handle && cd->write_handle; -} - -yaz_iconv_t yaz_iconv_open (const char *tocode, const char *fromcode) -{ - yaz_iconv_t cd = (yaz_iconv_t) xmalloc (sizeof(*cd)); - - cd->write_handle = 0; - cd->read_handle = 0; - cd->init_handle = 0; - cd->my_errno = YAZ_ICONV_UNKNOWN; - - /* a useful hack: if fromcode has leading @, - the library not use YAZ's own conversions .. */ - if (fromcode[0] == '@') - fromcode++; - else - { - if (!yaz_matchstr(fromcode, "UTF8")) - { - cd->read_handle = yaz_read_UTF8; - cd->init_handle = yaz_init_UTF8; - } - else if (!yaz_matchstr(fromcode, "ISO88591")) - cd->read_handle = yaz_read_ISO8859_1; - else if (!yaz_matchstr(fromcode, "UCS4")) - cd->read_handle = yaz_read_UCS4; - else if (!yaz_matchstr(fromcode, "UCS4LE")) - cd->read_handle = yaz_read_UCS4LE; - else if (!yaz_matchstr(fromcode, "MARC8")) - cd->read_handle = yaz_read_marc8; -#if HAVE_WCHAR_H - else if (!yaz_matchstr(fromcode, "WCHAR_T")) - cd->read_handle = yaz_read_wchar_t; -#endif - - if (!yaz_matchstr(tocode, "UTF8")) - cd->write_handle = yaz_write_UTF8; - else if (!yaz_matchstr(tocode, "ISO88591")) - cd->write_handle = yaz_write_ISO8859_1; - else if (!yaz_matchstr (tocode, "UCS4")) - cd->write_handle = yaz_write_UCS4; - else if (!yaz_matchstr(tocode, "UCS4LE")) - cd->write_handle = yaz_write_UCS4LE; -#if HAVE_WCHAR_H - else if (!yaz_matchstr(tocode, "WCHAR_T")) - cd->write_handle = yaz_write_wchar_t; -#endif - } -#if HAVE_ICONV_H - cd->iconv_cd = 0; - if (!cd->read_handle || !cd->write_handle) - { - cd->iconv_cd = iconv_open (tocode, fromcode); - if (cd->iconv_cd == (iconv_t) (-1)) - { - xfree (cd); - return 0; - } - } -#else - if (!cd->read_handle || !cd->write_handle) - { - xfree (cd); - return 0; - } -#endif - cd->init_flag = 1; - return cd; -} - -size_t yaz_iconv (yaz_iconv_t cd, char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft) -{ - char *inbuf0; - size_t r = 0; -#if HAVE_ICONV_H - if (cd->iconv_cd) - { - size_t r = - iconv(cd->iconv_cd, inbuf, inbytesleft, outbuf, outbytesleft); - if (r == (size_t)(-1)) - { - switch (yaz_errno()) - { - case E2BIG: - cd->my_errno = YAZ_ICONV_E2BIG; - break; - case EINVAL: - cd->my_errno = YAZ_ICONV_EINVAL; - break; - case EILSEQ: - cd->my_errno = YAZ_ICONV_EILSEQ; - break; - default: - cd->my_errno = YAZ_ICONV_UNKNOWN; - } - } - return r; - } -#endif - if (inbuf == 0 || *inbuf == 0) - { - cd->init_flag = 1; - cd->my_errno = YAZ_ICONV_UNKNOWN; - return 0; - } - inbuf0 = *inbuf; - - if (cd->init_flag) - { - if (cd->init_handle) - { - size_t no_read; - size_t r = (cd->init_handle)(cd, (unsigned char *) *inbuf, - *inbytesleft, &no_read); - if (r) - { - if (cd->my_errno == YAZ_ICONV_EINVAL) - return r; - cd->init_flag = 0; - return r; - } - *inbytesleft -= no_read; - *inbuf += no_read; - } - cd->init_flag = 0; - } - while (1) - { - unsigned long x; - size_t no_read; - - if (*inbytesleft == 0) - { - r = *inbuf - inbuf0; - break; - } - - x = (cd->read_handle)(cd, (unsigned char *) *inbuf, *inbytesleft, - &no_read); - if (no_read == 0) - { - r = (size_t)(-1); - break; - } - r = (cd->write_handle)(cd, x, outbuf, outbytesleft); - if (r) - break; - *inbytesleft -= no_read; - (*inbuf) += no_read; - } - return r; -} - -int yaz_iconv_error (yaz_iconv_t cd) -{ - return cd->my_errno; -} - -int yaz_iconv_close (yaz_iconv_t cd) -{ -#if HAVE_ICONV_H - if (cd->iconv_cd) - iconv_close (cd->iconv_cd); -#endif - xfree (cd); - return 0; -} - - diff --git a/util/srwtst.c b/util/srwtst.c new file mode 100644 index 0000000..b10fb5b --- /dev/null +++ b/util/srwtst.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2002-2003, Index Data. + * See the file LICENSE for details. + * + * $Id: srwtst.c,v 1.1 2003-10-27 12:21:40 adam Exp $ + */ + +#include + +#if HAVE_XML2 +Z_SOAP_Handler h[2] = { + {"http://www.loc.gov/zing/srw/v1.0/", 0, (Z_SOAP_fun) yaz_srw_codec}, + {0, 0, 0} +}; + +int main(int argc, char **argv) +{ + char buf[163840]; + char *content_buf = buf; + int content_len; + int ret; + size_t no; + Z_SOAP *soap_package = 0; + ODR decode, encode; + int debug = 0; + + nmem_init(); + if (argc == 2 && !strcmp(argv[1], "debug")) + debug = 1; + no = fread(buf, 1, sizeof(buf), stdin); + if (no < 1 || no == sizeof(buf)) + { + fprintf(stderr, "Bad file or too big\n"); + exit (1); + } + decode = odr_createmem(ODR_DECODE); + encode = odr_createmem(ODR_ENCODE); + content_len = no; + ret = z_soap_codec(decode, &soap_package, + &content_buf, &content_len, h); + if (!soap_package) + { + fprintf(stderr, "Decoding seriously failed\n"); + exit(1); + } + if (debug) + { + fprintf(stderr, "got NS = %s\n", soap_package->ns); + if (soap_package->which == Z_SOAP_generic && + soap_package->u.generic->no == 0) + { + Z_SRW_PDU *sr = soap_package->u.generic->p; + if (sr->which == Z_SRW_searchRetrieve_request) + { + Z_SRW_searchRetrieveRequest *req = sr->u.request; + switch(req->query_type) + { + case Z_SRW_query_type_cql: + fprintf(stderr, "CQL: %s\n", req->query.cql); + break; + case Z_SRW_query_type_xcql: + fprintf(stderr, "XCQL\n"); + break; + case Z_SRW_query_type_pqf: + fprintf(stderr, "PQF: %s\n", req->query.pqf); + break; + } + } + else if (sr->which == Z_SRW_searchRetrieve_response) + { + Z_SRW_searchRetrieveResponse *res = sr->u.response; + if (res->records && res->num_records) + { + int i; + for (i = 0; inum_records; i++) + { + fprintf (stderr, "%d\n", i); + if (res->records[i].recordData_buf) + fwrite(res->records[i].recordData_buf, 1, + res->records[i].recordData_len, stderr); + } + } + } + + } + } + ret = z_soap_codec(encode, &soap_package, + &content_buf, &content_len, h); + if (content_buf && content_len) + fwrite (content_buf, content_len, 1, stdout); + else + { + fprintf(stderr, "No output!\n"); + exit(1); + } + odr_destroy(decode); + odr_destroy(encode); + nmem_exit(); + exit(0); +} +#else +int main(int argc, char **argv) +{ + fprintf(stderr, "SOAP disabled\n"); + exit(1); +} +#endif diff --git a/util/tpath.c b/util/tpath.c deleted file mode 100644 index f04df3e..0000000 --- a/util/tpath.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: tpath.c,v 1.9 2003-01-06 08:20:28 adam Exp $ - */ -#if HAVE_CONFIG_H -#include -#endif - - -#include -#include -#include -#include -#include - -FILE *yaz_path_fopen(const char *path, const char *name, const char *mode) -{ - return yaz_fopen (path, name, mode, 0); -} - -int yaz_fclose (FILE *f) -{ - return fclose (f); -} - -FILE *yaz_fopen(const char *path, const char *name, const char *mode, - const char *base) -{ - char spath[1024]; - - for(;;) - { - FILE *f; - - const char *path_sep = 0; - size_t len = 0; - size_t slen = 0; - - *spath = '\0'; - if (path) - { - /* somewhat dirty since we have to consider Windows - * drive letters.. - */ - if (strchr ("/\\.", *path)) - { - path_sep = strchr (path+1, ':'); - } - else if (path[0] && path[1]) - path_sep = strchr (path+2, ':'); - if (path_sep) - len = path_sep - path; - else - len = strlen(path); - if (!strchr ("/\\", *path) && base) - { - strcpy (spath, base); - slen = strlen(spath); - spath[slen++] = '/'; - } - memcpy (spath+slen, path, len); - slen += len; - if (!strchr("/\\", spath[slen-1])) - spath[slen++] = '/'; - } - strcpy (spath+slen, name); - if ((f = fopen(spath, mode))) - return f; - - if (!path_sep) - break; - path = path_sep+1; - } - return 0; -} - -int yaz_is_abspath (const char *p) -{ - if (*p == '/') - return 1; -#ifdef WIN32 - if (*p == '\\') - return 1; - if (*p && p[1] == ':' && isalpha(*p)) - return 1; -#endif - return 0; -} diff --git a/util/tsticonv.c b/util/tsticonv.c deleted file mode 100644 index b98d640..0000000 --- a/util/tsticonv.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2002-2003, Index Data - * See the file LICENSE for details. - * - * $Id: tsticonv.c,v 1.5 2003-06-22 11:48:33 adam Exp $ - */ - -#if HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - -#include - -/* some test strings in ISO-8859-1 format */ -const char *buf[] = { - "ax" , - "\330", - "eneb\346r", - "\xfc", - "\xfb", - "\xfbr", - 0 }; - -/* some test strings in MARC-8 format */ -const char *marc8_strings[] = { - "ax", - "\xa2", /* latin capital letter o with stroke */ - "eneb\xb5r", /* latin small letter ae */ - "\xe8\x75", /* latin small letter u with umlaut */ - "\xe3\x75", /* latin small letter u with circumflex */ - "\xe3\x75r", /* latin small letter u with circumflex */ - 0 -}; - -static void marc8_tst() -{ - int i; - yaz_iconv_t cd; - - cd = yaz_iconv_open("ISO-8859-1", "MARC8"); - for (i = 0; buf[i]; i++) - { - size_t r; - char *inbuf= (char*) marc8_strings[i]; - size_t inbytesleft = strlen(inbuf); - char outbuf0[24]; - char *outbuf = outbuf0; - size_t outbytesleft = sizeof(outbuf0); - - r = yaz_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); - if (r == (size_t) (-1)) - { - int e = yaz_iconv_error(cd); - - printf ("tsticonv 6 i=%d e=%d\n", i, e); - exit(6); - } - if ((outbuf - outbuf0) != strlen(buf[i]) - || memcmp(outbuf0, buf[i], strlen(buf[i]))) - { - printf ("tsticonv 7 i=%d\n", i); - printf ("buf=%s out=%s\n", buf[i], outbuf0); - exit(7); - } - } - yaz_iconv_close(cd); -} - -static void dconvert(int mandatory, const char *tmpcode) -{ - int i; - yaz_iconv_t cd; - for (i = 0; buf[i]; i++) - { - size_t r; - char *inbuf = (char*) buf[i]; - size_t inbytesleft = strlen(inbuf); - char outbuf0[24]; - char outbuf1[10]; - char *outbuf = outbuf0; - size_t outbytesleft = sizeof(outbuf0); - - cd = yaz_iconv_open(tmpcode, "ISO-8859-1"); - if (!cd) - { - if (!mandatory) - return; - printf ("tsticonv 1\n"); - exit(1); - } - r = yaz_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); - if (r == (size_t)(-1)) - { - int e = yaz_iconv_error(cd); - - printf ("tsticonv 2 e=%d\n", e); - exit(2); - } - yaz_iconv_close(cd); - - cd = yaz_iconv_open("ISO-8859-1", tmpcode); - if (!cd) - { - if (!mandatory) - return; - printf ("tsticonv 3\n"); - exit(3); - } - inbuf = outbuf0; - inbytesleft = sizeof(outbuf0) - outbytesleft; - - outbuf = outbuf1; - outbytesleft = sizeof(outbuf1); - r = yaz_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); - if (r == (size_t)(-1)) { - int e = yaz_iconv_error(cd); - - printf ("tsticonv 4 e=%d\n", e); - exit(4); - } - if (strlen(buf[i]) == (sizeof(outbuf1) - outbytesleft) && - memcmp(outbuf1, buf[i], strlen(buf[i]))) - { - printf ("tsticonv 5\n"); - exit(5); - } - yaz_iconv_close(cd); - } -} - -int main (int argc, char **argv) -{ - dconvert(1, "UTF-8"); - dconvert(1, "ISO-8859-1"); - dconvert(1, "UCS4"); - dconvert(0, "CP865"); - marc8_tst(); - exit (0); -} diff --git a/util/tstmatchstr.c b/util/tstmatchstr.c deleted file mode 100644 index 4539ceb..0000000 --- a/util/tstmatchstr.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2002-2003, Index Data - * See the file LICENSE for details. - * - * $Id: tstmatchstr.c,v 1.2 2003-06-22 11:47:18 adam Exp $ - */ - -#include - -#include - -struct { - char *s1; - char *s2; - int res; -} comp_strings[] = { - { "x", "x", 0 }, - { "x", "X", 0 }, - { "a", "b", 1 }, - { "b", "a", 1 }, - { "aa","a", 1 }, - { "a-", "a", 1 }, - { "A-b", "ab", 0}, - { "A--b", "ab", 1}, - { "A--b", "a-b", 1}, - { "A--b", "a--b", 0}, - { "a123", "a?", 0}, - {"a123", "a1.3", 0}, - {"a123", "..?", 0}, - {"a123", "a1.", 1}, - {"a123", "a...", 0}, - {0, 0, 0} }; - -int main (int argc, char **argv) -{ - int i; - for (i = 0; comp_strings[i].s1; i++) - { - int got = yaz_matchstr(comp_strings[i].s1,comp_strings[i].s2); - if (got > 0) - got = 1; - else if (got < 0) - got = -1; - if (got != comp_strings[i].res) - { - printf ("tststr %d got=%d res=%d\n", i, - got, comp_strings[i].res); - exit(1); - } - } - exit(0); -} - diff --git a/util/tstnmem.c b/util/tstnmem.c deleted file mode 100644 index c8b0569..0000000 --- a/util/tstnmem.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002-2003, Index Data - * See the file LICENSE for details. - * - * $Id: tstnmem.c,v 1.1 2003-04-23 20:34:08 adam Exp $ - */ - -#if HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - -#include - -int main (int argc, char **argv) -{ - void *cp; - NMEM n; - int j; - - nmem_init(); - n = nmem_create(); - if (!n) - exit (1); - for (j = 1; j<500; j++) - { - cp = nmem_malloc(n, j); - if (!cp) - exit(2); - } - - for (j = 2000; j<20000; j+= 2000) - { - cp = nmem_malloc(n, j); - if (!cp) - exit(3); - } - nmem_destroy(n); - nmem_exit(); - exit(0); -} diff --git a/util/tstwrbuf.c b/util/tstwrbuf.c deleted file mode 100644 index f141c6f..0000000 --- a/util/tstwrbuf.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2002-2003, Index Data - * See the file LICENSE for details. - * - * $Id: tstwrbuf.c,v 1.2 2003-06-23 10:22:21 adam Exp $ - */ - -#include - -#include - -int main (int argc, char **argv) -{ - int step; - WRBUF wr = wrbuf_alloc(); - - wrbuf_free(wr, 1); - - wr = wrbuf_alloc(); - - for (step = 1; step < 65; step++) - { - int i, j, k; - int len; - char buf[64]; - char *cp; - for (j = 1; j -#endif - -#include -#include - -unsigned long yaz_version(char *version_str, char *sys_str) -{ - if (version_str) - strcpy(version_str, YAZ_VERSION); - if (sys_str) - strcpy(sys_str, ""); - return YAZ_VERSIONL; -} diff --git a/util/wrbuf.c b/util/wrbuf.c deleted file mode 100644 index a649e64..0000000 --- a/util/wrbuf.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data. - * See the file LICENSE for details. - * - * $Id: wrbuf.c,v 1.13 2003-07-14 12:58:18 adam Exp $ - */ - -/* - * Growing buffer for writing various stuff. - */ - -#if HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include - -#include - -WRBUF wrbuf_alloc(void) -{ - WRBUF n; - - if (!(n = (WRBUF)xmalloc(sizeof(*n)))) - abort(); - n->buf = 0; - n->size = 0; - n->pos = 0; - return n; -} - -void wrbuf_free(WRBUF b, int free_buf) -{ - if (free_buf && b->buf) - xfree(b->buf); - xfree(b); -} - -void wrbuf_rewind(WRBUF b) -{ - b->pos = 0; -} - -int wrbuf_grow(WRBUF b, int minsize) -{ - int togrow; - - if (!b->size) - togrow = 1024; - else - togrow = b->size; - if (togrow < minsize) - togrow = minsize; - if (b->size && !(b->buf =(char *)xrealloc(b->buf, b->size += togrow))) - abort(); - else if (!b->size && !(b->buf = (char *)xmalloc(b->size = togrow))) - abort(); - return 0; -} - -int wrbuf_write(WRBUF b, const char *buf, int size) -{ - if (size <= 0) - return 0; - if (b->pos + size >= b->size) - wrbuf_grow(b, size); - memcpy(b->buf + b->pos, buf, size); - b->pos += size; - return 0; -} - -int wrbuf_puts(WRBUF b, const char *buf) -{ - wrbuf_write(b, buf, strlen(buf)+1); /* '\0'-terminate as well */ - (b->pos)--; /* don't include '\0' in count */ - return 0; -} - -int wrbuf_xmlputs(WRBUF b, const char *cp) -{ - while (*cp) - { - switch(*cp) - { - case '<': - wrbuf_puts(b, "<"); - break; - case '>': - wrbuf_puts(b, ">"); - break; - case '&': - wrbuf_puts(b, "&"); - break; - case '"': - wrbuf_puts(b, """); - break; - case '\'': - wrbuf_puts(b, "'"); - break; - default: - wrbuf_putc(b, *cp); - } - cp++; - } - wrbuf_putc(b, 0); - (b->pos)--; - return 0; -} - -void wrbuf_printf(WRBUF b, const char *fmt, ...) -{ - va_list ap; - char buf[4096]; - - va_start(ap, fmt); -#ifdef WIN32 - _vsnprintf(buf, sizeof(buf)-1, fmt, ap); -#else -/* !WIN32 */ -#if HAVE_VSNPRINTF - vsnprintf(buf, sizeof(buf)-1, fmt, ap); -#else - vsprintf(buf, fmt, ap); -#endif -#endif - wrbuf_puts (b, buf); - - va_end(ap); -} - diff --git a/util/xmalloc.c b/util/xmalloc.c deleted file mode 100644 index 5f9b519..0000000 --- a/util/xmalloc.c +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright (C) 1994-2003, Index Data - * All rights reserved. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: xmalloc.c,v 1.19 2003-05-16 13:14:26 adam Exp $ - */ - -#if HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - -#include -#include - -#ifndef TRACE_XMALLOC -#define TRACE_XMALLOC 1 -#endif - -#if TRACE_XMALLOC > 1 - -static const unsigned char head[] = {88, 77, 66, 55, 44, 33, 22, 11}; -static const unsigned char tail[] = {11, 22, 33, 44, 55, 66, 77, 88}; -static const unsigned char freed[] = {11, 22, 33, 44, 55, 66, 77, 88}; - -struct dmalloc_info { - int len; - char file[16]; - int line; - struct dmalloc_info *next; - struct dmalloc_info *prev; -}; - -struct dmalloc_info *dmalloc_list = 0; - -void *xmalloc_d(size_t nbytes, const char *file, int line) -{ - char *res; - struct dmalloc_info *dinfo; - - if (!(res = (char*) malloc(nbytes + sizeof(*dinfo)+16*sizeof(char)))) - return 0; - dinfo = (struct dmalloc_info *) res; - strncpy (dinfo->file, file, sizeof(dinfo->file)-1); - dinfo->file[sizeof(dinfo->file)-1] = '\0'; - dinfo->line = line; - dinfo->len = nbytes; - - dinfo->prev = 0; - dinfo->next = dmalloc_list; - if (dinfo->next) - dinfo->next->prev = dinfo; - dmalloc_list = dinfo; - - memcpy(res + sizeof(*dinfo), head, 8*sizeof(char)); - res += sizeof(*dinfo) + 8*sizeof(char); - memcpy(res + nbytes, tail, 8*sizeof(char)); - return res; -} - -void xfree_d(void *ptr, const char *file, int line) -{ - struct dmalloc_info *dinfo; - - if (!ptr) - return; - dinfo = (struct dmalloc_info *) - ((char*)ptr - 8*sizeof(char) - sizeof(*dinfo)); - if (memcmp(head, (char*) ptr - 8*sizeof(char), 8*sizeof(char))) - { - yaz_log(LOG_FATAL, "xfree_d bad head, %s:%d, %p", file, line, ptr); - abort(); - } - if (memcmp((char*) ptr + dinfo->len, tail, 8*sizeof(char))) - { - yaz_log(LOG_FATAL, "xfree_d bad tail, %s:%d, %p", file, line, ptr); - abort(); - } - if (dinfo->prev) - dinfo->prev->next = dinfo->next; - else - dmalloc_list = dinfo->next; - if (dinfo->next) - dinfo->next->prev = dinfo->prev; - memcpy ((char*) ptr - 8*sizeof(char), freed, 8*sizeof(char)); - free(dinfo); - return; -} - -void *xrealloc_d(void *p, size_t nbytes, const char *file, int line) -{ - struct dmalloc_info *dinfo; - char *ptr = (char*) p; - char *res; - - if (!ptr) - { - if (!nbytes) - return 0; - res = (char *) malloc(nbytes + sizeof(*dinfo) + 16*sizeof(char)); - } - else - { - if (memcmp(head, ptr - 8*sizeof(char), 8*sizeof(char))) - { - yaz_log(LOG_FATAL, "xrealloc_d bad head, %s:%d, %p", - file, line, ptr); - abort(); - } - dinfo = (struct dmalloc_info *) (ptr-8*sizeof(char) - sizeof(*dinfo)); - if (memcmp(ptr + dinfo->len, tail, 8*sizeof(char))) - { - yaz_log(LOG_FATAL, "xrealloc_d bad tail, %s:%d, %p", - file, line, ptr); - abort(); - } - if (dinfo->prev) - dinfo->prev->next = dinfo->next; - else - dmalloc_list = dinfo->next; - if (dinfo->next) - dinfo->next->prev = dinfo->prev; - - if (!nbytes) - { - free (dinfo); - return 0; - } - res = (char *) - realloc(dinfo, nbytes + sizeof(*dinfo) + 16*sizeof(char)); - } - if (!res) - return 0; - dinfo = (struct dmalloc_info *) res; - strncpy (dinfo->file, file, sizeof(dinfo->file)-1); - dinfo->file[sizeof(dinfo->file)-1] = '\0'; - dinfo->line = line; - dinfo->len = nbytes; - - dinfo->prev = 0; - dinfo->next = dmalloc_list; - if (dmalloc_list) - dmalloc_list->prev = dinfo; - dmalloc_list = dinfo; - - memcpy(res + sizeof(*dinfo), head, 8*sizeof(char)); - res += sizeof(*dinfo) + 8*sizeof(char); - memcpy(res + nbytes, tail, 8*sizeof(char)); - return res; -} - -void *xcalloc_d(size_t nmemb, size_t size, const char *file, int line) -{ - char *res; - struct dmalloc_info *dinfo; - size_t nbytes = nmemb * size; - - if (!(res = (char*) calloc(1, nbytes+sizeof(*dinfo)+16*sizeof(char)))) - return 0; - dinfo = (struct dmalloc_info *) res; - strncpy (dinfo->file, file, sizeof(dinfo->file)-1); - dinfo->file[sizeof(dinfo->file)-1] = '\0'; - dinfo->line = line; - dinfo->len = nbytes; - - dinfo->prev = 0; - dinfo->next = dmalloc_list; - if (dinfo->next) - dinfo->next->prev = dinfo; - dmalloc_list = dinfo; - - memcpy(res + sizeof(*dinfo), head, 8*sizeof(char)); - res += sizeof(*dinfo) + 8*sizeof(char); - memcpy(res + nbytes, tail, 8*sizeof(char)); - return res; -} - -void xmalloc_trav_d(const char *file, int line) -{ - size_t size = 0; - struct dmalloc_info *dinfo = dmalloc_list; - - yaz_log (LOG_MALLOC, "malloc_trav %s:%d", file, line); - while (dinfo) - { - yaz_log (LOG_MALLOC, " %20s:%d p=%p size=%d", dinfo->file, dinfo->line, - ((char*) dinfo)+sizeof(*dinfo)+8*sizeof(char), dinfo->len); - size += dinfo->len; - dinfo = dinfo->next; - } - yaz_log (LOG_MALLOC, "total bytes %ld", (long) size); -} - -#else -/* TRACE_XMALLOC <= 1 */ -#define xrealloc_d(o, x, f, l) realloc(o, x) -#define xmalloc_d(x, f, l) malloc(x) -#define xcalloc_d(x,y, f, l) calloc(x,y) -#define xfree_d(x, f, l) free(x) -#define xmalloc_trav_d(f, l) -#endif - -void xmalloc_trav_f(const char *s, const char *file, int line) -{ - xmalloc_trav_d(file, line); -} - -void *xrealloc_f (void *o, size_t size, const char *file, int line) -{ - void *p = xrealloc_d (o, size, file, line); - -#if TRACE_XMALLOC - yaz_log (LOG_MALLOC, - "%s:%d: xrealloc(s=%d) %p -> %p", file, line, size, o, p); -#endif - if (!p) - { - yaz_log (LOG_FATAL|LOG_ERRNO, "Out of memory, realloc (%d bytes)", - size); - exit(1); - } - return p; -} - -void *xmalloc_f (size_t size, const char *file, int line) -{ - void *p = xmalloc_d (size, file, line); - -#if TRACE_XMALLOC - yaz_log (LOG_MALLOC, "%s:%d: xmalloc(s=%d) %p", file, line, size, p); -#endif - if (!p) - { - yaz_log (LOG_FATAL, "Out of memory - malloc (%d bytes)", size); - exit (1); - } - return p; -} - -void *xcalloc_f (size_t nmemb, size_t size, const char *file, int line) -{ - void *p = xcalloc_d (nmemb, size, file, line); -#if TRACE_XMALLOC - yaz_log (LOG_MALLOC, "%s:%d: xcalloc(s=%d) %p", file, line, size, p); -#endif - if (!p) - { - yaz_log (LOG_FATAL, "Out of memory - calloc (%d, %d)", nmemb, size); - exit (1); - } - return p; -} - -char *xstrdup_f (const char *s, const char *file, int line) -{ - char *p = (char *)xmalloc_d (strlen(s)+1, file, line); -#if TRACE_XMALLOC - yaz_log (LOG_MALLOC, "%s:%d: xstrdup(s=%d) %p", file, line, strlen(s)+1, p); -#endif - strcpy (p, s); - return p; -} - -void xfree_f(void *p, const char *file, int line) -{ - if (!p) - return ; -#if TRACE_XMALLOC - if (p) - yaz_log (LOG_MALLOC, "%s:%d: xfree %p", file, line, p); -#endif - xfree_d(p, file, line); -} diff --git a/yaz-config.in b/yaz-config.in index 0f7c7e4..a3a5776 100644 --- a/yaz-config.in +++ b/yaz-config.in @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: yaz-config.in,v 1.17 2003-02-18 10:37:08 adam Exp $ +# $Id: yaz-config.in,v 1.18 2003-10-27 12:21:21 adam Exp $ yazprefix=@prefix@ yaz_echo_cflags=no yaz_echo_libs=no @@ -100,16 +100,16 @@ fi if test "$yaz_echo_source" = "yes"; then YAZBIN=${yaz_build_root}/bin - YAZLIB="-L${yaz_build_root}/lib/.libs $lyaz $yazextralibs" - YAZLALIB="${yaz_build_root}/lib/libyaz.la $yazextralibs" + YAZLIB="-L${yaz_build_root}/src/.libs $lyaz $yazextralibs" + YAZLALIB="${yaz_build_root}/src/libyaz.la $yazextralibs" if test "$lib_ssl" = "yes" -a -n "$SSL_LIBS@"; then - YAZLALIB="${yaz_build_root}/lib/libyazssl.la" + YAZLALIB="${yaz_build_root}/src/libyazssl.la" fi if test "$lib_thread" = "yes" -a -n "@CFLAGSTHREADS@"; then - YAZLALIB="${yaz_build_root}/lib/libyazthread.la $YAZLALIB" + YAZLALIB="${yaz_build_root}/src/libyazthread.la $YAZLALIB" fi if test "$lib_malloc" = "yes"; then - YAZLALIB="${yaz_build_root}/lib/libyazmalloc.la $YAZLALIB" + YAZLALIB="${yaz_build_root}/src/libyazmalloc.la $YAZLALIB" fi YAZINC="-I${yaz_src_root}/include" YAZCOMP=${yaz_src_root}/util/yaz-comp diff --git a/z39.50/.cvsignore b/z39.50/.cvsignore deleted file mode 100644 index 70c3bae..0000000 --- a/z39.50/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -libz39.50.la -z-*.c -zes-*.c -*.lo diff --git a/z39.50/Makefile.am b/z39.50/Makefile.am deleted file mode 100644 index c98fc6b..0000000 --- a/z39.50/Makefile.am +++ /dev/null @@ -1,84 +0,0 @@ -## $Id: Makefile.am,v 1.14 2003-07-18 19:53:28 mike Exp $ - -AM_CPPFLAGS=-I$(top_srcdir)/include - -noinst_LTLIBRARIES = libz39.50.la - -tabdatadir = $(pkgdatadir)/z39.50 -tabdata_DATA=datetime.asn esupdate.asn univres.asn z3950v3.asn z.tcl \ - esadmin.asn charneg-3.asn mterm2.asn oclcui.asn -EXTRA_DIST=$(tabdata_DATA) - -YAZCOMP = $(top_srcdir)/util/yaz-asncomp -YAZCOMPLINE = ../util/yaz-asncomp -d z.tcl -i yaz -I../include $(YCFLAGS) - -libz39_50_la_SOURCES = z-accdes1.c z-accform1.c z-acckrb1.c z-core.c \ - z-diag1.c z-espec1.c z-estask.c z-exp.c z-grs.c z-mterm2.c z-opac.c \ - z-uifr1.c z-rrf1.c z-rrf2.c z-sum.c z-sutrs.c z-oclcui.c\ - zes-expi.c zes-exps.c zes-order.c zes-pquery.c zes-psched.c \ - zes-pset.c zes-update0.c z-date.c z-univ.c zes-update.c zes-admin.c \ - z-charneg.c \ - prt-ext.c - -# Rules for Z39.50 V3 -$(srcdir)/z-accdes1.c \ -$(srcdir)/z-accform1.c \ -$(srcdir)/z-acckrb1.c \ -$(srcdir)/z-core.c \ -$(srcdir)/z-diag1.c \ -$(srcdir)/z-espec1.c \ -$(srcdir)/z-estask.c \ -$(srcdir)/z-exp.c \ -$(srcdir)/z-grs.c \ -$(srcdir)/z-opac.c \ -$(srcdir)/z-uifr1.c \ -$(srcdir)/z-rrf1.c \ -$(srcdir)/z-rrf2.c \ -$(srcdir)/z-sum.c \ -$(srcdir)/z-sutrs.c \ -$(srcdir)/zes-expi.c \ -$(srcdir)/zes-exps.c \ -$(srcdir)/zes-order.c \ -$(srcdir)/zes-pquery.c \ -$(srcdir)/zes-psched.c \ -$(srcdir)/zes-pset.c \ -$(srcdir)/zes-update0.c \ -$(top_srcdir)/include/z-accdes1.h \ -$(top_srcdir)/include/z-core.h: \ -$(srcdir)/z.tcl $(srcdir)/z3950v3.asn $(YAZCOMP) - cd $(srcdir); $(YAZCOMPLINE) z3950v3.asn - -# Date extension -$(srcdir)/z-date.c \ -$(top_srcdir)/include/yaz/z-date.h: $(srcdir)/z.tcl $(srcdir)/datetime.asn $(YAZCOMP) - cd $(srcdir); $(YAZCOMPLINE) datetime.asn - -# UNIverse extension -$(srcdir)/z-univ.c \ -$(top_srcdir)/include/yaz/z-univ.h: \ -$(srcdir)/z.tcl $(srcdir)/univres.asn $(YAZCOMP) - cd $(srcdir); $(YAZCOMPLINE) univres.asn - -# New Update extended service -$(srcdir)/zes-update.c \ -$(top_srcdir)/include/yaz/zes-update.h: \ -$(srcdir)/z.tcl $(srcdir)/esupdate.asn $(YAZCOMP) - cd $(srcdir); $(YAZCOMPLINE) esupdate.asn - -# Admin extended service -$(srcdir)/zes-admin.c \ -$(top_srcdir)/include/yaz/zes-admin.h: \ -$(srcdir)/z.tcl $(srcdir)/esadmin.asn $(YAZCOMP) - cd $(srcdir); $(YAZCOMPLINE) esadmin.asn - -# Charset negotiation -$(srcdir)/z-charneg.c: $(srcdir)/z.tcl $(srcdir)/charneg-3.asn - cd $(srcdir); $(YAZCOMPLINE) $(YCFLAGS) charneg-3.asn - -# UserInfoFormat-multipleSearchTerms-2 -$(srcdir)/z-mterm2.c: $(srcdir)/z.tcl $(srcdir)/mterm2.asn - cd $(srcdir); $(YAZCOMPLINE) mterm2.asn - -# UserInfoFormat-multipleSearchTerms-2 -$(srcdir)/z-oclcui.c: $(srcdir)/z.tcl $(srcdir)/oclcui.asn - cd $(srcdir); $(YAZCOMPLINE) oclcui.asn diff --git a/z39.50/charneg-3.asn b/z39.50/charneg-3.asn deleted file mode 100644 index d178e3a..0000000 --- a/z39.50/charneg-3.asn +++ /dev/null @@ -1,212 +0,0 @@ -NegotiationRecordDefinition-charSetandLanguageNegotiation-3 -{Z39-50-negotiationRecordDefinition CharSetandLanguageNegotiation-3 (3)} -DEFINITIONS ::= BEGIN -IMPORTS LanguageCode FROM RecordSyntax-explain; - -CharSetandLanguageNegotiation ::= CHOICE{ - proposal [1] IMPLICIT OriginProposal, - response [2] IMPLICIT TargetResponse} --- --- For character sets: --- Origin proposes one, two, or all three of the following, in order of --- preference: --- (a) 2022 character sets. --- (b) 10646 character set. --- (c) Private character set. --- --- The target responds with one of (a), (b), or (c), indicating the --- character set(s) to be supported for all name and message strings. --- --- If the origin includes (a), --- the origin proposes: --- (1) A proposed environment: 7-bit, 8-bit, or no-preference. --- (2) A set of iso 2022 registration numbers. --- (3) One or more proposed initial sets of registration numbers, --- for c0, c1, g0, g1, g2 and g3. These must come from (2). --- (4) The proposed encoding level. --- And if the target selects (a), it responds with: --- (1) A selected environment: 7-bit or 8-bit. --- (2) A subset of the set of iso 2022 registration numbers proposed --- by the origin. --- (3) The initial set of registrations, which must come from (2) --- but need not be from the set of initial registrations proposed --- by the origin. --- (4) The encoding level; less than or equal to that proposed. --- --- If the origin includes (b), --- The origin proposes: --- (1) (optionally) A list of collections (i.e. subsets of characters from the --- complete 10646 definition). --- (2) An implementation level. --- (3) Syntax/form: e.g. ucs-2, ucs-4, utf-8, utf-16. --- And if the target selects (b), it responds by choosing a subset of the --- collections proposed by the origin in (1) and an implementation level less --- than or equal to that proposed by the origin in (2). --- --- If the origin includes (c), the origin proposes one of the following: --- (1) A list of private character sets, by one or more object --- identifiers. --- (2) A list of private character sets, by an EXTERNAL. --- (3) An indication to use a private, previously agreed upon --- character set. --- And if the target selects (c): --- - If the origin proposed (1), the target should respond with (1), and --- the list of object identifiers should be a subset of the list that --- the origin included. --- - If the origin proposed (2), the target should respond with (2), using --- the same EXTERNAL definition (but not necessarily the same content) --- used by the origin. --- - If the origin proposed (3), the target should respond with (3). --- --- For Languages: --- The origin optionally proposes one or more language codes. The target --- response may include a single language code, which indicates the --- language to be used for all message strings. The target may include or --- omit this, whether or not the origin included a proposed set, and the --- language code indicated need not be from among those proposed. --- --- - -OriginProposal ::= SEQUENCE { - proposedCharSets [1] IMPLICIT SEQUENCE OF CHOICE{ - -- Each should occur at most once, and in order of preference - -- (the "order of preference" is the reason why this is - -- "SEQUENCE OF CHOICE" rather than just "SEQUENCE") - iso2022 [1] Iso2022, - iso10646 [2] IMPLICIT Iso10646, - private [3] PrivateCharacterSet} OPTIONAL, - -- proposedCharSets must be omitted - -- if origin proposes version 2 - proposedlanguages [2] IMPLICIT SEQUENCE OF LanguageCode OPTIONAL, - recordsInSelectedCharSets [3] IMPLICIT BOOLEAN OPTIONAL - -- default 'false'. See rule 6 above. - } - -TargetResponse ::= SEQUENCE{ - selectedCharSets [1] CHOICE{ - iso2022 [1] Iso2022, - iso10646 [2] IMPLICIT Iso10646, - private [3] PrivateCharacterSet, - none [4] IMPLICIT NULL - -- If selected, no negotiation - -- is assumed to be in force - -- for character sets. - } OPTIONAL, - -- Omitted if and only if proposedCharSets - -- was Omitted in the request. - selectedLanguage [2] IMPLICIT LanguageCode OPTIONAL, - recordsInSelectedCharSets [3] IMPLICIT BOOLEAN OPTIONAL - -- Omitted if and only if 'recordsInSelectedCharSets' was omitted - -- in the request. See rule 6 above. - } - - -PrivateCharacterSet ::= CHOICE{ - viaOid [1] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, - externallySpecified [2] IMPLICIT EXTERNAL, - previouslyAgreedUpon [3] IMPLICIT NULL} - --- IMPORTED --- LanguageCode ::= GeneralString -- from ANSI Z39.53-1994 - --- Definition of ISO2022 --- For ISO 2022, the following is negotiated: --- 1) The environment: 7-bit or 8-bit; --- 2) a set of registration numbers (from the ISO Register of coded --- character sets) for graphical and control character sets; --- 3) g0, g1, g2, g3, c0, c1, the registration numbers of the graphical and --- control character sets that are initially designated to g0, g1, etc. --- The origin submits one or more sequences of values for --- g0, g1, g2, g3, c0, c1 (for each sequence: at least one of --- g0 and g1 must be included; g2 and g3 are optional and --- may be included only if g1 is included; --- c0 should be included; and c1 is optional); the target --- selects one of the proposed sequences. --- 4) gleft: which of g0, g1, g2 or g3, initially has GL shift status in --- an 8-bit environment or has shift status in a 7-bit environment; and --- 5) gright: which of g1, g2 or g3 initially has GR shift status in an --- 8-bit environment. - -Iso2022 ::= CHOICE{ - originProposal [1] IMPLICIT SEQUENCE{ - proposedEnvironment [0] Environment OPTIONAL, - -- omitted means no preference - proposedSets [1] IMPLICIT SEQUENCE OF INTEGER, - proposedInitialSets [2] IMPLICIT SEQUENCE OF - InitialSet, - proposedLeftAndRight [3] IMPLICIT LeftAndRight}, - targetResponse [2] IMPLICIT SEQUENCE{ - selectedEnvironment [0] Environment, - selectedSets [1] IMPLICIT SEQUENCE OF INTEGER, - selectedinitialSet [2] IMPLICIT InitialSet, - selectedLeftAndRight [3] IMPLICIT LeftAndRight}} - -Environment ::= CHOICE{ - sevenBit [1] IMPLICIT NULL, - eightBit [2] IMPLICIT NULL} - -InitialSet::= SEQUENCE{ - g0 [0] IMPLICIT INTEGER OPTIONAL, - g1 [1] IMPLICIT INTEGER OPTIONAL, - -- one of g0 and g1 must be included - g2 [2] IMPLICIT INTEGER OPTIONAL, - g3 [3] IMPLICIT INTEGER OPTIONAL, - --g2 and/or g3 may be included - -- only if g1 was included - c0 [4] IMPLICIT INTEGER, - c1 [5] IMPLICIT INTEGER OPTIONAL} - -LeftAndRight ::= SEQUENCE{ - gLeft [3] IMPLICIT INTEGER{ - g0 (0), - g1 (1), - g2 (2), - g3 (3)}, - gRight [4] IMPLICIT INTEGER{ - g1 (1), - g2 (2), - g3 (3)} OPTIONAL} - --- Definition of Iso10646 --- --- The 10646 object identifier looks like: --- 1.0.10646.1.implementationLevel.repertoireSubset.arc1.arc2. .... --- --- (The second '1' is for "part 1" of 10646.) --- --- ImplementationLevel is 1-3 --- --- repertoireSubset is 0 or 1, for 'all' or 'collections'. --- The arcs are present only if repertoireSubset is 'collections', --- in which case arc1, arc2, etc., are the --- identifiers of collections of character repertoires. --- --- There is a second 10646 oid, for specifying syntax/form: --- 1.0.10646.1.0.form --- --- (The second '0' represents "transfer syntax".) --- --- where values of form include: --- 2: ucs-2 --- 4: ucs-4 --- 5: utf-16 --- 8: utf-8 - -Iso10646 ::= SEQUENCE{ - collections [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL, - --oid of form 1.0.10646.1.implementationLevel - -- .repertoireSubset.arc1.arc2. .... - -- Target to choose a subset of the collections - -- proposed by the origin, and an implementation level - -- less than or equal to that proposed. - -- - -- when 'collections' is omitted, - -- 'implementationLevel' defaults to 3. - -- - encodingLevel [2] IMPLICIT OBJECT IDENTIFIER - -- oid of form 1.0.10646.1.0.form - -- where value of 'form' is 2, 4, 5, or 8 - -- for ucs-2, ucs-4, utf-16, utf-8 - } -END - diff --git a/z39.50/comp.sh b/z39.50/comp.sh deleted file mode 100755 index b8c36b6..0000000 --- a/z39.50/comp.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# $Id: comp.sh,v 1.2 1999-12-08 13:21:02 adam Exp $ -# simple script to make all compiled code. -../util/yc.tcl -d z.tcl -i yaz -I ../include z3950v3.asn -../util/yc.tcl -d z.tcl -i yaz -I ../include datetime.asn -../util/yc.tcl -d z.tcl -i yaz -I ../include univres.asn -../util/yc.tcl -d z.tcl -i yaz -I ../include esupdate.asn diff --git a/z39.50/datetime.asn b/z39.50/datetime.asn deleted file mode 100644 index cab9eb0..0000000 --- a/z39.50/datetime.asn +++ /dev/null @@ -1,81 +0,0 @@ -UserInfoFormat-dateTime -{Z39-50-userInfoFormat dateTime (6)} DEFINITIONS ::= -BEGIN -IMPORTS IntUnit FROM Z39-50-APDU-1995; - -DateTime ::= SEQUENCE{ - date [1] Z3950Date OPTIONAL, - time [2] Z3950Time OPTIONAL - -- one or the other, or both - } - -Z3950Date ::= SEQUENCE{ - year [1] IMPLICIT INTEGER, - -- For "positive" years, i.e. 1 AD or later, supply - -- the absolute year, e.g. If the year is 1995, supply - -- the integer 1995; the value 95 would indicate the - -- year 0095. - -- For "negative" years, e.g. 1 BC or earlier, -1 - -- represents 1 BC, -2 represents 2 BC, etc. Zero is - -- invalid, because there was no year zero. - partOfYear [2] CHOICE{ -- may be omitted if only year is significant - monthAndDay [1] IMPLICIT SEQUENCE{ - month [2] IMPLICIT INTEGER, - -- value 1-12 - day [3] IMPLICIT INTEGER OPTIONAL - -- may be omitted if only year and month - -- are significant. Value 1-31. - }, - julianDay [2] IMPLICIT INTEGER, -- Value 1 - 366. - weekNumber [3] IMPLICIT INTEGER, -- Value 1 - 53. - quarter [4] CHOICE{ - first [1] IMPLICIT NULL, - second [2] IMPLICIT NULL, - third [3] IMPLICIT NULL, - fourth [4] IMPLICIT NULL}, - season [5] CHOICE{ - winter [1] IMPLICIT NULL, - spring [2] IMPLICIT NULL, - summer [3] IMPLICIT NULL, - autumn [4] IMPLICIT NULL} - } OPTIONAL, - flags [3] IMPLICIT SEQUENCE{ - circa [1] IMPLICIT NULL OPTIONAL, - -- if this flag is set then the date is "approximate". - era [2] CHOICE{ - -- If era occurs, partOfYear should not occur. - decade [1] IMPLICIT NULL, - -- year must be multiple of 10. - -- For example, 1900 refers to - -- the decade covering the years - -- 1900 through 1909. - century [2] IMPLICIT NULL, - -- year must be multiple of 100. - millennium [3] IMPLICIT NULL - -- year must be multiple of 1000. - } OPTIONAL - } OPTIONAL - } - - -Z3950Time ::= SEQUENCE{ - hour [1] IMPLICIT INTEGER, - -- Value 0-23. - minute [2] IMPLICIT INTEGER OPTIONAL, - -- value 0-59. May be omitted when hour only is - -- significant (in which case second and - -- partOfSecond must also be omitted). - second [3] IMPLICIT INTEGER OPTIONAL, - -- value 0-59. May be omitted when only hour, or - -- hour and minute, is significant (in which case - -- partOfSecond must also be omitted). - partOfSecond [4] IMPLICIT IntUnit OPTIONAL, - -- Use Unit System = 'si', Unit type = 'time'; - -- Unit = 'second', with appropriate value and - -- scale factor. - zone [5] CHOICE{ - local [1] IMPLICIT NULL, - utc [2] IMPLICIT NULL, - utcOffset [3] IMPLICIT INTEGER -- in minutes - }} -END diff --git a/z39.50/esadmin.asn b/z39.50/esadmin.asn deleted file mode 100644 index 9ec766b..0000000 --- a/z39.50/esadmin.asn +++ /dev/null @@ -1,49 +0,0 @@ -ESFormat-Admin -{Z39-50-extendedService Index-Data(81) AdminES (1)} DEFINITIONS ::= - -- oid is 1.2.840.10003.9.81.1 -BEGIN -IMPORTS DiagRec, InternationalString, Segment -FROM Z39-50-APDU-1995; -Admin ::= CHOICE{ - esRequest [1] IMPLICIT SEQUENCE{ - toKeep [1] OriginPartToKeep, - notToKeep [2] OriginPartNotToKeep}, - taskPackage [2] IMPLICIT SEQUENCE{ - originPart [1] - OriginPartToKeep, - targetPart [2] TargetPart}} - -OriginPartToKeep ::= SEQUENCE{ -action [1] CHOICE{ - reIndex [1] NULL, - truncate [2] NULL, - drop [3] NULL, - create [4] NULL, - import [5] ImportParameters, - refresh [6] NULL, -- Review internal representation of records against source files on disk to - -- see if they have been updated. - commit [7] NULL, - shutdown [8] NULL, - start [9] NULL}, -databaseName [2] IMPLICIT InternationalString OPTIONAL} - -OriginPartNotToKeep ::= CHOICE{ -records [1] Segment, -recordsWillFollow [0] NULL} - -TargetPart ::= SEQUENCE{ - updateStatus [1] IMPLICIT INTEGER{ - success (1), - partial (2), - failure (3)}, - globalDiagnostics [2] IMPLICIT SEQUENCE OF - DiagRec OPTIONAL - } - --- Auxiliary definitions for Admin - -ImportParameters ::= SEQUENCE{ - recordType [1] IMPLICIT InternationalString -} - -END diff --git a/z39.50/esupdate.asn b/z39.50/esupdate.asn deleted file mode 100644 index e6628a1..0000000 --- a/z39.50/esupdate.asn +++ /dev/null @@ -1,103 +0,0 @@ -ESFormat-Update -{Z39-50-extendedService Update (5) revisions (1) revision-1 (1)} DEFINITIONS ::= - -- oid is 1.2.840.10003.9.5.1.1 -BEGIN -IMPORTS DiagRec, InternationalString -FROM Z39-50-APDU-1995; -Update ::= CHOICE{ - esRequest [1] IMPLICIT SEQUENCE{ - toKeep [1] OriginPartToKeep, - notToKeep [2] OriginPartNotToKeep}, - taskPackage [2] IMPLICIT SEQUENCE{ - originPart [1] - OriginPartToKeep, - targetPart [2] TargetPart}} - -OriginPartToKeep ::= SEQUENCE{ -action [1] IMPLICIT INTEGER{ - recordInsert (1), - recordReplace (2), - recordDelete (3), - elementUpdate (4), - specialUpdate (5)}, - databaseName [2] IMPLICIT InternationalString, - schema [3] IMPLICIT OBJECT IDENTIFIER OPTIONAL, - elementSetName [4] IMPLICIT InternationalString OPTIONAL, - actionQualifier [5] IMPLICIT EXTERNAL OPTIONAL} - -OriginPartNotToKeep ::= SuppliedRecords - -TargetPart ::= SEQUENCE{ - updateStatus [1] IMPLICIT INTEGER{ - success (1), - partial (2), - failure (3)}, - globalDiagnostics [2] IMPLICIT SEQUENCE OF - DiagRec OPTIONAL, - -- These are non-surrogate - -- diagnosticsrelating to the task, - -- not to individual records. - taskPackageRecords [3] IMPLICIT SEQUENCE OF -TaskPackageRecordStructure - -- There should be a - -- TaskPackageRecordStructure - -- for every record supplied. - -- The target should create - -- such a structure for every - -- record immediately upon - -- creating the task package - -- to include correlation - -- information and status. - -- The record itself would not - -- be included until processing - -- for that record is complete. - } - --- Auxiliary definitions for Update -SuppliedRecords ::= SEQUENCE OF SEQUENCE{ - recordId [1] CHOICE{ - number [1] IMPLICIT INTEGER, - string [2] IMPLICIT InternationalString, - opaque [3] IMPLICIT OCTET STRING} OPTIONAL, - supplementalId [2] CHOICE{ - timeStamp [1] IMPLICIT GeneralizedTime, - versionNumber [2] IMPLICIT InternationalString, - previousVersion [3] IMPLICIT EXTERNAL} OPTIONAL, - correlationInfo [3] IMPLICIT CorrelationInfo OPTIONAL, - record [4] IMPLICIT EXTERNAL} - -CorrelationInfo ::= SEQUENCE{ - -- origin may supply one or both for any record: - note [1] IMPLICIT InternationalString OPTIONAL, - id [2] IMPLICIT INTEGER OPTIONAL} - -TaskPackageRecordStructure ::= SEQUENCE{ - recordOrSurDiag [1] CHOICE { - record [1] IMPLICIT EXTERNAL, - -- Choose 'record' if - -- recordStatus is 'success', and - -- elementSetName was supplied. - - surrogateDiagnostics [2] IMPLICIT - SEQUENCE OF DiagRec - -- Choose 'SurrogateDiagnostics', if - -- RecordStatus is failure. - } OPTIONAL, - -- The parameter recordOrSurDiag - -- will thus be omitted only if - -- 'elementSetName' was omitted and - -- recordStatus is 'success'; or - --if record status is 'queued' - -- or in 'process'. - correlationInfo [2] IMPLICIT - CorrelationInfo OPTIONAL, - -- This should be included - -- if it was supplied by the origin. - recordStatus [3] IMPLICIT INTEGER{ - success (1), - queued (2), - inProcess (3), - failure (4)}, - supplementalDiagnostics [4] IMPLICIT - SEQUENCE OF DiagRec OPTIONAL} -END diff --git a/z39.50/mterm2.asn b/z39.50/mterm2.asn deleted file mode 100644 index eff29d7..0000000 --- a/z39.50/mterm2.asn +++ /dev/null @@ -1,10 +0,0 @@ -UserInfoFormat-multipleSearchTerms-2 -{Z39-50-userInfoFormat MultipleSearchTerms-2 (5)} DEFINITIONS ::= -BEGIN -IMPORTS Term FROM Z39-50-APDU-1995; - -MultipleSearchTerms-2 ::= SEQUENCE OF SEQUENCE{ - term [1] IMPLICIT Term, - flag [2] IMPLICIT BOOLEAN OPTIONAL} - -END diff --git a/z39.50/oclcui.asn b/z39.50/oclcui.asn deleted file mode 100644 index 0cd6d54..0000000 --- a/z39.50/oclcui.asn +++ /dev/null @@ -1,33 +0,0 @@ -UserInfoFormat-oclcUserInformation -{Z39-50-userInfoFormat OCLCUserInformation (7)} DEFINITIONS ::= -BEGIN - --- $Id: oclcui.asn,v 1.4 2003-09-04 17:44:49 adam Exp $ --- --- This format is returned from the server at --- fsz3950test.oclc.org:210 --- I found the definition at --- http://www.oclc.org/firstsearch/documentation/z3950/config_guide.htm --- --- I have added OPTIONAL modifiers to the `dblist' and and `code' --- elements because they appear to be admitted from the APDU returned --- as an Init diagnostic from fsz3950test.oclc.org:210. Adam further --- removed the SEQUENCE structure, changed failReason to a BOOLEAN and --- deleted diagnosticSetId altogether, to make the ASN.1 conform to --- what's actually returned on the wire. Finally, I removed the --- OPTIONAL on failReason on the advice of OCLC's Keith Neibarger --- (although he'd also advised me, wrongly, that I --- could remove the OPTIONAL on dblist). - -OCLC-UserInformation ::= SEQUENCE { - motd [1] IMPLICIT VisibleString OPTIONAL, - dblist SEQUENCE OF DBName OPTIONAL, - failReason [3] IMPLICIT BOOLEAN OPTIONAL, - code [1] IMPLICIT INTEGER OPTIONAL, - text [2] IMPLICIT VisibleString OPTIONAL -} - -DBName ::= [2] IMPLICIT VisibleString - -END - diff --git a/z39.50/prt-ext.c b/z39.50/prt-ext.c deleted file mode 100644 index 4884e58..0000000 --- a/z39.50/prt-ext.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data. - * See the file LICENSE for details. - * - * $Id: prt-ext.c,v 1.7 2003-07-18 19:53:28 mike Exp $ - */ - -#include - -/* - * The table below should be moved to the ODR structure itself and - * be an image of the association context: To help - * map indirect references when they show up. - */ -static Z_ext_typeent type_table[] = -{ - {VAL_SUTRS, Z_External_sutrs, (Odr_fun) z_SUTRS}, - {VAL_EXPLAIN, Z_External_explainRecord, (Odr_fun)z_ExplainRecord}, - {VAL_RESOURCE1, Z_External_resourceReport1, (Odr_fun)z_ResourceReport1}, - {VAL_RESOURCE2, Z_External_resourceReport2, (Odr_fun)z_ResourceReport2}, - {VAL_PROMPT1, Z_External_promptObject1, (Odr_fun)z_PromptObject1 }, - {VAL_GRS1, Z_External_grs1, (Odr_fun)z_GenericRecord}, - {VAL_EXTENDED, Z_External_extendedService, (Odr_fun)z_TaskPackage}, - {VAL_ITEMORDER, Z_External_itemOrder, (Odr_fun)z_IOItemOrder}, - {VAL_DIAG1, Z_External_diag1, (Odr_fun)z_DiagnosticFormat}, - {VAL_ESPEC1, Z_External_espec1, (Odr_fun)z_Espec1}, - {VAL_SUMMARY, Z_External_summary, (Odr_fun)z_BriefBib}, - {VAL_OPAC, Z_External_OPAC, (Odr_fun)z_OPACRecord}, - {VAL_SEARCHRES1, Z_External_searchResult1, (Odr_fun)z_SearchInfoReport}, - {VAL_DBUPDATE, Z_External_update, (Odr_fun)z_IUUpdate}, - {VAL_DBUPDATE0, Z_External_update0, (Odr_fun)z_IU0Update}, - {VAL_DBUPDATE1, Z_External_update0, (Odr_fun)z_IU0Update}, - {VAL_DATETIME, Z_External_dateTime, (Odr_fun)z_DateTime}, - {VAL_UNIVERSE_REPORT, Z_External_universeReport,(Odr_fun)z_UniverseReport}, - {VAL_ADMINSERVICE, Z_External_ESAdmin, (Odr_fun)z_Admin}, - {VAL_USERINFO1, Z_External_userInfo1, (Odr_fun) z_OtherInformation}, - {VAL_CHARNEG3, Z_External_charSetandLanguageNegotiation, (Odr_fun) - z_CharSetandLanguageNegotiation}, - {VAL_PROMPT1, Z_External_acfPrompt1, (Odr_fun) z_PromptObject1}, - {VAL_DES1, Z_External_acfDes1, (Odr_fun) z_DES_RN_Object}, - {VAL_KRB1, Z_External_acfKrb1, (Odr_fun) z_KRBObject}, - {VAL_MULTISRCH2, Z_External_multisrch2, (Odr_fun) z_MultipleSearchTerms_2}, - {VAL_CQL, Z_External_CQL, (Odr_fun) z_InternationalString}, - {VAL_OCLCUI, Z_External_OCLCUserInfo, (Odr_fun) z_OCLC_UserInformation}, - {VAL_NONE, 0, 0} -}; - -Z_ext_typeent *z_ext_getentbyref(oid_value val) -{ - Z_ext_typeent *i; - - for (i = type_table; i->dref != VAL_NONE; i++) - if (i->dref == val) - return i; - return 0; -} - -int z_External(ODR o, Z_External **p, int opt, const char *name) -{ - oident *oid; - Z_ext_typeent *type; - - static Odr_arm arm[] = - { - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_single, - (Odr_fun)odr_any, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_External_octet, - (Odr_fun)odr_octetstring, 0}, - {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_External_arbitrary, - (Odr_fun)odr_bitstring, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_sutrs, - (Odr_fun)z_SUTRS, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_explainRecord, - (Odr_fun)z_ExplainRecord, 0}, - - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_resourceReport1, - (Odr_fun)z_ResourceReport1, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_resourceReport2, - (Odr_fun)z_ResourceReport2, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_promptObject1, - (Odr_fun)z_PromptObject1, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_grs1, - (Odr_fun)z_GenericRecord, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_extendedService, - (Odr_fun)z_TaskPackage, 0}, - - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_itemOrder, - (Odr_fun)z_IOItemOrder, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_diag1, - (Odr_fun)z_DiagnosticFormat, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_espec1, - (Odr_fun)z_Espec1, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_summary, - (Odr_fun)z_BriefBib, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_OPAC, - (Odr_fun)z_OPACRecord, 0}, - - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_searchResult1, - (Odr_fun)z_SearchInfoReport, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_update, - (Odr_fun)z_IUUpdate, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_dateTime, - (Odr_fun)z_DateTime, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_universeReport, - (Odr_fun)z_UniverseReport, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_ESAdmin, - (Odr_fun)z_Admin, 0}, - - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_update0, - (Odr_fun)z_IU0Update, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_userInfo1, - (Odr_fun)z_OtherInformation, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_charSetandLanguageNegotiation, - (Odr_fun)z_CharSetandLanguageNegotiation, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_acfPrompt1, - (Odr_fun)z_PromptObject1, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_acfDes1, - (Odr_fun)z_DES_RN_Object, 0}, - - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_acfKrb1, - (Odr_fun)z_KRBObject, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_multisrch2, - (Odr_fun)z_MultipleSearchTerms_2, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_CQL, - (Odr_fun)z_InternationalString, 0}, - {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_OCLCUserInfo, - (Odr_fun)z_OCLC_UserInformation, 0}, - {-1, -1, -1, -1, 0, 0} - }; - - odr_implicit_settag(o, ODR_UNIVERSAL, ODR_EXTERNAL); - if (!odr_sequence_begin(o, p, sizeof(**p), name)) - return opt && odr_ok(o); - if (!(odr_oid(o, &(*p)->direct_reference, 1, 0) && - odr_integer(o, &(*p)->indirect_reference, 1, 0) && - odr_graphicstring(o, &(*p)->descriptor, 1, 0))) - return 0; - /* - * Do we know this beast? - */ - if (o->direction == ODR_DECODE && (*p)->direct_reference && - (oid = oid_getentbyoid((*p)->direct_reference)) && - (type = z_ext_getentbyref(oid->value))) - { - int zclass, tag, cons; - - /* - * We know it. If it's represented as an ASN.1 type, bias the CHOICE. - */ - if (!odr_peektag(o, &zclass, &tag, &cons)) - return opt && odr_ok(o); - if (zclass == ODR_CONTEXT && tag == 0 && cons == 1) - odr_choice_bias(o, type->what); - } - return - odr_choice(o, arm, &(*p)->u, &(*p)->which, name) && - odr_sequence_end(o); -} - -Z_External *z_ext_record(ODR o, int format, const char *buf, int len) -{ - Z_External *thisext; - - thisext = (Z_External *) odr_malloc(o, sizeof(*thisext)); - thisext->descriptor = 0; - thisext->indirect_reference = 0; - - thisext->direct_reference = - yaz_oidval_to_z3950oid (o, CLASS_RECSYN, format); - if (!thisext->direct_reference) - return 0; - - if (len < 0) /* Structured data */ - { - - /* - * We cheat on the pointers here. Obviously, the record field - * of the backend-fetch structure should have been a union for - * correctness, but we're stuck with this for backwards - * compatibility. - */ - thisext->u.grs1 = (Z_GenericRecord*) buf; - - switch (format) - { - case VAL_SUTRS: - thisext->which = Z_External_sutrs; - break; - case VAL_GRS1: - thisext->which = Z_External_grs1; - break; - case VAL_EXPLAIN: - thisext->which = Z_External_explainRecord; - break; - case VAL_SUMMARY: - thisext->which = Z_External_summary; - break; - case VAL_OPAC: - thisext->which = Z_External_OPAC; - break; - case VAL_EXTENDED: - thisext->which = Z_External_extendedService; - break; - default: - return 0; - } - } - else if (format == VAL_SUTRS) /* SUTRS is a single-ASN.1-type */ - { - Odr_oct *sutrs = (Odr_oct *)odr_malloc(o, sizeof(*sutrs)); - - thisext->which = Z_External_sutrs; - thisext->u.sutrs = sutrs; - sutrs->buf = (unsigned char *)odr_malloc(o, len); - sutrs->len = sutrs->size = len; - memcpy(sutrs->buf, buf, len); - } - else - { - thisext->which = Z_External_octet; - if (!(thisext->u.octet_aligned = (Odr_oct *) - odr_malloc(o, sizeof(Odr_oct)))) - return 0; - if (!(thisext->u.octet_aligned->buf = (unsigned char *) - odr_malloc(o, len))) - return 0; - memcpy(thisext->u.octet_aligned->buf, buf, len); - thisext->u.octet_aligned->len = thisext->u.octet_aligned->size = len; - } - return thisext; -} - diff --git a/z39.50/univres.asn b/z39.50/univres.asn deleted file mode 100644 index f83320d..0000000 --- a/z39.50/univres.asn +++ /dev/null @@ -1,23 +0,0 @@ -ResourceReport-Format-Universe-1 -{Z39-50-resourceReport universe-1 (1000)} DEFINITIONS ::= -BEGIN -IMPORTS StringOrNumeric FROM Z39-50-APDU-1995; --- - -UniverseReportHits ::= SEQUENCE { - database StringOrNumeric, - hits StringOrNumeric -} - -UniverseReportDuplicate ::= SEQUENCE { - hitno StringOrNumeric -} - -UniverseReport ::= SEQUENCE { - totalHits INTEGER, - report CHOICE { - databaseHits [0] IMPLICIT UniverseReportHits, - duplicate [1] IMPLICIT UniverseReportDuplicate - } -} -END diff --git a/z39.50/z.tcl b/z39.50/z.tcl deleted file mode 100644 index 7cd0dff..0000000 --- a/z39.50/z.tcl +++ /dev/null @@ -1,351 +0,0 @@ -# YC Sample Config File for Z39.50 -# $Id: z.tcl,v 1.12 2003-07-18 19:53:28 mike Exp $ -# ---------------------------------------------------------- -# Prefix Specifications -# -# 1: C function prefix -# 2: C type prefix -# 3: C preprocessor prefix - -# Default prefix -set default-prefix {z_ Z_ Z_} - -# Name clash in extended services (TargetPart, OriginPartToKeep, etc) -# You can possibly think of better names :) -set prefix(ESFormat-PersistentResultSet) {z_PR Z_PR Z_PR} -set prefix(ESFormat-PersistentQuery) {z_PQuery Z_PQuery Z_PQuery} -set prefix(ESFormat-PeriodicQuerySchedule) {z_PQS Z_PQS Z_PQS} -set prefix(ESFormat-ItemOrder) {z_IO Z_IO Z_IO} -set prefix(ESFormat-Update0) {z_IU0 Z_IU0 Z_IU0} -set prefix(ESFormat-Update) {z_IU Z_IU Z_IU} -set prefix(ESFormat-ExportSpecification) {z_ES Z_ES Z_ES} -set prefix(ESFormat-ExportInvocation) {z_EI Z_EI Z_EI} - -# ---------------------------------------------------------- -# Settings for core of the protocol -set m Z39-50-APDU-1995 - -# Filename -set filename($m) z-core - -# Public header initialization code -set init($m,h) { -typedef struct Z_External Z_External; -YAZ_EXPORT int z_External(ODR o, Z_External **p, int opt, const char *name); -} - -set body($m,h) " -#ifdef __cplusplus -extern \"C\" \{ -#endif - -int z_ANY_type_0 (ODR o, void **p, int opt); - -#ifdef __cplusplus -\} -#endif -" -set body($m,c) { - -/* the type-0 query ... */ -int z_ANY_type_0 (ODR o, void **p, int opt) -{ - return 0; -} - -} - -# Type Name overrides -set map($m,PDU) APDU -set membermap($m,Operator,and) {Operator_and op_and} -set membermap($m,Operator,or) {Operator_or op_or} -#set membermap($m,Operator,and-not) {Operator_and_not op_and_not} -set map($m,AttributeElement_complex) ComplexAttribute -set map($m,DeleteSetStatus) DeleteStatus -set membermap($m,ProximityOperator,private) {ProximityOperator_private zprivate} -set unionmap($m,AttributeElement,attributeValue) {which value AttributeValue} -set membermap($m,ElementSpec,externalEspec) externalSpec -set membermap($m,RPNStructure,op) simple -set membermap($m,RPNStructure,rpnRpnOp) complex -set map($m,RPNStructure_complex) Complex -set membermap($m,Operand,attrTerm) {Operand_APT attributesPlusTerm} -set membermap($m,Operand,resultSet) {Operand_resultSetId resultSetId} -set membermap($m,Operand,resultAttr) {Operand_resultAttr resultAttr} -set membermap($m,Complex,rpn1) s1 -set membermap($m,Complex,rpn2) s2 -set membermap($m,Complex,op) roperator -set membermap($m,RPNQuery,attributeSet) attributeSetId -set membermap($m,RPNQuery,rpn) RPNStructure -set map($m,KnownProximityUnit) ProxUnit -set membermap($m,ProximityOperator,lessThan) {Prox_lessThan 1} -set membermap($m,ProximityOperator,lessThanOrEqual) {Prox_lessThanOrEqual 1} -set membermap($m,ProximityOperator,equal) {Prox_equal 1} -set membermap($m,ProximityOperator,greaterThanOrEqual) {Prox_greaterThanOrEqual 1} -set membermap($m,ProximityOperator,greaterThan) {Prox_greaterThan 1} -set membermap($m,ProximityOperator,notEqual) {Prox_notEqual 1} -# -set membermap($m,Records,responseRecords) {Records_DBOSD databaseOrSurDiagnostics} -set membermap($m,Records,nonSurrogateDiagnostic) {Records_NSD nonSurrogateDiagnostic} -set membermap($m,Records,multipleNonSurDiagnostics) {Records_multipleNSD multipleNonSurDiagnostics} -set map($m,Records_DBOSD) NamePlusRecordList -set map($m,Records_NSD) DiagRec -set map($m,Records_multipleNSD) DiagRecs -set membermap($m,NamePlusRecord,name) databaseName -set unionmap($m,DiagRecs) {num_diagRecs diagRecs} -set unionmap($m,NamePlusRecordList) {num_records records} -# -set membermap($m,ElementSetNames,genericElementSetName) generic -set map($m,ElementSetNames_databaseSpecific) DatabaseSpecific -# -set map($m,OccurrenceByAttributes_s) OccurrenceByAttributesElem -set map($m,OccurrenceByAttributesElem_byDatabase) byDatabaseList -# -set membermap($m,SortElement,datbaseSpecific) databaseSpecific -set map($m,SortElement_databaseSpecific) SortDbSpecificList -# -set map($m,SortKey_sortAttributes) SortAttributes -set unionmap($m,PresentRequest,recordComposition) {} -set map($m,PresentRequest_0) RecordComposition -set unionmap($m,PresentRequest,additionalRanges) {num_ranges additionalRanges} -set unionmap($m,SortRequest,sortSequence) {} -set map($m,SortRequest_0) SortKeySpecList -set unionmap($m,SortKeySpecList) {num_specs specs} -set map($m,InitializeRequest) InitRequest -set map($m,InitializeResponse) InitResponse -set unionmap($m,CloseReason) Close -set membermap($m,ProtocolVersion,version-1) 1 -set membermap($m,ProtocolVersion,version-2) 2 -set membermap($m,ProtocolVersion,version-3) 3 -set membermap($m,InitRequest,exceptionalRecordSize) maximumRecordSize -set membermap($m,InitResponse,exceptionalRecordSize) maximumRecordSize -set map($m,RecordsMultipleNonSurDiagnostics) DiagRecs -set map($m,RecordsDatabaseOrSurDiagnostics) NamePlusRecordList -set membermap($m,NamePlusRecord,retrievalRecord) databaseRecord -set unionmap($m,RecordComposition) {which u RecordComp} -set unionmap($m,ScanResponse,scanStatus) Scan -set unionmap($m,AttributeList) {num_attributes attributes} -set membermap($m,SortKey,sortfield) sortField -set map($m,CompSpec_0) DbSpecific -set map($m,DatabaseSpecific_s) DatabaseSpecificUnit -set map($m,ListStatuses_s) ListStatus -set map($m,IdAuthenticationIdPass) IdPass -set map($m,OtherInformation_s) OtherInformationUnit -set unionmap($m,OtherInformationUnit,information) {which information OtherInfo} -set unionmap($m,OtherInformation) {num_elements list} -set unionmap($m,Specification,elementSpec) {} -set map($m,Specification_0) ElementSpec -set unionmap($m,Specification,schema) {which schema Schema} - -# ---- -set m DiagnosticFormatDiag1 -set filename($m) z-diag1 -set map($m,DiagFormat_tooMany) TooMany -set map($m,DiagFormat_badSpec) BadSpec -set map($m,DiagFormat_dbUnavail) DbUnavail -set map($m,DiagFormat_attribute) Attribute -set map($m,DiagFormat_attCombo) AttCombo -set map($m,DiagFormat_term) DiagTerm -set map($m,DiagFormat_proximity) Proximity -set map($m,DiagFormat_scan) Scan -set map($m,DiagFormat_sort) Sort -set unionmap($m,Sort) {which u SortD} -set map($m,DiagFormat_segmentation) Segmentation -set map($m,DiagFormat_extServices) ExtServices -set map($m,DiagFormat_accessCtrl) AccessCtrl -set map($m,DiagFormat_recordSyntax) RecordSyntax -# -set map($m,Scan_termList2) AttrListList -set map($m,Sort_inputTooLarge) StringList -# -set map($m,AccessCtrl_oid) OidList -set map($m,AccessCtrl_alternative) AltOidList -# ---- -set m RecordSyntax-explain -set filename($m) z-exp -set map($m,Explain-Record) ExplainRecord -set map($m,ElementDataType_structured) ElementInfoList -set map($m,HumanString_s) HumanStringUnit -set unionmap($m,HumanString) {num_strings strings} -set membermap($m,CommonInfo,humanString-Language) humanStringLanguage -set unionmap($m,AttributeOccurrence,attributeValues) {which attributeValues AttributeOcc} -set unionmap($m,AttributeCombination) {num_occurrences occurrences} -# -set membermap($m,NetworkAddress,internetAddress) {NetworkAddress_iA internetAddress} -set map($m,NetworkAddress_iA) NetworkAddressIA -set membermap($m,NetworkAddress,osiPresentationAddress) {NetworkAddress_oPA osiPresentationAddress} -set map($m,NetworkAddress_oPA) NetworkAddressOPA -set map($m,NetworkAddress_other) NetworkAddressOther -set unionmap($m,DatabaseList) {num_databases databases} -set membermap($m,TargetInfo,recent-news) recentNews -set membermap($m,TargetInfo,usage-restrictions) usageRest -set membermap($m,DatabaseInfo,user-fee) userFee -# -set map($m,ProximitySupport_0) ProxSupportUnit -set map($m,ProxSupportUnitZprivate) ProxSupportPrivate -set membermap($m,ProxSupportUnit,private) {ProxSupportUnit_private zprivate} -# -set map($m,AttributeOccurrence_specific) AttributeValueList -set unionmap($m,AttributeValueList) {num_attributes attributes} - -set unionmap($m,ExplainRecord) {which u Explain} -set map($m,SchemaInfo_0) TagTypeMapping -set map($m,TagSetInfo_0) TagSetElements -set map($m,TermListInfo_0) TermListElement -set map($m,TermListDetails_0) EScanInfo -set map($m,PrivateCapabilities_0) PrivateCapOperator -set map($m,Costs_0) CostsOtherCharge -set map($m,Path_s) PathUnit -set map($m,IconObject_s) IconObjectUnit -set map($m,NetworkAddressInternetAddress) NetworkAddressIA -set map($m,NetworkAddressOsiPresentationAddress) NetworkAddressOPA -set membermap($m,QueryTypeDetails,private) {QueryTypeDetails_private zprivate} -set membermap($m,PrivateCapOperator,operator) roperator -set map($m,AccessRestrictions_s) AccessRestrictionsUnit -# ---- -set m RecordSyntax-SUTRS -set filename($m) z-sutrs -#set map($m,SutrsRecord) SUTRS -set body($m,c) { -int z_SUTRS (ODR o, Odr_oct **p, int opt, const char *name) -{ - return odr_implicit_tag(o, odr_octetstring, p, ODR_UNIVERSAL, - ODR_GENERALSTRING, opt, name); -} -} - -set init($m,h) { -typedef Odr_oct Z_SUTRS; -YAZ_EXPORT int z_SUTRS (ODR o, Odr_oct **p, int opt, const char *name); -} -# ---- -set m RecordSyntax-opac -set filename($m) z-opac -# ---- -set m RecordSyntax-summary -set filename($m) z-sum -# ---- -set m RecordSyntax-generic -set filename($m) z-grs -set map($m,ElementData_subtree) GenericRecord -set map($m,Variant_0) Triple -set membermap($m,Triple,class) zclass -set unionmap($m,Triple,value) {which value Triple} -set unionmap($m,GenericRecord) {num_elements elements} -# ---- -set m RecordSyntax-ESTaskPackage -set filename($m) z-estask -# ---- -set m ResourceReport-Format-Resource-1 -set filename($m) z-rrf1 -set map($m,ResourceReport) ResourceReport1 -set map($m,Estimate) Estimate1 -# ---- -set m ResourceReport-Format-Resource-2 -set filename($m) z-rrf2 -set map($m,ResourceReport) ResourceReport2 -set map($m,Estimate) Estimate2 -# ---- -set m AccessControlFormat-prompt-1 -set filename($m) z-accform1 -set membermap($m,PromptId,enummeratedPrompt) enumeratedPrompt -set map($m,PromptObject) PromptObject1 -set map($m,Challenge) Challenge1 -set map($m,Challenge1_s) ChallengeUnit1 -set map($m,Response) Response1 -set map($m,Response1_s) ResponseUnit1 -set map($m,PromptObject) PromptObject1 -# ---- -set m AccessControlFormat-des-1 -set filename($m) z-accdes1 -# ---- -set m AccessControlFormat-krb-1 -set filename($m) z-acckrb1 -# ---- -set m ESFormat-PersistentResultSet -set filename($m) zes-pset -# ---- -set m ESFormat-PersistentQuery -set filename($m) zes-pquery -# ---- -set m ESFormat-PeriodicQuerySchedule -set filename($m) zes-psched -# ---- -set m ESFormat-ItemOrder -set filename($m) zes-order -set map($m,ItemOrderEsRequest) Request -set map($m,ItemOrderTaskPackage) TaskPackage -set map($m,OriginPartToKeep_0) Contact -set map($m,OriginPartToKeep_1) Billing -set map($m,OriginPartNotToKeep_0) ResultSetItem -# -# ---- (old version) -set m ESFormat-Update0 -set filename($m) zes-update0 -set map($m,SuppliedRecords_s) SuppliedRecords_elem -set map($m,SuppliedRecords_elem_0) SuppliedRecordsId -# -# ---- (new, current version) -set m ESFormat-Update -set filename($m) zes-update -set map($m,SuppliedRecords_s) SuppliedRecords_elem -set map($m,SuppliedRecords_elem_0) SuppliedRecordsId -# ---- -set m ESFormat-ExportSpecification -set filename($m) zes-exps -# ---- -set m ESFormat-ExportInvocation -set filename($m) zes-expi -# ---- -set m UserInfoFormat-searchResult-1 -set filename($m) z-uifr1 -# ---- -set m ElementSpecificationFormat-eSpec-1 -set filename($m) z-espec1 -set map($m,Espec-1) Espec1 -set map($m,TagPath) ETagPath -set map($m,ETagPath_s) ETagUnit -set map($m,ETagUnitSpecificTag) SpecificTag -set membermap($m,SpecificTag,occurrence) occurrences -set unionmap($m,ElementRequest) {which u ERequest} -set unionmap($m,ETagPath) {num_tags tags} -set map($m,OccurrencesValues) OccurValues -# ---- -set m UserInfoFormat-dateTime -set filename($m) z-date -set map($m,Z3950Date) Date -set map($m,Z3950Time) Time -set unionmap($m,Z3950Date,era) {} -set map($m,DateFlags_0) Era -set map($m,Z3950DateMonthAndDay) MonthAndDay -set map($m,Z3950DateQuarter) DateQuater -set map($m,Z3950DateSeason) DateSeason -set map($m,Date_0) DateFlags -set unionmap($m,DateFlags,era) {} -# ---- -set m UserInfoFormat-multipleSearchTerms-2 -set filename($m) z-mterm2 -# ---- -set m ResourceReport-Format-Universe-1 -set filename($m) z-univ -# ---- -set m UserInfoFormat-oclcUserInformation -set filename($m) z-oclcui -# ---- -set m ESFormat-Admin -set filename($m) zes-admin -set map($m,EsRequest) ESAdminRequest -set map($m,TaskPackage) ESAdminTaskPackage -set map($m,OriginPartToKeep) ESAdminOriginPartToKeep -set map($m,OriginPartNotToKeep) ESAdminOriginPartNotToKeep -set map($m,TargetPart) ESAdminTargetPart -# ---- -set m NegotiationRecordDefinition-charSetandLanguageNegotiation-3 -set filename($m) z-charneg -set membermap($m,OriginProposal_0,private) {OriginProposal_0_private zprivate} -set membermap($m,TargetResponse,private) {TargetResponse_private zprivate} -# ---------------------------------------------------------- -# "Constructed" types defined by means of C-types are declared here. -# Each function returns the C-handler and the C-type. -proc asnBasicEXTERNAL {} { - return {z_External Z_External} -} diff --git a/z39.50/z3950v3.asn b/z39.50/z3950v3.asn deleted file mode 100644 index 98cf885..0000000 --- a/z39.50/z3950v3.asn +++ /dev/null @@ -1,2667 +0,0 @@ -Z39-50-APDU-1995 -- OID for this definition, assigned in OID.3.1, is {Z39-50 2 1} -DEFINITIONS ::= -BEGIN -- Z39.50 Maintenance Agency Official Text for ANSI/NISO Z39.50-1995 - July 1995 --- -EXPORTS OtherInformation, Term, AttributeSetId, AttributeList, AttributeElement, ElementSetName, SortElement, DatabaseName, -CompSpec, Specification, Permissions, InternationalString, IntUnit, Unit, StringOrNumeric, Query, Records, ResultSetId, -DefaultDiagFormat, DiagRec, Segment; --- - -PDU ::= CHOICE{ - initRequest [20] IMPLICIT InitializeRequest, - initResponse [21] IMPLICIT InitializeResponse, - searchRequest [22] IMPLICIT SearchRequest, - searchResponse [23] IMPLICIT SearchResponse, - presentRequest [24] IMPLICIT PresentRequest, - presentResponse [25] IMPLICIT PresentResponse, - deleteResultSetRequest [26] IMPLICIT DeleteResultSetRequest, - deleteResultSetResponse [27] IMPLICIT DeleteResultSetResponse, - accessControlRequest [28] IMPLICIT AccessControlRequest, - accessControlResponse [29] IMPLICIT AccessControlResponse, - resourceControlRequest [30] IMPLICIT ResourceControlRequest, - resourceControlResponse [31] IMPLICIT ResourceControlResponse, - triggerResourceControlRequest [32] IMPLICIT TriggerResourceControlRequest, - resourceReportRequest [33] IMPLICIT ResourceReportRequest, - resourceReportResponse [34] IMPLICIT ResourceReportResponse, - scanRequest [35] IMPLICIT ScanRequest, - scanResponse [36] IMPLICIT ScanResponse, - -- [37] through [42] reserved - sortRequest [43] IMPLICIT SortRequest, - sortResponse [44] IMPLICIT SortResponse, - segmentRequest [45] IMPLICIT Segment, - extendedServicesRequest [46] IMPLICIT ExtendedServicesRequest, - extendedServicesResponse [47] IMPLICIT ExtendedServicesResponse, - close [48] IMPLICIT Close, - duplicateDetectionRequest [49] IMPLICIT DuplicateDetectionRequest, - duplicateDetectionResponse [50] IMPLICIT DuplicateDetectionResponse} - - --- Initialize APDUs --- - InitializeRequest ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - protocolVersion ProtocolVersion, - options Options, - preferredMessageSize [5] IMPLICIT INTEGER, - exceptionalRecordSize [6] IMPLICIT INTEGER, - idAuthentication [7] IdAuthentication OPTIONAL, -- see note below - implementationId [110] IMPLICIT InternationalString OPTIONAL, - implementationName [111] IMPLICIT InternationalString OPTIONAL, - implementationVersion [112] IMPLICIT InternationalString OPTIONAL, - userInformationField [11] EXTERNAL OPTIONAL, - otherInfo OtherInformation OPTIONAL} ---Note: --- For idAuthentication, the type ANY is retained for compatibility with earlier versions. --- For interoperability, the following is recommended: -IdAuthentication ::= - CHOICE{ - open VisibleString, - idPass SEQUENCE { - groupId [0] IMPLICIT InternationalString OPTIONAL, - userId [1] IMPLICIT InternationalString OPTIONAL, - password [2] IMPLICIT InternationalString OPTIONAL }, - anonymous NULL, - other EXTERNAL - } --- May use access control formats for 'other'. See Appendix 7 ACC. --- - InitializeResponse ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - protocolVersion ProtocolVersion, - options Options, - preferredMessageSize [5] IMPLICIT INTEGER, - exceptionalRecordSize [6] IMPLICIT INTEGER, - result [12] IMPLICIT BOOLEAN, -- reject = FALSE; Accept = TRUE - implementationId [110] IMPLICIT InternationalString OPTIONAL, - implementationName [111] IMPLICIT InternationalString OPTIONAL, - implementationVersion [112] IMPLICIT InternationalString OPTIONAL, - userInformationField [11] EXTERNAL OPTIONAL, - otherInfo OtherInformation OPTIONAL} --- Begin auxiliary definitions for Init PDUs - ProtocolVersion ::= [3] IMPLICIT BIT STRING{ - version-1 (0), -- This bit should always be set, but does not - -- correspond to any Z39.50 version. - version-2 (1), -- "Version 2 supported." - -- This bit should always be set. - version-3 (2) -- "Version 3 supported." --- Values higher than 'version-3' should be ignored. Both the Initialize request and Initialize Response APDUs --- include a value string corresponding to the supported versions. The highest common version is selected --- for use. If there are no versions in common, "Result" in the Init Response should indicate "reject." --- Note: Versions 1 and 2 are identical. Systems supporting version 2 should indicate support for version --- 1 as well, for interoperability with systems that indicate support for version 1 only (e.g. ISO 10163-1991 --- implementations). - } - Options ::= [4] IMPLICIT BIT STRING{ - search (0), - present (1), - delSet (2), - resourceReport (3), - triggerResourceCtrl (4), - resourceCtrl (5), - accessCtrl (6), - scan (7), - sort (8), - -- (not used) (9), - extendedServices (10), - level-1Segmentation (11), - level-2Segmentation (12), - concurrentOperations (13), - namedResultSets (14), - encapsulation (15), - resultCount (16), - negotiationModel (17), - duplicateDetection (18), - queryType104 (19), - pQESCorrection (20), - stringSchema (21) -} --- end auxiliary definitions for Init PDUs - - ---Search APDUs - SearchRequest ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - smallSetUpperBound [13] IMPLICIT INTEGER, - largeSetLowerBound [14] IMPLICIT INTEGER, - mediumSetPresentNumber [15] IMPLICIT INTEGER, - replaceIndicator [16] IMPLICIT BOOLEAN, - resultSetName [17] IMPLICIT InternationalString, - databaseNames [18] IMPLICIT SEQUENCE OF DatabaseName, - smallSetElementSetNames [100] ElementSetNames OPTIONAL, - mediumSetElementSetNames [101] ElementSetNames OPTIONAL, - preferredRecordSyntax [104] IMPLICIT OBJECT IDENTIFIER OPTIONAL, - query [21] Query, - -- Following two parameters may be used only if version 3 is in force. - additionalSearchInfo [203] IMPLICIT OtherInformation OPTIONAL, - otherInfo OtherInformation OPTIONAL} - - --- Query Definitions - Query ::= CHOICE{ - type-0 [0] ANY, - type-1 [1] IMPLICIT RPNQuery, - type-2 [2] OCTET STRING, - type-100 [100] OCTET STRING, - type-101 [101] IMPLICIT RPNQuery, - type-102 [102] OCTET STRING, - type-104 [104] IMPLICIT EXTERNAL -} --- --- Definitions for RPN query - RPNQuery ::= SEQUENCE{ - attributeSet AttributeSetId, - rpn RPNStructure} --- - RPNStructure ::= CHOICE{ - op [0] Operand, - rpnRpnOp [1] IMPLICIT SEQUENCE{ - rpn1 RPNStructure, - rpn2 RPNStructure, - op Operator }} - Operand ::= CHOICE{ - attrTerm AttributesPlusTerm, - resultSet ResultSetId, - -- If version 2 is in force: - -- - If query type is 1, one of the above two must be chosen; - -- - resultAttr (below) may be used only if query type is 101. - resultAttr ResultSetPlusAttributes} - - AttributesPlusTerm ::= [102] IMPLICIT SEQUENCE{ - attributes AttributeList, - term Term} - ResultSetPlusAttributes ::= [214] IMPLICIT SEQUENCE{ - resultSet ResultSetId, - attributes AttributeList} - AttributeList ::= [44] IMPLICIT SEQUENCE OF AttributeElement --- - Term ::= CHOICE{ - general [45] IMPLICIT OCTET STRING, - -- values below may be used only if version 3 is in force - numeric [215] IMPLICIT INTEGER, - characterString [216] IMPLICIT InternationalString, - oid [217] IMPLICIT OBJECT IDENTIFIER, - dateTime [218] IMPLICIT GeneralizedTime, - external [219] IMPLICIT EXTERNAL, - integerAndUnit [220] IMPLICIT IntUnit, - null [221] IMPLICIT NULL} - - Operator ::= [46] CHOICE{ - and [0] IMPLICIT NULL, - or [1] IMPLICIT NULL, - and-not [2] IMPLICIT NULL, - -- If version 2 is in force: - -- - For query type 1, one of the above three must be chosen; - -- - prox (below) may be used only if query type is 101. - prox [3] IMPLICIT ProximityOperator} - AttributeElement ::= SEQUENCE{ - attributeSet [1] IMPLICIT AttributeSetId OPTIONAL, - -- Must be omitted if version 2 is in force. - -- If included, overrides value of attributeSet - -- in RPNQuery above, but only for this attribute. - attributeType [120] IMPLICIT INTEGER, - attributeValue CHOICE{ - numeric [121] IMPLICIT INTEGER, - -- If version 2 is in force, - -- Must select 'numeric' for attributeValue. - - complex [224] IMPLICIT SEQUENCE{ - list [1] IMPLICIT SEQUENCE OF StringOrNumeric, - semanticAction [2] IMPLICIT SEQUENCE OF INTEGER OPTIONAL}}} - - - ProximityOperator ::= SEQUENCE{ - exclusion [1] IMPLICIT BOOLEAN OPTIONAL, - distance [2] IMPLICIT INTEGER, - ordered [3] IMPLICIT BOOLEAN, - relationType [4] IMPLICIT INTEGER{ - lessThan (1), - lessThanOrEqual (2), - equal (3), - greaterThanOrEqual (4), - greaterThan (5), - notEqual (6)}, - proximityUnitCode [5] CHOICE{ - known [1] IMPLICIT KnownProximityUnit, - private [2] IMPLICIT INTEGER}} --- - KnownProximityUnit ::= INTEGER{ - character (1), - word (2), - sentence (3), - paragraph (4), - section (5), - chapter (6), - document (7), - element (8), - subelement (9), - elementType (10), - byte (11) -- Version 3 only - } --- End definitions for RPN Query - - -SearchResponse ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - resultCount [23] IMPLICIT INTEGER, - numberOfRecordsReturned [24] IMPLICIT INTEGER, - nextResultSetPosition [25] IMPLICIT INTEGER, - searchStatus [22] IMPLICIT BOOLEAN, - resultSetStatus [26] IMPLICIT INTEGER{ - subset (1), - interim (2), - none (3)} OPTIONAL, - presentStatus PresentStatus OPTIONAL, - records Records OPTIONAL, - -- Following two parameters may be used only if version 3 is in force. - additionalSearchInfo [203] IMPLICIT OtherInformation OPTIONAL, - otherInfo OtherInformation OPTIONAL} ---Retrieval APDUs - PresentRequest ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - resultSetId ResultSetId, - resultSetStartPoint [30] IMPLICIT INTEGER, - numberOfRecordsRequested [29] IMPLICIT INTEGER, - additionalRanges [212] IMPLICIT SEQUENCE OF Range OPTIONAL, - -- additionalRanges may be included only if version 3 is in force. - recordComposition CHOICE{ - simple [19] ElementSetNames, - -- must choose 'simple' if version 2 is in force - complex [209] IMPLICIT CompSpec} OPTIONAL, - preferredRecordSyntax [104] IMPLICIT OBJECT IDENTIFIER OPTIONAL, - maxSegmentCount [204] IMPLICIT INTEGER OPTIONAL, -- level 1 or 2 - maxRecordSize [206] IMPLICIT INTEGER OPTIONAL, -- level 2 only - maxSegmentSize [207] IMPLICIT INTEGER OPTIONAL, -- level 2 only - otherInfo OtherInformation OPTIONAL} --- - Segment ::= SEQUENCE{ - -- Segment PDU may only be used when version 3 is in force, - -- and only when segmentation is in effect. - referenceId ReferenceId OPTIONAL, - numberOfRecordsReturned [24] IMPLICIT INTEGER, - segmentRecords [0] IMPLICIT SEQUENCE OF NamePlusRecord, - otherInfo OtherInformation OPTIONAL} --- - PresentResponse ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - numberOfRecordsReturned [24] IMPLICIT INTEGER, - nextResultSetPosition [25] IMPLICIT INTEGER, - presentStatus PresentStatus, - records Records OPTIONAL, - otherInfo OtherInformation OPTIONAL} --- begin auxiliary definitions for Search and Present APDUs - --- begin definition of records - Records ::= CHOICE{ - responseRecords [28] IMPLICIT SEQUENCE OF NamePlusRecord, - nonSurrogateDiagnostic [130] IMPLICIT DefaultDiagFormat, - multipleNonSurDiagnostics [205] IMPLICIT SEQUENCE OF DiagRec} --- - NamePlusRecord ::= SEQUENCE{ - name [0] IMPLICIT DatabaseName OPTIONAL, - record [1] CHOICE{ - retrievalRecord [1] EXTERNAL, - surrogateDiagnostic [2] DiagRec, - -- Must select one of the above two, retrievalRecord or - -- surrogateDiagnostic, unless 'level 2 segmentation' is in effect. - startingFragment [3] FragmentSyntax, - intermediateFragment [4] FragmentSyntax, - finalFragment [5] FragmentSyntax}} - FragmentSyntax ::= CHOICE{ - externallyTagged EXTERNAL, - notExternallyTagged OCTET STRING} - - DiagRec ::= CHOICE{ - defaultFormat DefaultDiagFormat, - -- Must choose defaultFormat if version 2 is in effect. - externallyDefined EXTERNAL} - - DefaultDiagFormat::= SEQUENCE{ - diagnosticSetId OBJECT IDENTIFIER, - condition INTEGER, - addinfo CHOICE{ - v2Addinfo VisibleString, -- version 2 - v3Addinfo InternationalString -- version 3 - }} - -- end definition of records - Range ::= SEQUENCE{ - startingPosition [1] IMPLICIT INTEGER, - numberOfRecords [2] IMPLICIT INTEGER} --- - ElementSetNames ::= CHOICE { - genericElementSetName [0] IMPLICIT InternationalString, - databaseSpecific [1] IMPLICIT SEQUENCE OF SEQUENCE{ - dbName DatabaseName, - esn ElementSetName}} - - PresentStatus ::= [27] IMPLICIT INTEGER{ - success (0), - partial-1 (1), - partial-2 (2), - partial-3 (3), - partial-4 (4), - failure (5)} - --- begin definition of composition specification - CompSpec ::= SEQUENCE{ - selectAlternativeSyntax [1] IMPLICIT BOOLEAN, - -- See comment for recordSyntax, below. - generic [2] IMPLICIT Specification OPTIONAL, - dbSpecific [3] IMPLICIT SEQUENCE OF SEQUENCE{ - db [1] DatabaseName, - spec [2] IMPLICIT Specification} OPTIONAL, - -- At least one of generic and dbSpecific must occur, and both may occur. If both, then for - -- any record not in the list of databases within dbSpecific, generic applies. - recordSyntax [4] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL - -- For each record, the target selects the first record syntax - -- in this list that it can support. If the list is exhausted, the - -- target may select an alternative syntax if - -- selectAlternativeSyntax is 'true'. - } - Specification ::= SEQUENCE{ - schema CHOICE { - oid [1] IMPLICIT OBJECT IDENTIFIER, - uri [300] IMPLICIT InternationalString - } OPTIONAL, - elementSpec [2] CHOICE{ - elementSetName [1] IMPLICIT InternationalString, - externalEspec [2] IMPLICIT EXTERNAL} OPTIONAL} --- end definition of composition specification --- end auxiliary definitions for search and response APDUs - --- Delete APDUs - DeleteResultSetRequest ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - deleteFunction [32] IMPLICIT INTEGER{ - list (0), - all (1)}, - resultSetList SEQUENCE OF ResultSetId OPTIONAL, - otherInfo OtherInformation OPTIONAL} --- - DeleteResultSetResponse ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - deleteOperationStatus [0] IMPLICIT DeleteSetStatus, - deleteListStatuses [1] IMPLICIT ListStatuses OPTIONAL, - numberNotDeleted [34] IMPLICIT INTEGER OPTIONAL, - bulkStatuses [35] IMPLICIT ListStatuses OPTIONAL, - deleteMessage [36] IMPLICIT InternationalString OPTIONAL, - otherInfo OtherInformation OPTIONAL} - ListStatuses ::= SEQUENCE OF SEQUENCE{ - id ResultSetId, - status DeleteSetStatus} - - DeleteSetStatus ::= [33] IMPLICIT INTEGER{ - success (0), - resultSetDidNotExist (1), - previouslyDeletedByTarget (2), - systemProblemAtTarget (3), - accessNotAllowed (4), - resourceControlAtOrigin (5), - resourceControlAtTarget (6), - bulkDeleteNotSupported (7), - notAllRsltSetsDeletedOnBulkDlte (8), - notAllRequestedResultSetsDeleted (9), - resultSetInUse (10)} --- - ---Access- and Resource-control APDUs --- - AccessControlRequest ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - securityChallenge CHOICE{ - simpleForm [37] IMPLICIT OCTET STRING, - externallyDefined [0] EXTERNAL}, - otherInfo OtherInformation OPTIONAL} - - AccessControlResponse ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - securityChallengeResponse CHOICE{ - simpleForm [38] IMPLICIT OCTET STRING, - externallyDefined [0] EXTERNAL} OPTIONAL, - -- Optional only in version 3; mandatory in version 2. If - -- omitted (in version 3) then diagnostic must occur. - diagnostic [223] DiagRec OPTIONAL, -- Version 3 only. - otherInfo OtherInformation OPTIONAL} - - - - ResourceControlRequest ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - suspendedFlag [39] IMPLICIT BOOLEAN OPTIONAL, - resourceReport [40] ResourceReport OPTIONAL, - partialResultsAvailable [41] IMPLICIT INTEGER{ - subset (1), - interim (2), - none (3)} OPTIONAL, - responseRequired [42] IMPLICIT BOOLEAN, - triggeredRequestFlag [43] IMPLICIT BOOLEAN OPTIONAL, - otherInfo OtherInformation OPTIONAL} - - - ResourceControlResponse ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - continueFlag [44] IMPLICIT BOOLEAN, - resultSetWanted [45] IMPLICIT BOOLEAN OPTIONAL, - otherInfo OtherInformation OPTIONAL} - - - - TriggerResourceControlRequest ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - requestedAction [46] IMPLICIT INTEGER{ - resourceReport (1), - resourceControl (2), - cancel (3)}, - prefResourceReportFormat [47] IMPLICIT ResourceReportId OPTIONAL, - resultSetWanted [48] IMPLICIT BOOLEAN OPTIONAL, - otherInfo OtherInformation OPTIONAL} - - - - ResourceReportRequest ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - opId [210] IMPLICIT ReferenceId OPTIONAL, - prefResourceReportFormat [49] IMPLICIT ResourceReportId OPTIONAL, - otherInfo OtherInformation OPTIONAL} --- - ResourceReportResponse ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - resourceReportStatus [50] IMPLICIT INTEGER{ - success (0), - partial (1), - failure-1 (2), - failure-2 (3), - failure-3 (4), - failure-4 (5), - failure-5 (6), - failure-6 (7)}, - resourceReport [51] ResourceReport OPTIONAL, - otherInfo OtherInformation OPTIONAL} --- - ResourceReport ::= EXTERNAL - ResourceReportId ::= OBJECT IDENTIFIER - ---Scan APDUs - ScanRequest ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - databaseNames [3] IMPLICIT SEQUENCE OF DatabaseName, - attributeSet AttributeSetId OPTIONAL, - termListAndStartPoint AttributesPlusTerm, - stepSize [5] IMPLICIT INTEGER OPTIONAL, - numberOfTermsRequested [6] IMPLICIT INTEGER, - preferredPositionInResponse [7] IMPLICIT INTEGER OPTIONAL, - otherInfo OtherInformation OPTIONAL} - - ScanResponse ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - stepSize [3] IMPLICIT INTEGER OPTIONAL, - scanStatus [4] IMPLICIT INTEGER { - success (0), - partial-1 (1), - partial-2 (2), - partial-3 (3), - partial-4 (4), - partial-5 (5), - failure (6) }, - numberOfEntriesReturned [5] IMPLICIT INTEGER, - positionOfTerm [6] IMPLICIT INTEGER OPTIONAL, - entries [7] IMPLICIT ListEntries OPTIONAL, - attributeSet [8] IMPLICIT AttributeSetId OPTIONAL, - otherInfo OtherInformation OPTIONAL} - --- begin auxiliary definitions for Scan - ListEntries ::= SEQUENCE{ - entries [1] IMPLICIT SEQUENCE OF Entry OPTIONAL, - nonsurrogateDiagnostics [2] IMPLICIT SEQUENCE OF DiagRec OPTIONAL - -- At least one of entries and nonsurrogateDiagnostics must occur - } - - Entry ::= CHOICE { - termInfo [1] IMPLICIT TermInfo, - surrogateDiagnostic [2] DiagRec} --- - TermInfo ::= SEQUENCE { - term Term, - displayTerm [0] IMPLICIT InternationalString OPTIONAL, - -- Presence of displayTerm means that term is not considered by - -- the target to be suitable for display, and displayTerm should - -- instead be displayed. 'term' is the actual term in the term list; - -- 'displayTerm' is for display purposes only, and is not an actual - -- term in the term list. - suggestedAttributes AttributeList OPTIONAL, - alternativeTerm [4] IMPLICIT SEQUENCE OF AttributesPlusTerm OPTIONAL, - globalOccurrences [2] IMPLICIT INTEGER OPTIONAL, - byAttributes [3] IMPLICIT OccurrenceByAttributes OPTIONAL, - otherTermInfo OtherInformation OPTIONAL} - - OccurrenceByAttributes ::= SEQUENCE OF SEQUENCE{ - attributes [1] AttributeList, - occurrences CHOICE{ - global [2] INTEGER, - byDatabase [3] IMPLICIT SEQUENCE OF SEQUENCE{ - db DatabaseName, - num [1] IMPLICIT INTEGER OPTIONAL, - otherDbInfo OtherInformation OPTIONAL}} OPTIONAL, - otherOccurInfo OtherInformation OPTIONAL} --- end auxiliary definitions for Scan - --- Sort APDUs -SortRequest ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - inputResultSetNames [3] IMPLICIT SEQUENCE OF InternationalString, - sortedResultSetName [4] IMPLICIT InternationalString, - sortSequence [5] IMPLICIT SEQUENCE OF SortKeySpec, - -- order of occurrence is from major to minor - otherInfo OtherInformation OPTIONAL} - -SortResponse ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - sortStatus [3] IMPLICIT INTEGER{ - success (0), - partial-1 (1), - failure (2)}, - resultSetStatus [4] IMPLICIT INTEGER{ - empty (1), - interim (2), - unchanged (3), - none (4)} OPTIONAL, - diagnostics [5] IMPLICIT SEQUENCE OF DiagRec OPTIONAL, - resultCount [6] IMPLICIT INTEGER OPTIONAL, - otherInfo OtherInformation OPTIONAL} - --- begin auxiliary definitions for Sort - SortKeySpec ::= SEQUENCE{ - sortElement SortElement, - sortRelation [1] IMPLICIT INTEGER{ - ascending (0), - descending (1), - ascendingByFrequency (3), - descendingByfrequency (4)}, - caseSensitivity [2] IMPLICIT INTEGER{ - caseSensitive (0), - caseInsensitive (1)}, - missingValueAction [3] CHOICE{ - abort [1] IMPLICIT NULL, - null [2] IMPLICIT NULL, - --supply a null value for missing value - missingValueData [3] IMPLICIT OCTET STRING} OPTIONAL} - - SortElement ::= CHOICE{ - generic [1] SortKey, - datbaseSpecific [2] IMPLICIT SEQUENCE OF SEQUENCE{ - databaseName DatabaseName, - dbSort SortKey}} - - SortKey ::= CHOICE{ - sortfield [0] IMPLICIT InternationalString, - -- An element, element-group-tag, or alias supported by the target - -- and denoting a set of elements associated with each record. - elementSpec [1] IMPLICIT Specification, - sortAttributes [2] IMPLICIT SEQUENCE{ - id AttributeSetId, - list AttributeList}} --- end auxiliary definitions for sort - - - --- Extended Service APDUs - ExtendedServicesRequest ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - function [3] IMPLICIT INTEGER { - create (1), - delete (2), - modify (3)}, - packageType [4] IMPLICIT OBJECT IDENTIFIER, - packageName [5] IMPLICIT InternationalString OPTIONAL, - -- PackageName mandatory for 'modify' or 'delete'; optional for - -- 'create'. Following four parameters mandatory for 'create'; should - -- be included on 'modify' if being modified; not needed on 'delete'. - userId [6] IMPLICIT InternationalString OPTIONAL, - retentionTime [7] IMPLICIT IntUnit OPTIONAL, - permissions [8] IMPLICIT Permissions OPTIONAL, - description [9] IMPLICIT InternationalString OPTIONAL, - --- (ExtendedServiceRequest APDU continued) - taskSpecificParameters [10] IMPLICIT EXTERNAL OPTIONAL, - -- Mandatory for 'create'; included on 'modify' if specific - -- parameters being modified; not necessary on 'delete'. For the - -- 'EXTERNAL,' use OID of specific ES definition and select - -- CHOICE [1]: 'esRequest'. - waitAction [11] IMPLICIT INTEGER{ - wait (1), - waitIfPossible (2), - dontWait (3), - dontReturnPackage (4)}, - elements ElementSetName OPTIONAL, - otherInfo OtherInformation OPTIONAL} --- - -ExtendedServicesResponse ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, - operationStatus [3] IMPLICIT INTEGER{ - done (1), - accepted (2), - failure (3)}, - diagnostics [4] IMPLICIT SEQUENCE OF DiagRec OPTIONAL, - taskPackage [5] IMPLICIT EXTERNAL OPTIONAL, - -- Use OID: {Z39-50-recordSyntax (106)} and corresponding - -- syntax. For the EXTERNAL, 'taskSpecific,' within that - -- definition, use OID of the specific es, and choose [2], - -- 'taskPackage'. - otherInfo OtherInformation OPTIONAL} - - Permissions ::= SEQUENCE OF SEQUENCE{ - userId [1] IMPLICIT InternationalString, - allowableFunctions [2] IMPLICIT SEQUENCE OF INTEGER{ - delete (1), - modifyContents (2), - modifyPermissions (3), - present (4), - invoke (5)}} - -Close ::= SEQUENCE{ - referenceId ReferenceId OPTIONAL, -- See 3.2.11.1.5. - closeReason CloseReason, - diagnosticInformation [3] IMPLICIT InternationalString OPTIONAL, - resourceReportFormat [4] IMPLICIT ResourceReportId OPTIONAL, - -- For use by origin only, and only on Close request; - -- origin requests target to include report in response. - resourceReport [5] ResourceReport OPTIONAL, - -- For use by target only, unilaterally on Close request; - -- on Close response may be unilateral or in response - -- to origin request. - otherInfo OtherInformation OPTIONAL} - - CloseReason ::= [211] IMPLICIT INTEGER{ - finished (0), - shutdown (1), - systemProblem (2), - costLimit (3), - resources (4), - securityViolation (5), - protocolError (6), - lackOfActivity (7), - peerAbort (8), - unspecified (9)} - ---Duplicate detection APDUs -DuplicateDetectionRequest ::= SEQUENCE { - referenceId ReferenceId OPTIONAL, - inputResultSetIds [3] IMPLICIT SEQUENCE OF InternationalString, - outputResultSetName [4] IMPLICIT InternationalString, - applicablePortionOfRecord [5] IMPLICIT EXTERNAL OPTIONAL, - duplicateDetectionCriteria [6] IMPLICIT SEQUENCE OF - DuplicateDetectionCriterion OPTIONAL, - clustering [7] IMPLICIT BOOLEAN OPTIONAL, - -- 'true' means "clustered". - -- This parameter may be omitted - -- only if retentionCriteria CHOICE is - -- 'numberOfEntries' and its value is 1. - retentionCriteria [8] IMPLICIT SEQUENCE OF - RetentionCriterion, - sortCriteria [9] IMPLICIT SEQUENCE OF - SortCriterion OPTIONAL, - otherInfo OtherInformation OPTIONAL} - -DuplicateDetectionCriterion ::= CHOICE{ - levelOfMatch [1] IMPLICIT INTEGER, - -- a percentage; 1-100. - caseSensitive [2] IMPLICIT NULL, - punctuationSensitive [3] IMPLICIT NULL, - regularExpression [4] IMPLICIT EXTERNAL, - rsDuplicates [5] IMPLICIT NULL - -- values 6-100 reserved for future assignment. - } - -RetentionCriterion ::= CHOICE{ - numberOfEntries [1] IMPLICIT INTEGER, - -- greater than 0 - percentOfEntries [2] IMPLICIT INTEGER, - -- 1-100, - duplicatesOnly [3] IMPLICIT NULL, - -- should not be chosen - -- if clustering is 'true' - discardRsDuplicates [4] IMPLICIT NULL - -- values 5-100 reserved for future assignment. - } - -SortCriterion ::= CHOICE{ - mostComprehensive [1] IMPLICIT NULL, - leastConmprehensive [2] IMPLICIT NULL, - mostRecent [3] IMPLICIT NULL, - oldest [4] IMPLICIT NULL, - leastCost [5] IMPLICIT NULL, - preferredDatabases [6] IMPLICIT - SEQUENCE OF InternationalString - -- values 7-100 reserved for future assignment. -} - -DuplicateDetectionResponse ::= SEQUENCE { - referenceId ReferenceId OPTIONAL, - status [3] IMPLICIT INTEGER{ - success (0), - failure (1)}, - resultSetCount [4] IMPLICIT INTEGER OPTIONAL, - diagnostics [5] IMPLICIT SEQUENCE OF DiagRec OPTIONAL, - otherInfo OtherInformation OPTIONAL} - --- Global auxiliary definitions - ReferenceId ::= [2] IMPLICIT OCTET STRING - ResultSetId ::= [31] IMPLICIT InternationalString - ElementSetName ::= [103] IMPLICIT InternationalString - DatabaseName ::= [105] IMPLICIT InternationalString - AttributeSetId ::= OBJECT IDENTIFIER - - --- OtherInformation - OtherInformation ::= [201] IMPLICIT SEQUENCE OF SEQUENCE{ - category [1] IMPLICIT InfoCategory OPTIONAL, - information CHOICE{ - characterInfo [2] IMPLICIT InternationalString, - binaryInfo [3] IMPLICIT OCTET STRING, - externallyDefinedInfo [4] IMPLICIT EXTERNAL, - oid [5] IMPLICIT OBJECT IDENTIFIER}} --- - InfoCategory ::= SEQUENCE{ - categoryTypeId [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL, - categoryValue [2] IMPLICIT INTEGER} - - --- Units - -- IntUnit is used when value and unit are supplied together. Unit, alone, is used when just - -- specifying a unit (without a value). For example, IntUnit is used in Term, in an RPNQuery, or - -- it can be the datatype of an element within a retrieval record. Unit (alone) would be used in an - -- element request, when requesting data be returned according to a particular unit. - - IntUnit ::= SEQUENCE{ - value [1] IMPLICIT INTEGER, - unitUsed [2] IMPLICIT Unit} --- - Unit ::= SEQUENCE{ - unitSystem [1] InternationalString OPTIONAL, -- e.g. 'SI' - unitType [2] StringOrNumeric OPTIONAL, -- e.g. 'mass' - unit [3] StringOrNumeric OPTIONAL, -- e.g. 'kilograms' - scaleFactor [4] IMPLICIT INTEGER OPTIONAL -- e.g. 9 means 10**9 - } - ---CharacterString - InternationalString ::= GeneralString - -- When version 2 is in force, this collapses to VisibleString. That is, only characters in the - -- visibleString repertoire may be used. (Datatype compatibility with version 2 is not affected, - -- because references are IMPLICIT.) When version 3 is in force, the semantics of the - -- GeneralString content may be altered by negotiation during initialization. If no such - -- negotiation is in effect, then GeneralString semantics are in force. - -StringOrNumeric ::= CHOICE{ - string [1] IMPLICIT InternationalString, - numeric [2] IMPLICIT INTEGER} - -END -- IR DEFINITIONS - - - -DiagnosticFormatDiag1 -{Z39-50-diagnosticFormat diag-1 (2)} DEFINITIONS ::= -BEGIN -IMPORTS Term, Specification, AttributeList, SortElement, DatabaseName, -DefaultDiagFormat, InternationalString FROM Z39-50-APDU-1995; - - -DiagnosticFormat ::= SEQUENCE OF SEQUENCE{ - diagnostic [1] CHOICE{ - defaultDiagRec [1] IMPLICIT DefaultDiagFormat, - explicitDiagnostic [2] DiagFormat} OPTIONAL, - message [2] IMPLICIT InternationalString OPTIONAL} - - -DiagFormat ::= CHOICE{ - -tooMany [1000] IMPLICIT SEQUENCE{ - tooManyWhat [1] IMPLICIT INTEGER{ - argumentWords (1), - truncatedWords (2), - booleanOperators (3), - incompleteSubfields (4), - characters (5), - recordsRetrieved (6), - dataBasesSpecified (7), - resultSetsCreated (8), - indexTermsProcessed (9)}, - max [2] IMPLICIT INTEGER OPTIONAL}, - - - - - - - -badSpec [1001] IMPLICIT SEQUENCE{ -- element set name or specification - spec [1] IMPLICIT Specification, -- esn or element spec not supported - db [2] IMPLICIT DatabaseName OPTIONAL, - -- if db specified, above spec not supported for db; otherwise, - -- spec not supported period. - goodOnes [3] IMPLICIT SEQUENCE OF Specification OPTIONAL - -- target supplies ones that are supported - }, - - -dbUnavail [1002] IMPLICIT SEQUENCE{ -- database unavailable - db [1] IMPLICIT DatabaseName, - why [2] IMPLICIT SEQUENCE{ - reasonCode [1] IMPLICIT INTEGER{ - doesNotExist (0), - existsButUnavail (1), - locked (2), - accessDenied (3)} OPTIONAL, - message [2] IMPLICIT InternationalString OPTIONAL}}, - - -unSupOp [1003] IMPLICIT INTEGER{ -- unsupported operator - and (0), - or (1), - and-not (2), - prox (3)}, - - -attribute [1004] IMPLICIT SEQUENCE{ - -- Applies for unsupported attribute set, attribute type, - -- attribute value, or term (for a given attribute type or value). - - id [1] IMPLICIT OBJECT IDENTIFIER, - -- if only "id" occurs, then attribute set is not supported - type [2] IMPLICIT INTEGER OPTIONAL, - -- must occur if value occurs. - value [3] IMPLICIT INTEGER OPTIONAL, - -- if omitted, and Type occurs, then Type is what is unsupported - term [4] Term OPTIONAL - -- If occurs, term is illegal or not supported, for attribute value, - -- if value occurs; otherwise, for type. - }, - - -attCombo [1005] IMPLICIT SEQUENCE{ -- attribute combination not supported - unsupportedCombination [1] IMPLICIT AttributeList, - recommendedAlternatives [2] IMPLICIT SEQUENCE OF AttributeList OPTIONAL}, - - - - -term [1006] IMPLICIT SEQUENCE{ - problem [1] IMPLICIT INTEGER{ - codedValue (1), - unparsable (2), - tooShort (3), - type (4)} OPTIONAL, - term [2] Term}, - - -proximity [1007] CHOICE{ -- proximity diagnostics: - resultSets [1] IMPLICIT NULL, -- proximity between sets not supported - badSet [2] IMPLICIT InternationalString, -- bad result set specified - relation [3] IMPLICIT INTEGER, -- 1 to 6 ; relation not supported - unit [4] IMPLICIT INTEGER, -- unsupported unit code - distance [5] IMPLICIT INTEGER, -- unsupported distance - attributes [6] AttributeList, -- proximity not supported with specified - -- attribute combination - ordered [7] IMPLICIT NULL, -- ordered flag not supported - exclusion [8] IMPLICIT NULL -- exclusion flag not supported - }, - - - - - -scan [1008] CHOICE{ -- scan diagnostics: - nonZeroStepSize [0] IMPLICIT NULL, -- only zero step size supported - specifiedStepSize [1] IMPLICIT NULL, -- specified step size not supported - termList1 [3] IMPLICIT NULL, -- term list not supported (no alternative supplied) - termList2 [4] IMPLICIT SEQUENCE OF AttributeList, - -- term list not supported (alternatives supplied) - posInResponse [5] IMPLICIT INTEGER{ --value of positionInResponse not supported - mustBeOne (1), - mustBePositive (2), - mustBeNonNegative (3), - other (4)}, - resources [6] IMPLICIT NULL, -- resources exhausted looking for satisfying terms - endOfList [7] IMPLICIT NULL -- beginning or end of term list - }, - - -sort [1009] CHOICE{ - sequence [0] IMPLICIT NULL, -- cannot sort according to sequence - noRsName [1] IMPLICIT NULL, -- no result set name supplied - tooMany [2] IMPLICIT INTEGER, -- Too many input result sets, - -- maximum supplied. - incompatible [3] IMPLICIT NULL, -- records with different formats - -- not compatible for sorting - generic [4] IMPLICIT NULL, -- generic sort not supported - -- (db specific only) - dbSpecific [5] IMPLICIT NULL, -- db specific sort not supported - sortElement [6] SortElement, - key [7] IMPLICIT INTEGER{ - tooMany (1), -- too many sort keys - duplicate (2)}, -- duplicate sort keys - action [8] IMPLICIT NULL, -- unsupported missing data action - illegal [9] IMPLICIT INTEGER{ - relation (1), -- illegal sort relation - case (2), -- illegal case value - action (3), -- illegal missing data action - sort (4)}, -- illegal sort - inputTooLarge [10] IMPLICIT SEQUENCE OF InternationalString, - -- one or more of the input result sets too large to sort - aggregateTooLarge [11] IMPLICIT NULL -- aggregate result set too large - }, - -segmentation [1010] CHOICE{ - segmentCount [0] IMPLICIT NULL, - -- Cannot guarantee record will fit within max segments. Target - -- suggests that origin try again to retrieve record, without - -- including max-segment-count. - segmentSize [1] IMPLICIT INTEGER - -- record cannot be segmented into fragments such that the largest - -- will fit within max segment size specified. Target supplies (in - -- bytes) the smallest acceptable value of Max-segment-size to - -- retrieve the record. - }, - - -extServices [1011] CHOICE{ - req [1] IMPLICIT INTEGER{ -- bad request - nameInUse (1), -- package name already in use - noSuchName (2), -- no such package, on modify/delete - quota (3), -- quota exceeded - type (4)}, -- extended service type not supported - permission [2] IMPLICIT INTEGER{ -- permission denied on ES, because: - id (1), -- id not authorized, or - modifyDelete (2)}, -- cannot modify or delete - immediate [3] IMPLICIT INTEGER{ -- immediate execution: - failed (1), -- failed, - service (2), -- not supported for this service, or - parameters (3) -- for these parameters. - }}, - - -accessCtrl [1012] CHOICE{ - noUser [1] IMPLICIT NULL, -- no user to display challenge to - refused [2] IMPLICIT NULL, -- access control information refused by user - simple [3] IMPLICIT NULL, -- only simple form supported (target used - -- externally defined) - oid [4] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, - -- oid not supported (origin supplies alternative - -- suggested oids) - alternative [5] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER, - -- origin insists that target use an alternative - -- challenge for this data (e.g. stronger - - -- authentication or stronger Access control). The - -- origin supplies suggested alternative oids. - pwdInv [6] IMPLICIT NULL, -- password invalid - pwdExp [7] IMPLICIT NULL -- password expired - }, - - -recordSyntax [1013] IMPLICIT SEQUENCE{ -- record cannot be transferred in requested syntax - unsupportedSyntax [1] IMPLICIT OBJECT IDENTIFIER, - suggestedAlternatives [2] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL} -} - -END - - - - - -RecordSyntax-explain -{Z39-50-recordSyntax explain (100)} DEFINITIONS ::= - -BEGIN -IMPORTS AttributeSetId, Term, OtherInformation, DatabaseName, ElementSetName, IntUnit, Unit, - StringOrNumeric, Specification, InternationalString, AttributeList, AttributeElement FROM Z39-50-APDU-1995; -EXPORTS LanguageCode; - -Explain-Record ::= CHOICE{ - -- Each of these may be used as search term when Use attribute is 'explain-category'. - targetInfo [0] IMPLICIT TargetInfo, - databaseInfo [1] IMPLICIT DatabaseInfo, - schemaInfo [2] IMPLICIT SchemaInfo, - tagSetInfo [3] IMPLICIT TagSetInfo, - recordSyntaxInfo [4] IMPLICIT RecordSyntaxInfo, - attributeSetInfo [5] IMPLICIT AttributeSetInfo, - termListInfo [6] IMPLICIT TermListInfo, - extendedServicesInfo [7] IMPLICIT ExtendedServicesInfo, - attributeDetails [8] IMPLICIT AttributeDetails, - termListDetails [9] IMPLICIT TermListDetails, - elementSetDetails [10] IMPLICIT ElementSetDetails, - retrievalRecordDetails [11] IMPLICIT RetrievalRecordDetails, - sortDetails [12] IMPLICIT SortDetails, - processing [13] IMPLICIT ProcessingInformation, - variants [14] IMPLICIT VariantSetInfo, - units [15] IMPLICIT UnitInfo, - categoryList [100] IMPLICIT CategoryList} - --- Element set name 'B' (brief) retrieves: --- - 'commonInfo' (except for otherInfo within commonInfo) --- - key elements --- - other elements designated as 'non-key brief elements' --- Esn 'description' retrieves brief elements as well as 'description', and specific additional descriptive --- elements if designated. --- Element set name 'F' (full) retrieves all of the above, as well as those designated as "non-brief elements". Some --- elements designated as OPTIONAL may be mandatory in full records, and are so identified. (Note that all elements --- that are not part of the brief element set must be designated as OPTIONAL in the ASN.1, otherwise it would be --- illegal to omit them.) --- Other esns are defined (below) as needed. - --- - - - - - - - - - - - - Info Records - -- Info records are mainly for software consumption - -- They describe individual entities within the target system: - -- The target itself - -- Individual databases - -- Schemas - -- Tag sets - -- Record syntaxes - -- Attribute sets - -- Term lists - -- Extended services - -- The information about each Schema, Tag Set, Record Syntax and Attribute Set should - -- match the universal definitions of these items. The only exception is that a target may omit any - -- items it doesn't support, for example the description of the bib-1 attribute set may omit attributes - -- that the target does not support under any circumstances. - -- Databases that may be searched together can be listed in the dbCominations element of the TargetInfo record. -TargetInfo ::= SEQUENCE { - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - name [1] IMPLICIT InternationalString, - -- Non-key brief elements follow: - recent-news [2] IMPLICIT HumanString OPTIONAL, - icon [3] IMPLICIT IconObject OPTIONAL, - namedResultSets [4] IMPLICIT BOOLEAN, - multipleDBsearch [5] IMPLICIT BOOLEAN, - maxResultSets [6] IMPLICIT INTEGER OPTIONAL, - maxResultSize [7] IMPLICIT INTEGER OPTIONAL, - maxTerms [8] IMPLICIT INTEGER OPTIONAL, - timeoutInterval [9] IMPLICIT IntUnit OPTIONAL, - welcomeMessage [10] IMPLICIT HumanString OPTIONAL, - -- non-brief elements follow: - -- 'description' esn retrieves the following two (as well as brief): - contactInfo [11] IMPLICIT ContactInfo OPTIONAL, - description [12] IMPLICIT HumanString OPTIONAL, - nicknames [13] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, - usage-restrictions [14] IMPLICIT HumanString OPTIONAL, - paymentAddr [15] IMPLICIT HumanString OPTIONAL, - hours [16] IMPLICIT HumanString OPTIONAL, - dbCombinations [17] IMPLICIT SEQUENCE OF DatabaseList OPTIONAL, - addresses [18] IMPLICIT SEQUENCE OF NetworkAddress OPTIONAL, - languages [101] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, - -- Languages supported for message strings. Each is a three-character - -- language code from Z39.53-1994. --- characterSets [102] this tag reserved for "character sets supported for name and message strings". - -- commonAccessInfo elements list objects the target supports. All objects listed in - -- AccessInfo for any individual database should also be listed here. - commonAccessInfo [19] IMPLICIT AccessInfo OPTIONAL} - - -DatabaseInfo ::= SEQUENCE { - -- A target may provide "virtual databases" that are combinations of individual database. These - -- databases are indicated by the presence of subDbs in the combination database's DatabaseDescription. - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - name [1] IMPLICIT DatabaseName, - -- Non-key brief elements follow: - explainDatabase [2] IMPLICIT NULL OPTIONAL, - -- If present, this database is the Explain database, or an Explain database - -- for a different server, possibly on a different host. The means by which - -- that server may be accessed is not addressed by this standard. One - -- suggested possibility is an implementor agreement whereby the - -- database name is a url which may be used to connect to the server. - nicknames [3] IMPLICIT SEQUENCE OF DatabaseName OPTIONAL, - icon [4] IMPLICIT IconObject OPTIONAL, - user-fee [5] IMPLICIT BOOLEAN, - available [6] IMPLICIT BOOLEAN, - titleString [7] IMPLICIT HumanString OPTIONAL, - -- Non-brief elements follow: - keywords [8] IMPLICIT SEQUENCE OF HumanString OPTIONAL, - description [9] IMPLICIT HumanString OPTIONAL, - associatedDbs [10] IMPLICIT DatabaseList OPTIONAL, - -- databases that may be searched in combination with this one - - subDbs [11] IMPLICIT DatabaseList OPTIONAL, - -- When present, this database is a composite representing the combined - -- databases 'subDbs'. The individual subDbs are also available. - disclaimers [12] IMPLICIT HumanString OPTIONAL, - news [13] IMPLICIT HumanString OPTIONAL, - recordCount [14] CHOICE { - actualNumber [0] IMPLICIT INTEGER, - approxNumber [1] IMPLICIT INTEGER} OPTIONAL, - defaultOrder [15] IMPLICIT HumanString OPTIONAL, - avRecordSize [16] IMPLICIT INTEGER OPTIONAL, - maxRecordSize [17] IMPLICIT INTEGER OPTIONAL, - hours [18] IMPLICIT HumanString OPTIONAL, - bestTime [19] IMPLICIT HumanString OPTIONAL, - lastUpdate [20] IMPLICIT GeneralizedTime OPTIONAL, - updateInterval [21] IMPLICIT IntUnit OPTIONAL, - coverage [22] IMPLICIT HumanString OPTIONAL, - proprietary [23] IMPLICIT BOOLEAN OPTIONAL, -- mandatory in full record - copyrightText [24] IMPLICIT HumanString OPTIONAL, - copyrightNotice [25] IMPLICIT HumanString OPTIONAL, - producerContactInfo [26] IMPLICIT ContactInfo OPTIONAL, - supplierContactInfo [27] IMPLICIT ContactInfo OPTIONAL, - submissionContactInfo [28] IMPLICIT ContactInfo OPTIONAL, - -- accessInfo lists items connected with the database. All listed items should be in the target's AccessInfo. - accessInfo [29] IMPLICIT AccessInfo OPTIONAL} - - -SchemaInfo ::= SEQUENCE { - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - schema [1] IMPLICIT OBJECT IDENTIFIER, - -- Non-key brief elements follow: - name [2] IMPLICIT InternationalString, - -- Non-brief elements follow: - description [3] IMPLICIT HumanString OPTIONAL, - tagTypeMapping [4] IMPLICIT SEQUENCE OF SEQUENCE { - tagType [0] IMPLICIT INTEGER, - tagSet [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL, - -- If tagSet is omitted, then this tagType is for a tagSet locally defined - -- within the schema that cannot be referenced by another schema. - defaultTagType [2] IMPLICIT NULL OPTIONAL - } OPTIONAL, - recordStructure [5] IMPLICIT SEQUENCE OF ElementInfo OPTIONAL} - - - -- ElementInfo referenced in SchemaInfo and RecordSyntaxInfo - ElementInfo ::= SEQUENCE { - elementName [1] IMPLICIT InternationalString, - elementTagPath [2] IMPLICIT Path, - dataType [3] ElementDataType OPTIONAL, -- If omitted, not specified. - required [4] IMPLICIT BOOLEAN, - repeatable [5] IMPLICIT BOOLEAN, - description [6] IMPLICIT HumanString OPTIONAL} - - - -- Path is referenced by ElementInfo as well as PerElementDetails - Path ::= SEQUENCE OF SEQUENCE{ - tagType [1] IMPLICIT INTEGER, - tagValue [2] StringOrNumeric} - ElementDataType ::= CHOICE{ - primitive [0] IMPLICIT PrimitiveDataType, - structured [1] IMPLICIT SEQUENCE OF ElementInfo} - PrimitiveDataType ::= INTEGER{ - octetString (0), - numeric (1), - date (2), - external (3), - string (4), - trueOrFalse (5), - oid (6), - intUnit (7), - empty (8), - noneOfTheAbove (100) -- see 'description' - } - - -TagSetInfo ::= SEQUENCE { - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - tagSet [1] IMPLICIT OBJECT IDENTIFIER, - -- non-key brief elements follow: - name [2] IMPLICIT InternationalString, - -- non-brief elements follow: - description [3] IMPLICIT HumanString OPTIONAL, - elements [4] IMPLICIT SEQUENCE OF SEQUENCE { - elementname [1] IMPLICIT InternationalString, - nicknames [2] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, - elementTag [3] StringOrNumeric, - description [4] IMPLICIT HumanString OPTIONAL, - dataType [5] PrimitiveDataType OPTIONAL, - -- If the data type is expected to be structured, that is described in the schema info, - -- and datatype is omitted here. - otherTagInfo OtherInformation OPTIONAL} OPTIONAL} - -RecordSyntaxInfo ::= SEQUENCE { - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - recordSyntax [1] IMPLICIT OBJECT IDENTIFIER, - -- Non-key brief elements follow: - name [2] IMPLICIT InternationalString, - -- non-brief elements follow: - transferSyntaxes [3] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, - description [4] IMPLICIT HumanString OPTIONAL, - asn1Module [5] IMPLICIT InternationalString OPTIONAL, - abstractStructure [6] IMPLICIT SEQUENCE OF ElementInfo OPTIONAL - -- Omitting abstractStructure only means target isn't using - -- Explain to describe the structure, not that there is no structure. - } - -AttributeSetInfo ::= SEQUENCE { - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - attributeSet [1] IMPLICIT AttributeSetId, - -- non-key brief elements follow: - name [2] IMPLICIT InternationalString, - -- non-brief elements follow: - attributes [3] IMPLICIT SEQUENCE OF AttributeType OPTIONAL, - -- mandatory in full record - description [4] IMPLICIT HumanString OPTIONAL} --- AttributeType referenced in AttributeSetInfo - AttributeType ::= SEQUENCE { - name [0] IMPLICIT InternationalString OPTIONAL, - description [1] IMPLICIT HumanString OPTIONAL, - attributeType [2] IMPLICIT INTEGER, - attributeValues [3] IMPLICIT SEQUENCE OF AttributeDescription} - AttributeDescription ::= SEQUENCE { - name [0] IMPLICIT InternationalString OPTIONAL, - description [1] IMPLICIT HumanString OPTIONAL, - attributeValue [2] StringOrNumeric, - equivalentAttributes [3] IMPLICIT SEQUENCE OF StringOrNumeric OPTIONAL - -- each is an occurrence of 'attributeValue' from AttributeDescription for a - -- different attribute. Equivalences listed here should be derived from the - -- attribute set definition, not from a particular server's behavior. - } - - -TermListInfo ::= SEQUENCE{ - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - databaseName [1] IMPLICIT DatabaseName, - -- Non-key brief elements follow: - termLists [2] IMPLICIT SEQUENCE OF SEQUENCE{ - name [1] IMPLICIT InternationalString, - title [2] IMPLICIT HumanString OPTIONAL, - -- Title is for users to see and can differ by language. Name, on the - -- other hand is typically a short string not necessarily meant to be - -- human-readable, and not variable by language. - searchCost [3] IMPLICIT INTEGER { - optimized (0), -- The attribute (or combination) associated - -- with this list will do fast searches. - normal (1), -- The attribute (combination) will work as - -- expected. So there's probably an index for the - -- attribute (combination) or some similar - -- mechanism. - expensive (2), -- Can use the attribute (combination), but it - -- might not provide satisfactory results. - -- Probably there is no index, or post- - -- processing of records is required. - filter (3) -- can't search with this attribute (combination) alone. - } OPTIONAL, - scanable [4] IMPLICIT BOOLEAN, -- 'true' means this list can be scanned. - broader [5] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, - narrower [6] IMPLICIT SEQUENCE OF InternationalString OPTIONAL - -- broader and narrower list alternative term lists related to this one. - -- The term lists so listed should also be in this termLists structure. - } - -- no non-brief elements - } - - -ExtendedServicesInfo ::= SEQUENCE { - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - type [1] IMPLICIT OBJECT IDENTIFIER, - -- Non-key brief elements follow: - name [2] IMPLICIT InternationalString OPTIONAL, - -- should be supplied if privateType is 'true' - privateType [3] IMPLICIT BOOLEAN, - restrictionsApply [5] IMPLICIT BOOLEAN, -- if 'true' see 'description' - feeApply [6] IMPLICIT BOOLEAN, -- if 'true' see 'description' - available [7] IMPLICIT BOOLEAN, - retentionSupported [8] IMPLICIT BOOLEAN, - waitAction [9] IMPLICIT INTEGER{ - waitSupported (1), - waitAlways (2), - waitNotSupported (3), - depends (4), - notSaying (5)}, - -- non-brief elements follow: - -- To get brief plus 'description' use esn 'description' - description [10] IMPLICIT HumanString OPTIONAL, - -- to get above elements and 'specificExplain' use esn 'specificExplain' - specificExplain [11] IMPLICIT EXTERNAL OPTIONAL, - -- Use oid of specific ES, and select choice [3] 'explain'. Format - -- to be developed in conjunction with the specific ES definition. - -- to get all elements except 'specificExplain', use esn 'asn' - esASN [12] IMPLICIT InternationalString OPTIONAL -- the ASN.1 for this ES - } - --- - - - - - - - - - - - - Detail records - -- The detail records describe relationships among entities supported by the target. RetrievalRecordDetails describes - -- the way that schema elements are mapped into record elements. This mapping may be different for each - -- combination of database, schema, record syntax. The per-element details describe the default mapping. - -- Origin-request re-tagging can change that mapping. When multiple databases are listed in a databaseNames - -- element, the record applies equally to all of the listed databases. This is unrelated to searching the databases - -- together. AttributeDetails describes how databases can be searched. Each supported attribute is listed, and the - -- allowable combinations can be described. - - -AttributeDetails ::= SEQUENCE { - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - databaseName [1] IMPLICIT DatabaseName, - -- Non-brief elements follow: - attributesBySet [2] IMPLICIT SEQUENCE OF AttributeSetDetails OPTIONAL, - -- mandatory in full record - attributeCombinations [3] IMPLICIT AttributeCombinations OPTIONAL} - - - - --- AttributeSetDetails referenced by AttributeDetails - AttributeSetDetails ::= SEQUENCE { - attributeSet [0] IMPLICIT AttributeSetId, - attributesByType [1] IMPLICIT SEQUENCE OF AttributeTypeDetails } - AttributeTypeDetails ::= SEQUENCE { - attributeType [0] IMPLICIT INTEGER, - defaultIfOmitted [1] IMPLICIT OmittedAttributeInterpretation OPTIONAL, - attributeValues [2] IMPLICIT SEQUENCE OF AttributeValue OPTIONAL } - -- If no attributeValues are supplied, all values of this type are fully - -- supported, and the descriptions in AttributeSetInfo are adequate. - - OmittedAttributeInterpretation ::= SEQUENCE { - defaultValue [0] StringOrNumeric OPTIONAL, - -- A default value is listed if that's how the server works - defaultDescription [1] IMPLICIT HumanString OPTIONAL } - -- The human-readable description should generally be provided. - -- It is legal for both default elements to be missing, which - -- means that the target will allow the attribute type to be - -- omitted, but isn't saying what it will do. - - AttributeValue ::= SEQUENCE { - value [0] StringOrNumeric, - description [1] IMPLICIT HumanString OPTIONAL, - subAttributes [2] IMPLICIT SEQUENCE OF StringOrNumeric OPTIONAL, - superAttributes [3] IMPLICIT SEQUENCE OF StringOrNumeric OPTIONAL, - partialSupport [4] IMPLICIT NULL OPTIONAL } - -- partialSupport indicates that an attributeValue is accepted, but may not be processed in the - -- "expected" way. One important reason for this is composite databases: in this case partialSupport - -- may indicate that only some of the subDbs support the attribute, and others ignore it. - - - -TermListDetails ::= SEQUENCE{ -- one for each termList in TermListInfo - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - termListName [1] IMPLICIT InternationalString, - -- Non-key elements (all non-brief) follow: - description [2] IMPLICIT HumanString OPTIONAL, - attributes [3] IMPLICIT AttributeCombinations OPTIONAL, - -- Pattern for attributes that hit this list. Mandatory in full record - scanInfo [4] IMPLICIT SEQUENCE { - maxStepSize [0] IMPLICIT INTEGER OPTIONAL, - collatingSequence [1] IMPLICIT HumanString OPTIONAL, - increasing [2] IMPLICIT BOOLEAN OPTIONAL} OPTIONAL, - -- Occurs only if list is scanable. If list is scanable and if scanInfo is omitted, - -- target doesn't consider these important. - estNumberTerms [5] IMPLICIT INTEGER OPTIONAL, - sampleTerms [6] IMPLICIT SEQUENCE OF Term OPTIONAL} - - - -ElementSetDetails ::= SEQUENCE { - -- ElementSetDetails describes the way that database records are mapped to record elements. This - -- mapping may be different for each combination of database name and element set. The database record - -- description is a schema, which may be private to the target. The schema's abstract record structure - -- and tag sets provide the vocabulary for discussing record content; their presence in the Explain - -- database does not imply support for complex retrieval specification. - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - databaseName [1] IMPLICIT DatabaseName, - elementSetName [2] IMPLICIT ElementSetName, - recordSyntax [3] IMPLICIT OBJECT IDENTIFIER, - -- Non-key Brief elements follow: - schema [4] IMPLICIT OBJECT IDENTIFIER, - -- Non-brief elements follow: - description [5] IMPLICIT HumanString OPTIONAL, - detailsPerElement [6] IMPLICIT SEQUENCE OF PerElementDetails OPTIONAL -- mandatory in full record - } - - -RetrievalRecordDetails ::= SEQUENCE { - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - databaseName [1] IMPLICIT DatabaseName, - schema [2] IMPLICIT OBJECT IDENTIFIER, - recordSyntax [3] IMPLICIT OBJECT IDENTIFIER, - -- Non-brief elements follow: - description [4] IMPLICIT HumanString OPTIONAL, - detailsPerElement [5] IMPLICIT SEQUENCE OF PerElementDetails OPTIONAL - -- mandatory in full record - } - --- PerElementDetails is referenced in RetrievalRecordDetails and ElementSetDetails. - PerElementDetails ::= SEQUENCE { - name [0] IMPLICIT InternationalString OPTIONAL, - -- If the name is omitted, the record syntax's name for this element - -- is appropriate. - recordTag [1] IMPLICIT RecordTag OPTIONAL, - -- The record tag may be omitted if tags are inappropriate for the record - -- syntax, or if the origin can be expected to know it for some other reason. - schemaTags [2] IMPLICIT SEQUENCE OF Path OPTIONAL, - -- The information from the listed schema elements is combined - -- in some way to produce the data sent in the listed record tag. The - -- 'contents' element below may describe the logic used. - maxSize [3] IMPLICIT INTEGER OPTIONAL, - minSize [4] IMPLICIT INTEGER OPTIONAL, - avgSize [5] IMPLICIT INTEGER OPTIONAL, - fixedSize [6] IMPLICIT INTEGER OPTIONAL, - repeatable [8] IMPLICIT BOOLEAN, - required [9] IMPLICIT BOOLEAN, - -- 'required' really means that target will always supply the element. - description [12] IMPLICIT HumanString OPTIONAL, - contents [13] IMPLICIT HumanString OPTIONAL, - billingInfo [14] IMPLICIT HumanString OPTIONAL, - restrictions [15] IMPLICIT HumanString OPTIONAL, - alternateNames [16] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, - genericNames [17] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, - searchAccess [18] IMPLICIT AttributeCombinations OPTIONAL } - -- RecordTag referenced in PerElementDetails above - RecordTag ::= SEQUENCE { - qualifier [0] StringOrNumeric OPTIONAL, - -- E.g. tag set for GRS-1 - tagValue [1] StringOrNumeric} - -SortDetails ::= SEQUENCE { - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - databaseName [1] IMPLICIT DatabaseName, - -- No non-key brief elements - -- Non-brief elements follow: - sortKeys [2] IMPLICIT SEQUENCE OF SortKeyDetails OPTIONAL - -- mandatory in full record - } - SortKeyDetails ::= SEQUENCE { - description [0] IMPLICIT HumanString OPTIONAL, - elementSpecifications [1] IMPLICIT SEQUENCE OF Specification OPTIONAL, - -- each specification is a way of specifying this same sort key - attributeSpecifications [2] IMPLICIT AttributeCombinations OPTIONAL, - -- each combination is a way of specifying this same sort key - sortType [3] CHOICE { - character [0] IMPLICIT NULL, - numeric [1] IMPLICIT NULL, - structured [2] IMPLICIT HumanString} OPTIONAL, - caseSensitivity [4] IMPLICIT INTEGER { - always (0), -- always case-sensitive - never (1), -- never case-sensitive - default-yes (2), -- case-sensitivity is as specified on request, and if not - -- specified, case-sensitive. - default-no (3)} -- case-sensitivity is as specified on request, and if not - -- specified, not case-sensitive. - OPTIONAL} - -ProcessingInformation ::= SEQUENCE{ - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - databaseName [1] IMPLICIT DatabaseName, - processingContext [2] IMPLICIT INTEGER { - access (0), -- e.g. choosing databases - search (1), -- e.g. "search strategies" or search forms - retrieval (2), -- e.g. recommended element combinations - record-presentation (3), -- display of retrieved records - record-handling (4) -- handling (e.g. saving) of retrieved records - }, - name [3] IMPLICIT InternationalString, - oid [4] IMPLICIT OBJECT IDENTIFIER, - -- No non-key brief elements - -- Non-brief elements follow: - description [5] IMPLICIT HumanString OPTIONAL, - -- use element set name 'description' to retrieve all except instructions. - instructions [6] IMPLICIT EXTERNAL OPTIONAL -- mandatory in full record - } - - -VariantSetInfo ::= SEQUENCE { - -- A record in this category describes a variant set definition, i.e., classes, types, and values, for a specific - -- variant set definition supported by the target. Support by the target of a particular variant set definition - -- does not imply that the definition is supported for any specific database or element. - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - variantSet [1] IMPLICIT OBJECT IDENTIFIER, - -- Non-key brief elements follow: - name [2] IMPLICIT InternationalString, - -- Non-brief elements follow: - variants [3] IMPLICIT SEQUENCE OF VariantClass OPTIONAL - -- mandatory in full record - } - - -- Subsidiary structures for VariantSetInfo - VariantClass ::= SEQUENCE { - name [0] IMPLICIT InternationalString OPTIONAL, - description [1] IMPLICIT HumanString OPTIONAL, - variantClass [2] IMPLICIT INTEGER, - variantTypes [3] IMPLICIT SEQUENCE OF VariantType} - VariantType ::= SEQUENCE { - name [0] IMPLICIT InternationalString OPTIONAL, - description [1] IMPLICIT HumanString OPTIONAL, - variantType [2] IMPLICIT INTEGER, - variantValue [3] IMPLICIT VariantValue OPTIONAL} - VariantValue ::= SEQUENCE { - dataType [0] PrimitiveDataType, - values [1] ValueSet OPTIONAL } - ValueSet ::= CHOICE { - range [0] IMPLICIT ValueRange, - enumerated [1] IMPLICIT SEQUENCE OF ValueDescription } - ValueRange ::= SEQUENCE { - -- At last one the following must be supplied, both may be supplied. - lower [0] ValueDescription OPTIONAL, - upper [1] ValueDescription OPTIONAL } - ValueDescription ::= CHOICE{ - integer INTEGER, - string InternationalString, - octets OCTET STRING, - oid OBJECT IDENTIFIER, - unit [1] IMPLICIT Unit, - valueAndUnit [2] IMPLICIT IntUnit - -- oid and unit can't be used in a ValueRange - } - - - -UnitInfo ::= SEQUENCE { - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Key elements follow: - unitSystem [1] IMPLICIT InternationalString, - -- No non-key brief elements - -- Non-brief elements follow: - description [2] IMPLICIT HumanString OPTIONAL, - units [3] IMPLICIT SEQUENCE OF UnitType OPTIONAL - -- mandatory in full record - } - - -- Subsidiary structures for UnitInfo - UnitType ::= SEQUENCE { - name [0] IMPLICIT InternationalString OPTIONAL, - description [1] IMPLICIT HumanString OPTIONAL, - unitType [2] StringOrNumeric, - units [3] IMPLICIT SEQUENCE OF Units} - - Units ::= SEQUENCE { - name [0] IMPLICIT InternationalString OPTIONAL, - description [1] IMPLICIT HumanString OPTIONAL, - unit [2] StringOrNumeric} - -CategoryList ::= SEQUENCE { - commonInfo [0] IMPLICIT CommonInfo OPTIONAL, - -- Only one record expected per Explain database. All elements appear in brief presentation. - categories [1] IMPLICIT SEQUENCE OF CategoryInfo } - CategoryInfo ::= SEQUENCE { - category [1] IMPLICIT InternationalString, - originalCategory [2] IMPLICIT InternationalString OPTIONAL, - description [3] IMPLICIT HumanString OPTIONAL, - asn1Module [4] IMPLICIT InternationalString OPTIONAL} - - --- - - - - - - - - - - - - - Subsidiary definitions - -CommonInfo ::= SEQUENCE { - dateAdded [0] IMPLICIT GeneralizedTime OPTIONAL, - dateChanged [1] IMPLICIT GeneralizedTime OPTIONAL, - expiry [2] IMPLICIT GeneralizedTime OPTIONAL, - humanString-Language [3] IMPLICIT LanguageCode OPTIONAL, - -- following not to occur for brief: - otherInfo OtherInformation OPTIONAL} - - -HumanString ::= SEQUENCE OF SEQUENCE { - language [0] IMPLICIT LanguageCode OPTIONAL, - text [1] IMPLICIT InternationalString} - -IconObject ::= SEQUENCE OF SEQUENCE{ - -- Note that the "SEQUENCE OF" is to allow alternative representations of the same Icon; it is not - -- intended to allow multiple icons. - bodyType [1] CHOICE{ - ianaType [1] IMPLICIT InternationalString, - z3950type [2] IMPLICIT InternationalString, - otherType [3] IMPLICIT InternationalString}, - content [2] IMPLICIT OCTET STRING} - - -LanguageCode ::= InternationalString -- from ANSI/NISO Z39.53-1994 - -ContactInfo ::= SEQUENCE { - name [0] IMPLICIT InternationalString OPTIONAL, - description [1] IMPLICIT HumanString OPTIONAL, - address [2] IMPLICIT HumanString OPTIONAL, - email [3] IMPLICIT InternationalString OPTIONAL, - phone [4] IMPLICIT InternationalString OPTIONAL} - -NetworkAddress ::= CHOICE { - internetAddress [0] IMPLICIT SEQUENCE { - hostAddress [0] IMPLICIT InternationalString, - port [1] IMPLICIT INTEGER}, - osiPresentationAddress [1] IMPLICIT SEQUENCE { - pSel [0] IMPLICIT InternationalString, - sSel [1] IMPLICIT InternationalString OPTIONAL, - tSel [2] IMPLICIT InternationalString OPTIONAL, - nSap [3] IMPLICIT InternationalString}, - other [2] IMPLICIT SEQUENCE { - type [0] IMPLICIT InternationalString, - address [1] IMPLICIT InternationalString}} - -AccessInfo ::= SEQUENCE { - -- AccessInfo contains the fundamental information about what facilities are required to use this target - -- or server. For example, if an origin can handle none of the record syntaxes a database can provide, - -- it might choose not to access the database. - queryTypesSupported [0] IMPLICIT SEQUENCE OF QueryTypeDetails OPTIONAL, - diagnosticsSets [1] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, - attributeSetIds [2] IMPLICIT SEQUENCE OF AttributeSetId OPTIONAL, - schemas [3] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, - recordSyntaxes [4] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, - resourceChallenges [5] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, - restrictedAccess [6] IMPLICIT AccessRestrictions OPTIONAL, - costInfo [8] IMPLICIT Costs OPTIONAL, - variantSets [9] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, - elementSetNames [10] IMPLICIT SEQUENCE OF ElementSetName OPTIONAL, - unitSystems [11] IMPLICIT SEQUENCE OF InternationalString} - --- begin auxiliary definitions for AccessInfo --- Begin Query Details -QueryTypeDetails ::= CHOICE { - private [0] IMPLICIT PrivateCapabilities, - rpn [1] IMPLICIT RpnCapabilities, - iso8777 [2] IMPLICIT Iso8777Capabilities, - z39-58 [100] IMPLICIT HumanString, - erpn [101] IMPLICIT RpnCapabilities, - rankedList [102] IMPLICIT HumanString} - -PrivateCapabilities ::= SEQUENCE { - operators [0] IMPLICIT SEQUENCE OF SEQUENCE { - operator [0] IMPLICIT InternationalString, - description [1] IMPLICIT HumanString OPTIONAL } OPTIONAL, - searchKeys [1] IMPLICIT SEQUENCE OF SearchKey OPTIONAL, -- field names that can be searched - description [2] IMPLICIT SEQUENCE OF HumanString OPTIONAL } - -RpnCapabilities ::= SEQUENCE { - operators [0] IMPLICIT SEQUENCE OF INTEGER OPTIONAL, - -- Omitted means all operators are supported. - resultSetAsOperandSupported [1] IMPLICIT BOOLEAN, - restrictionOperandSupported [2] IMPLICIT BOOLEAN, - proximity [3] IMPLICIT ProximitySupport OPTIONAL} - -Iso8777Capabilities ::= SEQUENCE { - searchKeys [0] IMPLICIT SEQUENCE OF SearchKey, -- field names that may be searched - restrictions [1] IMPLICIT HumanString OPTIONAL - -- Omitted means supported, not specifying units. - } - -ProximitySupport ::= SEQUENCE { - anySupport [0] IMPLICIT BOOLEAN, - -- 'false' means no proximity support, in which case unitsSupported not supplied. - unitsSupported [1] IMPLICIT SEQUENCE OF CHOICE{ - known [1] IMPLICIT INTEGER, -- values from KnownProximityUnit - private [2] IMPLICIT SEQUENCE{ - unit [0] IMPLICIT INTEGER, - description [1] HumanString OPTIONAL}} OPTIONAL} - -SearchKey ::= SEQUENCE { - searchKey [0] IMPLICIT InternationalString, - description [1] IMPLICIT HumanString OPTIONAL } --- End Query details -AccessRestrictions ::= SEQUENCE OF SEQUENCE { - accessType [0] INTEGER { - any (0), - search (1), - present (2), - specific-elements (3), - extended-services (4), - by-database (5)}, - accessText [1] IMPLICIT HumanString OPTIONAL, - accessChallenges [2] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER OPTIONAL} - -Costs ::= SEQUENCE { - connectCharge [0] IMPLICIT Charge OPTIONAL, -- Per-connection charge - connectTime [1] IMPLICIT Charge OPTIONAL, -- Time-based charge - displayCharge [2] IMPLICIT Charge OPTIONAL, -- Per-record charge - searchCharge [3] IMPLICIT Charge OPTIONAL, -- Per-search charge - subscriptCharge [4] IMPLICIT Charge OPTIONAL, -- Subscription charges - otherCharges [5] IMPLICIT SEQUENCE OF SEQUENCE{ -- Other charges - forWhat [1] IMPLICIT HumanString, - charge [2] IMPLICIT Charge} OPTIONAL} - Charge ::= SEQUENCE{ - cost [1] IMPLICIT IntUnit, - perWhat [2] IMPLICIT Unit OPTIONAL, - -- e.g. "second," "minute," "line," "record"... - text [3] IMPLICIT HumanString OPTIONAL} --- End Auxiliary definitions for AccessInfo - -DatabaseList ::= SEQUENCE OF DatabaseName - -AttributeCombinations ::= SEQUENCE { - defaultAttributeSet [0] IMPLICIT AttributeSetId, - -- Default for the combinations. Also probably a good choice for the default - -- in searches, but that isn't required. - legalCombinations [1] IMPLICIT SEQUENCE OF AttributeCombination } - - -AttributeCombination ::= SEQUENCE OF AttributeOccurrence - -- An AttributeCombination is a pattern for legal combination of attributes - - -AttributeOccurrence ::= SEQUENCE { - -- An AttributeOccurrence lists the legal values for a specific attribute type in a combination. - attributeSet [0] IMPLICIT AttributeSetId OPTIONAL, - attributeType [1] IMPLICIT INTEGER, - mustBeSupplied [2] IMPLICIT NULL OPTIONAL, - attributeValues CHOICE { - any-or-none [3] IMPLICIT NULL, -- All supported values are OK - specific [4] IMPLICIT SEQUENCE OF StringOrNumeric}} - -- Only these values allowed -END - - - - - - - - - -RecordSyntax-SUTRS -{Z39-50-recordSyntax SUTRS (101)} DEFINITIONS ::= -BEGIN -IMPORTS InternationalString FROM Z39-50-APDU-1995; - SutrsRecord ::= InternationalString --- Line terminator is ASCII LF (X'0A'). --- Recommended maximum line length is 72 characters. -END - - - - - -RecordSyntax-opac -{Z39-50-recordSyntax opac (102)} DEFINITIONS ::= -BEGIN -IMPORTS InternationalString FROM Z39-50-APDU-1995; -OPACRecord ::= SEQUENCE { - bibliographicRecord [1] IMPLICIT EXTERNAL OPTIONAL, - holdingsData [2] IMPLICIT SEQUENCE OF HoldingsRecord OPTIONAL} -HoldingsRecord ::= CHOICE { - marcHoldingsRecord [1] IMPLICIT EXTERNAL, - holdingsAndCirc [2] IMPLICIT HoldingsAndCircData} -HoldingsAndCircData ::= SEQUENCE { --- the following elements are required to display holdings in conformance with NISO standards. - typeOfRecord [1] IMPLICIT InternationalString OPTIONAL, -- LDR 06 - encodingLevel [2] IMPLICIT InternationalString OPTIONAL, -- LDR 017 - format [3] IMPLICIT InternationalString OPTIONAL, -- 007 00-01 - receiptAcqStatus [4] IMPLICIT InternationalString OPTIONAL, -- 008 06 - generalRetention [5] IMPLICIT InternationalString OPTIONAL, -- 008 12 - completeness [6] IMPLICIT InternationalString OPTIONAL, -- 008 16 - dateOfReport [7] IMPLICIT InternationalString OPTIONAL, -- 008 26-31 - nucCode [8] IMPLICIT InternationalString OPTIONAL, -- 852 $a - localLocation [9] IMPLICIT InternationalString OPTIONAL, -- 852 $b - shelvingLocation [10] IMPLICIT InternationalString OPTIONAL, -- 852 $c - callNumber [11] IMPLICIT InternationalString OPTIONAL, -- 852 $h and $i - shelvingData [12] IMPLICIT InternationalString OPTIONAL, -- 852 $j thru $m - copyNumber [13] IMPLICIT InternationalString OPTIONAL, -- 852 $t - publicNote [14] IMPLICIT InternationalString OPTIONAL, -- 852 $z - reproductionNote [15] IMPLICIT InternationalString OPTIONAL, -- 843 - termsUseRepro [16] IMPLICIT InternationalString OPTIONAL, -- 845 - enumAndChron [17] IMPLICIT InternationalString OPTIONAL, -- all 85x, 86x - volumes [18] IMPLICIT SEQUENCE OF Volume OPTIONAL, - -- repeats for each volume held - circulationData [19] IMPLICIT SEQUENCE OF CircRecord OPTIONAL - -- repeats for each circulating item. - } -Volume ::= SEQUENCE { - enumeration [1] IMPLICIT InternationalString OPTIONAL, - chronology [2] IMPLICIT InternationalString OPTIONAL, - enumAndChron [3] IMPLICIT InternationalString OPTIONAL } -CircRecord ::= SEQUENCE { - availableNow [1] IMPLICIT BOOLEAN, - availablityDate [2] IMPLICIT InternationalString OPTIONAL, - availableThru [3] IMPLICIT InternationalString OPTIONAL, - restrictions [4] IMPLICIT InternationalString OPTIONAL, - itemId [5] IMPLICIT InternationalString OPTIONAL, - renewable [6] IMPLICIT BOOLEAN, - onHold [7] IMPLICIT BOOLEAN, - enumAndChron [8] IMPLICIT InternationalString OPTIONAL, - midspine [9] IMPLICIT InternationalString OPTIONAL, - temporaryLocation [10] IMPLICIT InternationalString OPTIONAL} -END - - - -RecordSyntax-summary - -{Z39-50-recordSyntax summary (103)} DEFINITIONS ::= -BEGIN -IMPORTS OtherInformation, InternationalString FROM Z39-50-APDU-1995; -BriefBib ::= SEQUENCE { - title [1] IMPLICIT InternationalString, - author [2] IMPLICIT InternationalString OPTIONAL, - callNumber [3] IMPLICIT InternationalString OPTIONAL, - recordType [4] IMPLICIT InternationalString OPTIONAL, - bibliographicLevel [5] IMPLICIT InternationalString OPTIONAL, - format [6] IMPLICIT SEQUENCE OF FormatSpec OPTIONAL, - publicationPlace [7] IMPLICIT InternationalString OPTIONAL, - publicationDate [8] IMPLICIT InternationalString OPTIONAL, - targetSystemKey [9] IMPLICIT InternationalString OPTIONAL, - satisfyingElement [10] IMPLICIT InternationalString OPTIONAL, - rank [11] IMPLICIT INTEGER OPTIONAL, - documentId [12] IMPLICIT InternationalString OPTIONAL, - abstract [13] IMPLICIT InternationalString OPTIONAL, - otherInfo OtherInformation OPTIONAL} - -FormatSpec ::= SEQUENCE { - type [1] IMPLICIT InternationalString, - size [2] IMPLICIT INTEGER OPTIONAL, - bestPosn [3] IMPLICIT INTEGER OPTIONAL} -END - - - - - - - - - - -RecordSyntax-generic -- For detailed semantics, see Appendix RET. -{Z39-50-recordSyntax GRS-1 (105)} DEFINITIONS ::= -BEGIN -EXPORTS Variant; -IMPORTS IntUnit, Unit, InternationalString, StringOrNumeric, Term FROM Z39-50-APDU-1995; - -GenericRecord ::= SEQUENCE OF TaggedElement -TaggedElement ::= SEQUENCE { - tagType [1] IMPLICIT INTEGER OPTIONAL, - -- If omitted, default should be supplied dynamically by tagSet-M; - -- otherwise it should be statically specified by the schema. - tagValue [2] StringOrNumeric, - tagOccurrence [3] IMPLICIT INTEGER OPTIONAL, - -- Occurrence within the database record, and relative to the parent. No - -- default; if omitted, target not telling or it is irrelevant. - content [4] ElementData, - metaData [5] IMPLICIT ElementMetaData OPTIONAL, - appliedVariant [6] IMPLICIT Variant OPTIONAL} - -ElementData ::= CHOICE{ - octets OCTET STRING, - numeric INTEGER, - date GeneralizedTime, - ext EXTERNAL, - string InternationalString, - trueOrFalse BOOLEAN, - oid OBJECT IDENTIFIER, - intUnit [1] IMPLICIT IntUnit, - elementNotThere [2] IMPLICIT NULL, -- element requested but not there - elementEmpty [3] IMPLICIT NULL, -- element there, but empty - noDataRequested [4] IMPLICIT NULL, -- variant request said 'no data' - diagnostic [5] IMPLICIT EXTERNAL, - subtree [6] SEQUENCE OF TaggedElement -- recursive, for nested tags - } - - -ElementMetaData ::= SEQUENCE{ - seriesOrder [1] IMPLICIT Order OPTIONAL, -- only for a non-leaf node - usageRight [2] IMPLICIT Usage OPTIONAL, - hits [3] IMPLICIT SEQUENCE OF HitVector OPTIONAL, - displayName [4] IMPLICIT InternationalString OPTIONAL, - -- name for element that origin can use for display - supportedVariants [5] IMPLICIT SEQUENCE OF Variant OPTIONAL, - message [6] IMPLICIT InternationalString OPTIONAL, - elementDescriptor [7] IMPLICIT OCTET STRING OPTIONAL, - surrogateFor [8] IMPLICIT TagPath OPTIONAL, - -- the retrieved element is a surrogate for the element given by this path - surrogateElement [9] IMPLICIT TagPath OPTIONAL, - -- the element given by this path is a surrogate for the retrieved element - other [99] IMPLICIT EXTERNAL OPTIONAL} - - TagPath ::= SEQUENCE OF SEQUENCE{ - tagType [1] IMPLICIT INTEGER OPTIONAL, - tagValue [2] StringOrNumeric, - tagOccurrence [3] IMPLICIT INTEGER OPTIONAL} - - - -Order ::= SEQUENCE{ - ascending [1] IMPLICIT BOOLEAN, - -- "true" means monotonically increasing (i.e. non-decreasing); - -- "false" means monotonically decreasing (i.e. non-increasing). - order [2] IMPLICIT INTEGER - -- Same as defined by 'elementOrdering' in tagSet-M, though this may be - -- overridden by schema. - } - - - -Usage ::= SEQUENCE { - type [1] IMPLICIT INTEGER{ - redistributable (1), -- Element is freely redistributable. - restricted (2), -- Restriction contains statement. - licensePointer (3) -- Restriction contains license pointer. - }, - restriction [2] IMPLICIT InternationalString OPTIONAL} - - - -HitVector ::= SEQUENCE{ - -- Each hit vector points to a fragment within the element, via location and/or token. - satisfier Term OPTIONAL, -- sourceword, etc. - offsetIntoElement [1] IMPLICIT IntUnit OPTIONAL, - length [2] IMPLICIT IntUnit OPTIONAL, - hitRank [3] IMPLICIT INTEGER OPTIONAL, - targetToken [4] IMPLICIT OCTET STRING OPTIONAL - -- Origin may use token subsequently within a variantRequest (in - -- an elementRequest) to retrieve (or to refer to) the fragment. - } - - - - -Variant ::= SEQUENCE{ - globalVariantSetId [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL, - -- Applies to the triples below, when variantSetId omitted. If - -- globalVariantSetId omitted, default applies. Default may be provided by - -- the tagSet-M element defaultVariantSetId. - - - - - triples [2] IMPLICIT SEQUENCE OF SEQUENCE{ - variantSetId [0] IMPLICIT OBJECT IDENTIFIER OPTIONAL, - -- If omitted, globalVariantSetId (above) - -- applies, unless that too is omitted, in - -- which case, default used. - class [1] IMPLICIT INTEGER, - type [2] IMPLICIT INTEGER, - value [3] CHOICE{ - integer INTEGER, - internationalString InternationalString, - octetString OCTET STRING, - objectIdentifier OBJECT IDENTIFIER, - boolean BOOLEAN, - null NULL, - -- Following need context tags: - unit [1] IMPLICIT Unit, - valueAndUnit [2] IMPLICIT IntUnit}}} -END - - - -RecordSyntax-ESTaskPackage -{Z39-50-recordSyntax ESTaskPackage (106)} DEFINITIONS ::= -BEGIN -IMPORTS Permissions, InternationalString, IntUnit, DiagRec FROM Z39-50-APDU-1995; - -TaskPackage ::= SEQUENCE{ - packageType [1] IMPLICIT OBJECT IDENTIFIER, - -- oid of specific ES definition - packageName [2] IMPLICIT InternationalString OPTIONAL, - userId [3] IMPLICIT InternationalString OPTIONAL, - retentionTime [4] IMPLICIT IntUnit OPTIONAL, - permissions [5] IMPLICIT Permissions OPTIONAL, - description [6] IMPLICIT InternationalString OPTIONAL, - targetReference [7] IMPLICIT OCTET STRING OPTIONAL, - creationDateTime [8] IMPLICIT GeneralizedTime OPTIONAL, - taskStatus [9] IMPLICIT INTEGER{ - pending (0), - active (1), - complete (2), - aborted (3)}, - packageDiagnostics [10] IMPLICIT SEQUENCE OF DiagRec OPTIONAL, - taskSpecificParameters [11] IMPLICIT EXTERNAL - -- Use oid for specific ES definition - -- (same oid as packageType above) - -- and select [2] "taskPackage." - } -END - - - - -ResourceReport-Format-Resource-1 -{Z39-50-resourceReport resource-1 (1)} DEFINITIONS ::= -BEGIN -IMPORTS InternationalString FROM Z39-50-APDU-1995; --- -ResourceReport ::= SEQUENCE{ -estimates [1] IMPLICIT SEQUENCE OF Estimate, -message [2] IMPLICIT InternationalString} --- -Estimate ::= SEQUENCE{ -type [1] IMPLICIT EstimateType, -value [2] IMPLICIT INTEGER, -- the actual estimate -currency-code [3] IMPLICIT INTEGER OPTIONAL - -- code for representation of currencies defined in ISO 4217-1990. - -- Applicable only to monetary estimates. - } -EstimateType ::= INTEGER{ -currentSearchRecords (1), -- estimated no. records in current (incomplete) result set for search -finalSearchRecords (2), -- estimated no. records that will be in result set if search completes -currentPresentRecords (3), -- estimated number of records in current (incomplete) set of - -- records to be returned on Present -finalPresentRecords (4), -- estimated number of records that will be in the set of records - -- to be returned by Present if Present completes -currentOpTimeProcessing (5), -- processing time (in .001 CPU seconds) used by operation so far -finalOpTimeProcessing (6), -- estimated total processing time (in .001 CPU seconds) that will - -- be used by this operation if it completes -currentAssocTime (7), -- estimated processing time used by association (in .001 CPU sec.) -currentOperationCost (8), -- estimated cost for this operation so far -finalOperationCost (9), -- estimated cost for this operation if it completes -currentAssocCost (10), -- estimated cost for this association so far -finalOpTimeElapsed (11), -- estimated elapsed time for operation if it completes (in .001 sec.) -percentComplete (12), -- estimated percent complete -currentSearchAssocCost (13), -- estimated search cost for association so far -currentPresentAssocCost (14), -- estimated present cost for this association so far -currentConnectAssocCost (15), -- estimated connect time cost for association so far -currentOtherAssocCost (16) -- estimated other cost (not included in 13-15) for association so far - } -END - - - - - - - - - - - - - -ResourceReport-Format-Resource-2 -{Z39-50-resourceReport resource-2 (2)} DEFINITIONS ::= -BEGIN -IMPORTS InternationalString, StringOrNumeric, IntUnit FROM Z39-50-APDU-1995; --- -ResourceReport ::= SEQUENCE{ -estimates [1] IMPLICIT SEQUENCE OF Estimate OPTIONAL, -message [2] IMPLICIT InternationalString OPTIONAL} --- -Estimate ::= SEQUENCE{ -type [1] StringOrNumeric, - -- Numeric values of 1-16 are the same as used in Resource-1. -value [2] IMPLICIT IntUnit - -- When expressing currency: - -- unitSystem (of Unit) is 'z3950' (case insensitive) - -- unitType is 'iso4217-1990' (case insensitive) - -- unit is currency code from ISO 4217-1990. -} -END - - - - - -AccessControlFormat-prompt-1 -{Z39-50-accessControl prompt-1 (1)} DEFINITIONS ::= -BEGIN -IMPORTS InternationalString, DiagRec FROM Z39-50-APDU-1995; --- -PromptObject ::= CHOICE{ - challenge [1] IMPLICIT Challenge, - response [2] IMPLICIT Response} - - Challenge ::= SEQUENCE OF SEQUENCE { - promptId [1] PromptId, - -- Target supplies a number (for an enumerated prompt) or string (for a non - -- -enumerated prompt), for each prompt, and the origin returns it in response, for - -- this prompt, so target may correlate the prompt response with the prompt. - defaultResponse [2] IMPLICIT InternationalString OPTIONAL, - promptInfo [3] CHOICE{ - character [1] IMPLICIT InternationalString, - encrypted [2] IMPLICIT Encryption} OPTIONAL, - -- Information corresponding to an enumerated prompt. For example if 'type', within - -- PromptId, is 'copyright', then promptInfo may contain a copyright statement. - regExpr [4] IMPLICIT InternationalString OPTIONAL, - -- A regular expression that promptResponse should match. See IEEE 1003.2 - -- Volume 1, Section 2.8 "Regular Expression Notation." For example if promptId - -- is "Year of publication," regExpr might be "19[89][0-9]|20[0-9][0-9]". - responseRequired [5] IMPLICIT NULL OPTIONAL, - allowedValues [6] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, - -- e.g. promptId="Desired color"; allowed = 'red', 'blue','Green'. - shouldSave [7] IMPLICIT NULL OPTIONAL, - -- Target recommends that origin save the data that it prompts from the - -- user corresponding to this prompt, because it is likely to be requested again (so - -- origin might not have to prompt the user next time). - dataType [8] IMPLICIT INTEGER{ - integer (1), - date (2), - float (3), - alphaNumeric (4), - url-urn (5), - boolean (6)} OPTIONAL, - -- Target telling origin type of data it wants. E.g., if "date" is specified, - -- presumably the origin will try to prompt something "date-like" from the user. - diagnostic [9] IMPLICIT EXTERNAL OPTIONAL - -- Intended for repeat requests when there is an error the origin - -- should report to the user from previous attempt. - } - - - Response ::= SEQUENCE OF SEQUENCE { - promptId [1] PromptId, - -- Corresponds to a prompt in the challenge, or may be unprompted, for - -- example "newPassword." If unprompted, should be "enumerated." - -- If this responds to a non-enumerated prompt, then nonEnumeratedPrompt - -- should contain the prompt string from the challenge. - promptResponse [2] CHOICE{ - string [1] IMPLICIT InternationalString, - accept [2] IMPLICIT BOOLEAN, - acknowledge [3] IMPLICIT NULL, - diagnostic [4] DiagRec, - encrypted [5] IMPLICIT Encryption}} - - - PromptId ::= CHOICE{ - enummeratedPrompt [1] IMPLICIT SEQUENCE{ - type [1] IMPLICIT INTEGER{ - groupId (0), - userId (1), - password (2), - newPassword (3), - copyright (4), - -- When type on Challenge is 'copyright', promptInfo has text of - -- copyright message to be displayed verbatim to the user. If - -- promptResponse indicates 'acceptance', this indicates the user has been - -- shown, and accepted, the terms of the copyright. This is not intended - -- to be legally binding, but provides a good-faith attempt on - -- the part of the target to inform the user of the copyright. - sessionId (5)}, - suggestedString [2] IMPLICIT InternationalString OPTIONAL}, - nonEnumeratedPrompt [2] IMPLICIT InternationalString} - - - Encryption ::= SEQUENCE{ - cryptType [1] IMPLICIT OCTET STRING OPTIONAL, - credential [2] IMPLICIT OCTET STRING OPTIONAL, - --random number, SALT, or other factor - data [3] IMPLICIT OCTET STRING} - -END - - - - -AccessControlFormat-des-1 -{Z39-50-accessControlFormat des-1 (2)} DEFINITIONS ::= -BEGIN - DES-RN-Object ::= CHOICE { - challenge [1] IMPLICIT DRNType, - response [2] IMPLICIT DRNType} - DRNType ::= SEQUENCE{ - userId [1] IMPLICIT OCTET STRING OPTIONAL, - salt [2] IMPLICIT OCTET STRING OPTIONAL, - randomNumber [3] IMPLICIT OCTET STRING} -END - - -AccessControlFormat-krb-1 -{Z39-50-accessControlFormat krb-1 (3)} DEFINITIONS ::= -BEGIN -IMPORTS InternationalString FROM Z39-50-APDU-1995; - - KRBObject ::= CHOICE { - challenge [1] IMPLICIT KRBRequest, - response [2] IMPLICIT KRBResponse} - KRBRequest ::= SEQUENCE{ - service [1] IMPLICIT InternationalString, - instance [2] IMPLICIT InternationalString OPTIONAL, - realm [3] IMPLICIT InternationalString OPTIONAL} - -- target requests a ticket for the given service, instance, and realm - KRBResponse ::= SEQUENCE{ - userid [1] IMPLICIT InternationalString OPTIONAL, - ticket [2] IMPLICIT OCTET STRING} - -- origin responds with a ticket for the requested service -END - - - - - - - - - -ESFormat-PersistentResultSet -{Z39-50-extendedService PersistentResultSet (1)} DEFINITIONS ::= -BEGIN -IMPORTS InternationalString FROM Z39-50-APDU-1995; -PersistentResultSet ::= CHOICE{ - esRequest [1] IMPLICIT SEQUENCE{ - toKeep [1] IMPLICIT NULL, - notToKeep [2] OriginPartNotToKeep OPTIONAL}, - taskPackage [2] IMPLICIT SEQUENCE{ - originPart [1] IMPLICIT NULL, - targetPart [2] TargetPart OPTIONAL}} -OriginPartNotToKeep ::= SEQUENCE{ - originSuppliedResultSet [1] IMPLICIT InternationalString OPTIONAL, - -- name of transient result set, supplied on request, mandatory unless function is 'delete' - replaceOrAppend [2] IMPLICIT INTEGER{ -- only if function is "modify" - replace (1), - append (2)} OPTIONAL} -TargetPart ::= SEQUENCE{ - targetSuppliedResultSet [1] IMPLICIT InternationalString OPTIONAL, - -- Name of transient result set, supplied by target, representing the persistent result set to which - -- package pertains. Meaningful only when package is presented. (i.e. not on ES response). - numberOfRecords [2] IMPLICIT INTEGER OPTIONAL} -END - - -ESFormat-PersistentQuery -{Z39-50-extendedService PersistentQuery (2)} DEFINITIONS ::= -BEGIN -IMPORTS Query, InternationalString, OtherInformation FROM Z39-50-APDU-1995; -PersistentQuery ::= CHOICE{ - esRequest [1] IMPLICIT SEQUENCE{ - toKeep [1] OriginPartToKeep OPTIONAL, - notToKeep [2] OriginPartNotToKeep}, - taskPackage [2] IMPLICIT SEQUENCE{ - originPart [1] OriginPartToKeep OPTIONAL, - targetPart [2] TargetPart}} -OriginPartToKeep ::= SEQUENCE{ - dbNames [2] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, - additionalSearchInfo [3] OtherInformation OPTIONAL} -OriginPartNotToKeep ::= CHOICE{ - package [1] IMPLICIT InternationalString, - query [2] Query} -TargetPart ::= Query -END - -ESFormat-PeriodicQuerySchedule -{Z39-50-extendedService PeriodicQuerySchedule (3)} DEFINITIONS ::= -BEGIN -IMPORTS Query, InternationalString, IntUnit FROM Z39-50-APDU-1995 -ExportSpecification, Destination FROM ESFormat-ExportSpecification; - -PeriodicQuerySchedule ::= CHOICE{ - esRequest [1] IMPLICIT SEQUENCE{ - toKeep [1] OriginPartToKeep, - notToKeep [2] OriginPartNotToKeep}, - taskPackage [2] IMPLICIT SEQUENCE{ - originPart [1] OriginPartToKeep, - targetPart [2] TargetPart}} - -OriginPartToKeep ::=SEQUENCE{ - activeFlag [1] IMPLICIT BOOLEAN, - databaseNames [2] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, - resultSetDisposition [3] IMPLICIT INTEGER{ - replace (1), - append (2), - createNew (3) -- Only if origin and target have agreement about - -- naming convention for the resulting package, - -- and only if no result set is specified. - } OPTIONAL, -- Mandatory on 'create' if result set is specified, in - -- which case it must be 'replace' or 'append. - alertDestination [4] Destination OPTIONAL, - exportParameters [5] CHOICE{ - packageName [1] IMPLICIT InternationalString, - exportPackage [2] ExportSpecification} OPTIONAL} - -OriginPartNotToKeep ::= SEQUENCE{ - querySpec [1] CHOICE{ - actualQuery [1] Query, - packageName [2] IMPLICIT InternationalString} OPTIONAL, - -- mandatory for 'create' - originSuggestedPeriod [2] Period OPTIONAL, -- mandatory for 'create' - expiration [3] IMPLICIT GeneralizedTime OPTIONAL, - resultSetPackage [4] IMPLICIT InternationalString OPTIONAL} - -TargetPart ::= SEQUENCE{ - actualQuery [1] Query, - targetStatedPeriod [2] Period, - -- Target supplies the period, which may be same as origin proposed. - expiration [3] IMPLICIT GeneralizedTime OPTIONAL, - -- Target supplies value for task package. It may be the same as origin - -- proposed or different from (and overrides) origin proposal, but if - -- omitted, there is no expiration. - resultSetPackage [4] IMPLICIT InternationalString OPTIONAL, - -- May be omitted only if exportParameters was supplied. Target - -- supplies same name as origin supplied, if origin did supply a name. - lastQueryTime [5] IMPLICIT GeneralizedTime, - lastResultNumber [6] IMPLICIT INTEGER, - numberSinceModify [7] IMPLICIT INTEGER OPTIONAL} - - - - - Period ::= CHOICE{ - unit [1] IMPLICIT IntUnit, - businessDaily [2] IMPLICIT NULL, - continuous [3] IMPLICIT NULL, - other [4] IMPLICIT InternationalString} -END - - -ESFormat-ItemOrder -{Z39-50-extendedService ItemOrder (4)} DEFINITIONS ::= -BEGIN -IMPORTS InternationalString FROM Z39-50-APDU-1995; -ItemOrder ::= CHOICE{ - esRequest [1] IMPLICIT SEQUENCE{ - toKeep [1] OriginPartToKeep OPTIONAL, - notToKeep [2] OriginPartNotToKeep}, - taskPackage [2] IMPLICIT SEQUENCE{ - originPart [1] OriginPartToKeep OPTIONAL, - targetPart [2] TargetPart}} -OriginPartToKeep ::= SEQUENCE{ - supplDescription [1] IMPLICIT EXTERNAL OPTIONAL, - contact [2] IMPLICIT SEQUENCE{ - name [1] IMPLICIT InternationalString OPTIONAL, - phone [2] IMPLICIT InternationalString OPTIONAL, - email [3] IMPLICIT InternationalString OPTIONAL} OPTIONAL, - addlBilling [3] IMPLICIT SEQUENCE{ - paymentMethod [1] CHOICE{ - billInvoice [0] IMPLICIT NULL, - prepay [1] IMPLICIT NULL, - depositAccount [2] IMPLICIT NULL, - creditCard [3] IMPLICIT CreditCardInfo, - cardInfoPreviouslySupplied [4] IMPLICIT NULL, - privateKnown [5] IMPLICIT NULL, - privateNotKnown [6] IMPLICIT EXTERNAL}, - customerReference [2] IMPLICIT InternationalString OPTIONAL, - customerPONumber [3] IMPLICIT InternationalString OPTIONAL} - OPTIONAL} -CreditCardInfo ::= SEQUENCE{ - nameOnCard [1] IMPLICIT InternationalString, - expirationDate [2] IMPLICIT InternationalString, - cardNumber [3] IMPLICIT InternationalString} - -OriginPartNotToKeep ::= SEQUENCE{ -- Corresponds to 'requestedItem' in service definition. - -- Must supply at least one, and may supply both. - resultSetItem [1] IMPLICIT SEQUENCE{ - resultSetId [1] IMPLICIT InternationalString, - item [2] IMPLICIT INTEGER} OPTIONAL, - itemRequest [2] IMPLICIT EXTERNAL OPTIONAL - -- When itemRequest is an ILL-Request APDU, - -- use OID {iso standard 10161 abstract-syntax (2) ill-apdus (1)} - } - -TargetPart ::= SEQUENCE{ - itemRequest [1] IMPLICIT EXTERNAL OPTIONAL, - -- When itemRequest is an ILL-Request APDU, use OID 1.0.10161.2.1 (as above) - statusOrErrorReport [2] IMPLICIT EXTERNAL OPTIONAL, - -- When statusOrErrorReport is an ILL Status-Or-Error-Report APDU, use OID 1.0.10161.2.1 (as above) - auxiliaryStatus [3] IMPLICIT INTEGER{ - notReceived (1), - loanQueue (2), - forwarded (3), - unfilledCopyright (4), - filledCopyright (5)} OPTIONAL} -END - - - - -ESFormat-Update0 -{Z39-50-extendedService Update (5)} DEFINITIONS ::= -BEGIN -IMPORTS DiagRec, InternationalString FROM Z39-50-APDU-1995; -Update ::= CHOICE{ - esRequest [1] IMPLICIT SEQUENCE{ - toKeep [1] OriginPartToKeep, - notToKeep [2] OriginPartNotToKeep}, - taskPackage [2] IMPLICIT SEQUENCE{ - originPart [1] OriginPartToKeep, - targetPart [2] TargetPart}} - - -OriginPartToKeep ::= SEQUENCE{ - action [1] IMPLICIT INTEGER{ - recordInsert (1), - recordReplace (2), - recordDelete (3), - elementUpdate (4)}, - databaseName [2] IMPLICIT InternationalString, - schema [3] IMPLICIT OBJECT IDENTIFIER OPTIONAL, - elementSetName [4] IMPLICIT InternationalString OPTIONAL} - - -OriginPartNotToKeep ::= SuppliedRecords - - -TargetPart ::= SEQUENCE{ - updateStatus [1] IMPLICIT INTEGER{ - success (1), - partial (2), - failure (3)}, - globalDiagnostics [2] IMPLICIT SEQUENCE OF DiagRec OPTIONAL, - -- These are non-surrogate diagnostics relating to the task, - -- not to individual records. - taskPackageRecords [3] IMPLICIT SEQUENCE OF TaskPackageRecordStructure - -- There should be a TaskPackageRecordStructure for every record - -- supplied. The target should create such a structure for every - -- record immediately upon creating the task package to include - -- correlation information and status. The record itself would not - -- be included until processing for that record is complete. - } - --- Auxiliary definitions for Update -SuppliedRecords ::= SEQUENCE OF SEQUENCE{ - recordId [1] CHOICE{ - number [1] IMPLICIT INTEGER, - string [2] IMPLICIT InternationalString, - opaque [3] IMPLICIT OCTET STRING} OPTIONAL, - supplementalId [2] CHOICE{ - timeStamp [1] IMPLICIT GeneralizedTime, - versionNumber [2] IMPLICIT InternationalString, - previousVersion [3] IMPLICIT EXTERNAL} OPTIONAL, - correlationInfo [3] IMPLICIT CorrelationInfo OPTIONAL, - record [4] IMPLICIT EXTERNAL} - -CorrelationInfo ::= SEQUENCE{ - -- origin may supply one or both for any record: - note [1] IMPLICIT InternationalString OPTIONAL, - id [2] IMPLICIT INTEGER OPTIONAL} - -TaskPackageRecordStructure ::= SEQUENCE{ - recordOrSurDiag [1] CHOICE { - record [1] IMPLICIT EXTERNAL, - -- Choose 'record' if recordStatus is 'success', and - -- elementSetName was supplied. - diagnostic [2] DiagRec - -- Choose 'diagnostic', if RecordStatus is failure. - } OPTIONAL, - -- The parameter recordOrSurDiag will thus be omitted only if - -- 'elementSetName' was omitted and recordStatus is - -- 'success'; or if record status is 'queued' or in 'process'. - correlationInfo [2] IMPLICIT CorrelationInfo OPTIONAL, - -- This should be included if it was supplied by the origin. - recordStatus [3] IMPLICIT INTEGER{ - success (1), - queued (2), - inProcess (3), - failure (4)}} -END - - -ESFormat-ExportSpecification -{Z39-50-extendedService ExportSpecification (6)} DEFINITIONS ::= -BEGIN -EXPORTS ExportSpecification, Destination; IMPORTS CompSpec, InternationalString FROM Z39-50-APDU-1995; -ExportSpecification ::= CHOICE{ - esRequest [1] IMPLICIT SEQUENCE{ - toKeep [1] OriginPartToKeep, - notToKeep [2] IMPLICIT NULL}, - taskPackage [2] IMPLICIT SEQUENCE{ - originPart [1] OriginPartToKeep, - targetPart [2] IMPLICIT NULL}} -OriginPartToKeep ::= SEQUENCE{ - composition [1] IMPLICIT CompSpec, - exportDestination [2] Destination} - - Destination ::= CHOICE{ - phoneNumber [1] IMPLICIT InternationalString, - faxNumber [2] IMPLICIT InternationalString, - x400address [3] IMPLICIT InternationalString, - emailAddress [4] IMPLICIT InternationalString, - pagerNumber [5] IMPLICIT InternationalString, - ftpAddress [6] IMPLICIT InternationalString, - ftamAddress [7] IMPLICIT InternationalString, - printerAddress [8] IMPLICIT InternationalString, - other [100] IMPLICIT SEQUENCE{ - vehicle [1] IMPLICIT InternationalString OPTIONAL, - destination [2] IMPLICIT InternationalString}} -END - - - - -ESFormat-ExportInvocation -{Z39-50-extendedService ExportInvocation (7)} DEFINITIONS ::= -BEGIN -IMPORTS InternationalString, IntUnit FROM Z39-50-APDU-1995 -ExportSpecification FROM ESFormat-ExportSpecification; -ExportInvocation ::= CHOICE{ - esRequest [1] IMPLICIT SEQUENCE{ - toKeep [1] OriginPartToKeep, - notToKeep [2] OriginPartNotToKeep}, - taskPackage [2] IMPLICIT SEQUENCE{ - originPart [1] OriginPartToKeep, - targetPart [2] TargetPart OPTIONAL}} - -OriginPartToKeep ::= SEQUENCE{ - exportSpec [1] CHOICE{ - packageName [1] IMPLICIT InternationalString, - packageSpec [2] ExportSpecification}, - numberOfCopies [2] IMPLICIT INTEGER} - - - - - -OriginPartNotToKeep ::= SEQUENCE{ - resultSetId [1] IMPLICIT InternationalString, - records [2] CHOICE{ - all [1] IMPLICIT NULL, - ranges [2] IMPLICIT SEQUENCE OF SEQUENCE{ - start [1] IMPLICIT INTEGER, - count [2] IMPLICIT INTEGER OPTIONAL - -- Count may be omitted only on last range, to indicate - -- "all remaining records beginning with 'start'." - }}} - -TargetPart ::= SEQUENCE{ - estimatedQuantity [1] IMPLICIT IntUnit OPTIONAL, - quantitySoFar [2] IMPLICIT IntUnit OPTIONAL, - estimatedCost [3] IMPLICIT IntUnit OPTIONAL, - costSoFar [4] IMPLICIT IntUnit OPTIONAL} -END - - - -UserInfoFormat-searchResult-1 -{Z39-50-userInfoFormat searchResult-1 (1)} DEFINITIONS ::= -BEGIN -IMPORTS DatabaseName, Term, Query, IntUnit, InternationalString FROM Z39-50-APDU-1995; -SearchInfoReport ::= SEQUENCE OF SEQUENCE{ - subqueryId [1] IMPLICIT InternationalString OPTIONAL, - -- shorthand identifier of subquery - fullQuery [2] IMPLICIT BOOLEAN, -- 'true' means this is the full query; 'false', - -- a sub-query - subqueryExpression [3] QueryExpression OPTIONAL, -- A subquery of the query as - -- submitted. May be whole query; - -- if so, "fullQuery" should be 'true'. - subqueryInterpretation [4] QueryExpression OPTIONAL, -- how target interpreted subquery - subqueryRecommendation [5] QueryExpression OPTIONAL, -- target-recommended alternative - subqueryCount [6] IMPLICIT INTEGER OPTIONAL, -- Number of records for this - -- subQuery, across all of the specified - -- databases. (If during search, via resource - -- control, number of records so far). - subqueryWeight [7] IMPLICIT IntUnit OPTIONAL, -- relative weight of this subquery - resultsByDB [8] IMPLICIT ResultsByDB OPTIONAL} - -ResultsByDB ::= SEQUENCE OF SEQUENCE{ - databases [1] CHOICE{ - all [1] IMPLICIT NULL, - -- applies across all of the databases in Search PDU - list [2] IMPLICIT SEQUENCE OF DatabaseName - -- applies across all databases in this list - }, - count [2] IMPLICIT INTEGER OPTIONAL, - -- Number of records for query component (and, as above, if during search, - -- via resource control, number of records so far). - resultSetName [3] IMPLICIT InternationalString OPTIONAL - -- Target-assigned result set by which subQuery is available. Should not - -- be provided unless processing for this query component is concluded (i.e., - -- when this report comes during search, via resource control, as opposed - -- to after search, via additionalSearchInfo). - } - -QueryExpression ::= CHOICE { - term [1] IMPLICIT SEQUENCE{ - queryTerm [1] Term, - termComment [2] IMPLICIT InternationalString OPTIONAL}, - query [2] Query} -END - - - -ElementSpecificationFormat-eSpec-1 -{Z39-50-elementSpec eSpec-1 (1)} DEFINITIONS ::= -BEGIN -IMPORTS Variant FROM RecordSyntax-generic -StringOrNumeric, InternationalString FROM Z39-50-APDU-1995; --- -Espec-1 ::= SEQUENCE{ - elementSetNames [1] IMPLICIT SEQUENCE OF InternationalString OPTIONAL, - -- Origin may include one or more element set names, each - -- specifying a set of elements. Each of the elements is to be - -- treated as an elementRequest in the form of simpleElement, - -- where occurrence is 1. - defaultVariantSetId [2] IMPLICIT OBJECT IDENTIFIER OPTIONAL, - -- If supplied, applies whenever variantRequest - -- does not include variantSetId. - defaultVariantRequest [3] IMPLICIT Variant OPTIONAL, - -- If supplied, then for each simple elementRequest that does not - -- include a variantRequest, the defaultVariantRequest applies. - -- (defaultVariantRequest does not apply to a compositeRequest.) - defaultTagType [4] IMPLICIT INTEGER OPTIONAL, - -- If supplied, applies whenever 'tagType' (within 'tag' within TagPath) - -- is omitted. - elements [5] IMPLICIT SEQUENCE OF ElementRequest OPTIONAL} --- - -ElementRequest::= CHOICE{ - simpleElement [1] IMPLICIT SimpleElement, - compositeElement [2] IMPLICIT SEQUENCE{ - elementList [1] CHOICE{ - primitives [1] IMPLICIT SEQUENCE OF InternationalString, - -- Origin may specify one or more element - -- set names, each identifying a set of elements, - -- and the composite element is the union. - specs [2] IMPLICIT SEQUENCE OF SimpleElement}, - - deliveryTag [2] IMPLICIT TagPath, - -- DeliveryTag tagPath for compositeElement may not - -- include wildThing or wildPath. - variantRequest [3] IMPLICIT Variant OPTIONAL}} - -SimpleElement ::= SEQUENCE{ - path [1] IMPLICIT TagPath, - variantRequest [2] IMPLICIT Variant OPTIONAL} - - -TagPath ::= SEQUENCE OF CHOICE{ - specificTag [1] IMPLICIT SEQUENCE{ - tagType [1] IMPLICIT INTEGER OPTIONAL, - -- If omitted, then 'defaultTagType' (above) applies, if supplied, and - -- if not supplied, then default listed in schema applies. - tagValue [2] StringOrNumeric, - occurrence [3] Occurrences OPTIONAL - -- default is "first occurrence" - }, - wildThing [2] Occurrences, - -- Get Nth "thing" at this level, regardless of tag, for each N specified by - -- "Occurrences" (which may be 'all' meaning match every element at this level). - -- E.g., if "Occurrences" is 3, get third element regardless of its tag or the tag of - -- the first two elements. - wildPath [3] IMPLICIT NULL - -- Match any tag, at this level or below, that is on a path for which next tag in this - -- TagPath sequence occurs. WildPath may not be last member of the TagPath - -- sequence. - } --- - -Occurrences ::= CHOICE{ - all [1] IMPLICIT NULL, - last [2] IMPLICIT NULL, - values [3] IMPLICIT SEQUENCE{ - start [1] IMPLICIT INTEGER, - -- if 'start' alone is included, then single occurrence is requested - howMany [2] IMPLICIT INTEGER OPTIONAL - -- For example, if 'start' is 5 and 'howMany' is 6, then request is for - -- "occurrences 5 through 10." - }} -END - diff --git a/zoom/Makefile.am b/zoom/Makefile.am index 7943906..5304e72 100644 --- a/zoom/Makefile.am +++ b/zoom/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.11 2003-03-11 11:09:17 adam Exp $ +## $Id: Makefile.am,v 1.12 2003-10-27 12:21:45 adam Exp $ ## Copyright (C) 2001, Index Data AM_CPPFLAGS = -I$(top_srcdir)/include @@ -6,7 +6,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include EXTRA_PROGRAMS = zoomtst1 zoomtst2 zoomtst3 zoomtst4 zoomtst5 zoomtst6 zoomtst7 zoomtst8 bin_PROGRAMS = zoomsh -LDADD = ../lib/libyazmalloc.la ../lib/libyaz.la $(READLINE_LIBS) +LDADD = ../src/libyaz.la $(READLINE_LIBS) zoomtst1_SOURCES = zoomtst1.c zoomtst2_SOURCES = zoomtst2.c diff --git a/ztest/Makefile.am b/ztest/Makefile.am index 21b2e8a..0886187 100644 --- a/ztest/Makefile.am +++ b/ztest/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.14 2003-02-18 10:37:08 adam Exp $ +## $Id: Makefile.am,v 1.15 2003-10-27 12:21:45 adam Exp $ if ISSSL sslbin=yaz-ztest-ssl @@ -12,13 +12,13 @@ yaz_ztest_ssl_SOURCES=$(yaz_ztest_SOURCES) EXTRA_DIST=dummy-records dummy-words dummy-grs if ISTHR -extra=../lib/libyazthread.la +extra=../src/libyazthread.la endif -yaz_ztest_LDADD=$(extra) ../lib/libyaz.la \ +yaz_ztest_LDADD=$(extra) ../src/libyaz.la \ $(LIBTHREAD) -yaz_ztest_ssl_LDADD=$(extra) ../lib/libyazssl.la ../lib/libyaz.la \ +yaz_ztest_ssl_LDADD=$(extra) ../src/libyazssl.la ../src/libyaz.la \ $(SSL_LIBS) $(LIBTHREAD) AM_CFLAGS=@CFLAGSTHREADS@ diff --git a/zutil/.cvsignore b/zutil/.cvsignore deleted file mode 100644 index 32ca3eb..0000000 --- a/zutil/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -libzutil.la -*.lo diff --git a/zutil/Makefile.am b/zutil/Makefile.am deleted file mode 100644 index 23b4653..0000000 --- a/zutil/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -## $Id: Makefile.am,v 1.20 2003-04-23 12:31:07 adam Exp $ -noinst_LTLIBRARIES = libzutil.la - -AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) - -libzutil_la_SOURCES = zget.c yaz-ccl.c diagbib1.c logrpn.c \ - otherinfo.c pquery.c sortspec.c z3950oid.c charneg.c \ - zoom-c.c zoom-opt.c zoom-p.h grs1disp.c zgdu.c soap.c srw.c opacdisp.c - -srwtst_LDADD = ../odr/libodr.la libzutil.la ../util/libutil.la -srwtst_SOURCES = srwtst.c - -EXTRA_PROGRAMS = srwtst diff --git a/zutil/charneg.c b/zutil/charneg.c deleted file mode 100644 index dbcedd4..0000000 --- a/zutil/charneg.c +++ /dev/null @@ -1,376 +0,0 @@ -/* - $ $Id: charneg.c,v 1.8 2003-09-02 12:12:13 adam Exp $ - * Helper functions for Character Set and Language Negotiation - 3 - */ - -#include -#include -#include -#include -#include - -static Z_External* z_ext_record2(ODR o, int oid_class, int oid_value, - const char *buf) -{ - Z_External *p; - oident oid; - int len = strlen(buf); - - if (!(p = (Z_External *)odr_malloc(o, sizeof(*p)))) return 0; - - p->descriptor = 0; - p->indirect_reference = 0; - - oid.proto = PROTO_Z3950; - oid.oclass = (enum oid_class) oid_class; - oid.value = (enum oid_value) oid_value; - p->direct_reference = odr_oiddup(o, oid_getoidbyent(&oid)); - - p->which = Z_External_octet; - if (!(p->u.octet_aligned = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct)))) { - return 0; - } - if (!(p->u.octet_aligned->buf = (unsigned char *)odr_malloc(o, len))) { - return 0; - } - p->u.octet_aligned->len = p->u.octet_aligned->size = len; - memcpy(p->u.octet_aligned->buf, buf, len); - - return p; -} - -static int get_form(const char *charset) -{ - int form = -1; - - - if (!yaz_matchstr(charset, "UCS-2")) - form = 2; - if (!yaz_matchstr(charset, "UCS-4")) - form = 4; - if (!yaz_matchstr(charset, "UTF-16")) - form = 5; - if (!yaz_matchstr(charset, "UTF-8")) - form = 8; - - return form; -} - -static char *set_form (Odr_oid *encoding) -{ - static char *charset = 0; - if ( oid_oidlen(encoding) != 6) - return 0; - if (encoding[5] == 2) - charset = "UCS-2"; - if (encoding[5] == 4) - charset = "UCS-4"; - if (encoding[5] == 5) - charset = "UTF-16"; - if (encoding[5] == 8) - charset = "UTF-8"; - return charset; -} - -static Z_OriginProposal_0 *z_get_OriginProposal_0(ODR o, const char *charset) -{ - int form = get_form (charset); - Z_OriginProposal_0 *p0 = - (Z_OriginProposal_0*)odr_malloc(o, sizeof(*p0)); - - memset(p0, 0, sizeof(*p0)); - - if (form > 0) - { /* ISO 10646 (UNICODE) */ - char oidname[20]; - - Z_Iso10646 *is = (Z_Iso10646 *) odr_malloc (o, sizeof(*is)); - p0->which = Z_OriginProposal_0_iso10646; - p0->u.iso10646 = is; - is->collections = 0; - sprintf (oidname, "1.0.10646.1.0.%d", form); - is->encodingLevel = odr_getoidbystr (o, oidname); - } - else - { /* private ones */ - Z_PrivateCharacterSet *pc = - (Z_PrivateCharacterSet *)odr_malloc(o, sizeof(*pc)); - - memset(pc, 0, sizeof(*pc)); - - p0->which = Z_OriginProposal_0_private; - p0->u.zprivate = pc; - - pc->which = Z_PrivateCharacterSet_externallySpecified; - pc->u.externallySpecified = - z_ext_record2(o, CLASS_NEGOT, VAL_ID_CHARSET, charset); - } - return p0; -} - -static Z_OriginProposal *z_get_OriginProposal( - ODR o, const char **charsets, int num_charsets, - const char **langs, int num_langs, int selected) -{ - int i; - Z_OriginProposal *p = (Z_OriginProposal *) odr_malloc(o, sizeof(*p)); - - memset(p, 0, sizeof(*p)); - - p->recordsInSelectedCharSets = (bool_t *)odr_malloc(o, sizeof(bool_t)); - *p->recordsInSelectedCharSets = (selected) ? 1:0; - - if (charsets && num_charsets) { - - p->num_proposedCharSets = num_charsets; - p->proposedCharSets = - (Z_OriginProposal_0**) - odr_malloc(o, num_charsets*sizeof(Z_OriginProposal_0*)); - - for (i = 0; iproposedCharSets[i] = - z_get_OriginProposal_0(o, charsets[i]); - } - if (langs && num_langs) { - - p->num_proposedlanguages = num_langs; - - p->proposedlanguages = - (char **) odr_malloc(o, num_langs*sizeof(char *)); - - for (i = 0; iproposedlanguages[i] = (char *)langs[i]; - - } - } - return p; -} - -static Z_CharSetandLanguageNegotiation *z_get_CharSetandLanguageNegotiation( - ODR o) -{ - Z_CharSetandLanguageNegotiation *p = - (Z_CharSetandLanguageNegotiation *) odr_malloc(o, sizeof(*p)); - - memset(p, 0, sizeof(*p)); - - return p; -} - -/* Create EXTERNAL for negotation proposal. Client side */ -Z_External *yaz_set_proposal_charneg(ODR o, - const char **charsets, int num_charsets, - const char **langs, int num_langs, - int selected) -{ - Z_External *p = (Z_External *)odr_malloc(o, sizeof(*p)); - oident oid; - - p->descriptor = 0; - p->indirect_reference = 0; - - oid.proto = PROTO_Z3950; - oid.oclass = CLASS_NEGOT; - oid.value = VAL_CHARNEG3; - p->direct_reference = odr_oiddup(o, oid_getoidbyent(&oid)); - - p->which = Z_External_charSetandLanguageNegotiation; - p->u.charNeg3 = z_get_CharSetandLanguageNegotiation(o); - p->u.charNeg3->which = Z_CharSetandLanguageNegotiation_proposal; - p->u.charNeg3->u.proposal = - z_get_OriginProposal(o, charsets, num_charsets, - langs, num_langs, selected); - - return p; -} - -/* used by yaz_set_response_charneg */ -static Z_TargetResponse *z_get_TargetResponse(ODR o, const char *charset, - const char *lang, int selected) -{ - Z_TargetResponse *p = (Z_TargetResponse *) odr_malloc(o, sizeof(*p)); - int form = get_form(charset); - - memset(p, 0, sizeof(*p)); - - if (form > 0) - { - char oidname[20]; - - Z_Iso10646 *is = (Z_Iso10646 *) odr_malloc (o, sizeof(*is)); - p->which = Z_TargetResponse_iso10646; - p->u.iso10646 = is; - is->collections = 0; - sprintf (oidname, "1.0.10646.1.0.%d", form); - is->encodingLevel = odr_getoidbystr (o, oidname); - } - else - { - Z_PrivateCharacterSet *pc = - (Z_PrivateCharacterSet *)odr_malloc(o, sizeof(*pc)); - - memset(pc, 0, sizeof(*pc)); - - p->which = Z_TargetResponse_private; - p->u.zprivate = pc; - - pc->which = Z_PrivateCharacterSet_externallySpecified; - pc->u.externallySpecified = - z_ext_record2(o, CLASS_NEGOT, VAL_ID_CHARSET, charset); - } - p->recordsInSelectedCharSets = (bool_t *)odr_malloc(o, sizeof(bool_t)); - *p->recordsInSelectedCharSets = (selected) ? 1:0; - - p->selectedLanguage = lang ? (char *)odr_strdup(o, lang) : 0; - return p; -} - -/* Create charset response. Server side */ -Z_External *yaz_set_response_charneg(ODR o, const char *charset, - const char *lang, int selected) -{ - Z_External *p = (Z_External *)odr_malloc(o, sizeof(*p)); - oident oid; - - p->descriptor = 0; - p->indirect_reference = 0; - - oid.proto = PROTO_Z3950; - oid.oclass = CLASS_NEGOT; - oid.value = VAL_CHARNEG3; - p->direct_reference = odr_oiddup(o, oid_getoidbyent(&oid)); - - p->which = Z_External_charSetandLanguageNegotiation; - p->u.charNeg3 = z_get_CharSetandLanguageNegotiation(o); - p->u.charNeg3->which = Z_CharSetandLanguageNegotiation_response; - p->u.charNeg3->u.response = z_get_TargetResponse(o, charset, lang, selected); - - return p; -} - -/* Get negotiation from OtherInformation. Client&Server side */ -Z_CharSetandLanguageNegotiation *yaz_get_charneg_record(Z_OtherInformation *p) -{ - Z_External *pext; - int i; - - if(!p) - return 0; - - for (i=0; inum_elements; i++) { - - if ((p->list[i]->which == Z_OtherInfo_externallyDefinedInfo) && - (pext = p->list[i]->information.externallyDefinedInfo)) { - - oident *ent = oid_getentbyoid(pext->direct_reference); - - if (ent && ent->value == VAL_CHARNEG3 && ent->oclass == CLASS_NEGOT && - pext->which == Z_External_charSetandLanguageNegotiation) { - - return pext->u.charNeg3; - } - } - } - return 0; -} - -/* Get charsets, langs, selected from negotiation.. Server side */ -void yaz_get_proposal_charneg(NMEM mem, Z_CharSetandLanguageNegotiation *p, - char ***charsets, int *num_charsets, - char ***langs, int *num_langs, int *selected) -{ - int i; - Z_OriginProposal *pro = p->u.proposal; - - if (num_charsets && charsets) - { - if (pro->num_proposedCharSets) - { - *num_charsets = pro->num_proposedCharSets; - - (*charsets) = (char **) - nmem_malloc(mem, pro->num_proposedCharSets * sizeof(char *)); - - for (i=0; inum_proposedCharSets; i++) - { - (*charsets)[i] = 0; - - if (pro->proposedCharSets[i]->which == - Z_OriginProposal_0_private && - pro->proposedCharSets[i]->u.zprivate->which == - Z_PrivateCharacterSet_externallySpecified) { - - Z_External *pext = - pro->proposedCharSets[i]->u.zprivate->u.externallySpecified; - - if (pext->which == Z_External_octet) { - - (*charsets)[i] = (char *) - nmem_malloc(mem, (1+pext->u.octet_aligned->len) * - sizeof(char)); - - memcpy ((*charsets)[i], pext->u.octet_aligned->buf, - pext->u.octet_aligned->len); - (*charsets)[i][pext->u.octet_aligned->len] = 0; - - } - } - else if (pro->proposedCharSets[i]->which == - Z_OriginProposal_0_iso10646) - (*charsets)[i] = set_form ( - pro->proposedCharSets[i]->u.iso10646->encodingLevel); - } - } - else - *num_charsets = 0; - } - - if (langs && num_langs) - { - if (pro->num_proposedlanguages) - { - *num_langs = pro->num_proposedlanguages; - - (*langs) = (char **) - nmem_malloc(mem, pro->num_proposedlanguages * sizeof(char *)); - - for (i=0; inum_proposedlanguages; i++) - (*langs)[i] = nmem_strdup(mem, pro->proposedlanguages[i]); - } - else - *num_langs = 0; - } - - if(pro->recordsInSelectedCharSets && selected) - *selected = *pro->recordsInSelectedCharSets; -} - -/* Return charset, lang, selected from negotiation.. Client side */ -void yaz_get_response_charneg(NMEM mem, Z_CharSetandLanguageNegotiation *p, - char **charset, char **lang, int *selected) -{ - Z_TargetResponse *res = p->u.response; - - if (charset && res->which == Z_TargetResponse_private && - res->u.zprivate->which == Z_PrivateCharacterSet_externallySpecified) { - - Z_External *pext = res->u.zprivate->u.externallySpecified; - - if (pext->which == Z_External_octet) { - - *charset = (char *) - nmem_malloc(mem, (1+pext->u.octet_aligned->len)*sizeof(char)); - memcpy (*charset, pext->u.octet_aligned->buf, - pext->u.octet_aligned->len); - (*charset)[pext->u.octet_aligned->len] = 0; - } - } - if (charset && res->which == Z_TargetResponse_iso10646) - *charset = set_form (res->u.iso10646->encodingLevel); - if (lang && res->selectedLanguage) - *lang = nmem_strdup (mem, res->selectedLanguage); - - if(selected && res->recordsInSelectedCharSets) - *selected = *res->recordsInSelectedCharSets; -} diff --git a/zutil/diagbib1.c b/zutil/diagbib1.c deleted file mode 100644 index 8da3884..0000000 --- a/zutil/diagbib1.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: diagbib1.c,v 1.6 2003-01-06 08:20:29 adam Exp $ - */ - -#include - -#include - -static struct { - int code; - char *msg; -} msg_tab[] = { -{ 1, "Permanent system error" }, -{ 2, "Temporary system error" }, -{ 3, "Unsupported search" }, -{ 4, "Terms only exclusion (stop) words" }, -{ 5, "Too many argument words" }, -{ 6, "Too many boolean operators" }, -{ 7, "Too many truncated words" }, -{ 8, "Too many incomplete subfields" }, -{ 9, "Truncated words too short" }, -{ 10, "Invalid format for record number (search term)" }, -{ 11, "Too many characters in search statement" }, -{ 12, "Too many records retrieved" }, -{ 13, "Present request out of range" }, -{ 14, "System error in presenting records" }, -{ 15, "Record no authorized to be sent intersystem" }, -{ 16, "Record exceeds Preferred-message-size" }, -{ 17, "Record exceeds Maximum-record-size" }, -{ 18, "Result set not supported as a search term" }, -{ 19, "Only single result set as search term supported" }, -{ 20, "Only ANDing of a single result set as search term supported" }, -{ 21, "Result set exists and replace indicator off" }, -{ 22, "Result set naming not supported" }, -{ 23, "Combination of specified databases not supported" }, -{ 24, "Element set names not supported" }, -{ 25, "Specified element set name not valid for specified database" }, -{ 26, "Only a single element set name supported" }, -{ 27, "Result set no longer exists - unilaterally deleted by target" }, -{ 28, "Result set is in use" }, -{ 29, "One of the specified databases is locked" }, -{ 30, "Specified result set does not exist" }, -{ 31, "Resources exhausted - no results available" }, -{ 32, "Resources exhausted - unpredictable partial results available" }, -{ 33, "Resources exhausted - valid subset of results available" }, -{ 100, "Unspecified error" }, -{ 101, "Access-control failure" }, -{ 102, "Security challenge required but could not be issued -" -" request terminated" }, -{ 103, "Security challenge required but could not be issued -" -" record not included" }, -{ 104, "Security challenge failed - record not included" }, -{ 105, "Terminated by negative continue response" }, -{ 106, "No abstract syntaxes agreed to for this record" }, -{ 107, "Query type not supported" }, -{ 108, "Malformed query" }, -{ 109, "Database unavailable" }, -{ 110, "Operator unsupported" }, -{ 111, "Too many databases specified" }, -{ 112, "Too many result sets created" }, -{ 113, "Unsupported attribute type" }, -{ 114, "Unsupported Use attribute" }, -{ 115, "Unsupported value for Use attribute" }, -{ 116, "Use attribute required but not supplied" }, -{ 117, "Unsupported Relation attribute" }, -{ 118, "Unsupported Structure attribute" }, -{ 119, "Unsupported Position attribute" }, -{ 120, "Unsupported Truncation attribute" }, -{ 121, "Unsupported Attribute Set" }, -{ 122, "Unsupported Completeness attribute" }, -{ 123, "Unsupported attribute combination" }, -{ 124, "Unsupported coded value for term" }, -{ 125, "Malformed search term" }, -{ 126, "Illegal term value for attribute" }, -{ 127, "Unparsable format for un-normalized value" }, -{ 128, "Illegal result set name" }, -{ 129, "Proximity search of sets not supported" }, -{ 130, "Illegal result set in proximity search" }, -{ 131, "Unsupported proximity relation" }, -{ 132, "Unsupported proximity unit code" }, -{ 201, "Proximity not supported with this attribute combination" }, -{ 202, "Unsupported distance for proximity" }, -{ 203, "Ordered flag not supported for proximity" }, -{ 205, "Only zero step size supported for Scan" }, -{ 206, "Specified step size not supported for Scan" }, -{ 207, "Cannot sort according to sequence" }, -{ 208, "No result set name supplied on Sort" }, -{ 209, "Generic sort not supported (database-specific sort only supported)" }, -{ 210, "Database specific sort not supported" }, -{ 211, "Too many sort keys" }, -{ 212, "Duplicate sort keys" }, -{ 213, "Unsupported missing data action" }, -{ 214, "Illegal sort relation" }, -{ 215, "Illegal case value" }, -{ 216, "Illegal missing data action" }, -{ 217, "Segmentation: Cannot guarantee records will fit in specified segments" -}, -{ 218, "ES: Package name already in use" }, -{ 219, "ES: no such package, on modify/delete" }, -{ 220, "ES: quota exceeded" }, -{ 221, "ES: extended service type not supported" }, -{ 222, "ES: permission denied on ES - id not authorized" }, -{ 223, "ES: permission denied on ES - cannot modify or delete" }, -{ 224, "ES: immediate execution failed" }, -{ 225, "ES: immediate execution not supported for this service" }, -{ 226, "ES: immediate execution not supported for these parameters" }, -{ 227, "No data available in requested record syntax" }, -{ 228, "Scan: malformed scan" }, -{ 229, "Term type not supported" }, -{ 230, "Sort: too many input results" }, -{ 231, "Sort: incompatible record formats" }, -{ 232, "Scan: term list not supported" }, -{ 233, "Scan: unsupported value of position-in-response" }, -{ 234, "Too many index terms processed" }, -{ 235, "Database does not exist" }, -{ 236, "Access to specified database denied" }, -{ 237, "Sort: illegal sort" }, -{ 238, "Record not available in requested syntax" }, -{ 239, "Record syntax not supported" }, -{ 240, "Scan: Resources exhausted looking for satisfying terms" }, -{ 241, "Scan: Beginning or end of term list" }, -{ 242, "Segmentation: max-segment-size too small to segment record" }, -{ 243, "Present: additional-ranges parameter not supported" }, -{ 244, "Present: comp-spec parameter not supported" }, -{ 245, "Type-1 query: restriction ('resultAttr') operand not supported" }, -{ 246, "Type-1 query: 'complex' attributeValue not supported" }, -{ 247, "Type-1 query: 'attributeSet' as part of AttributeElement not supported" }, -{ 1001, "Malformed APDU"}, -{ 1002, "ES: EXTERNAL form of Item Order request not supported" }, -{ 1003, "ES: Result set item form of Item Order request not supported" }, -{ 1004, "ES: Extended services not supported unless access control is in effect" }, -{ 1005, "Response records in Search response not supported" }, -{ 1006, "Response records in Search response not possible for specified database (or database combination)" }, -{ 1007, "No Explain server. Addinfo: pointers to servers that have a surrogate Explain database for this server" }, -{ 1008, "ES: missing mandatory parameter for specified function. Addinfo: parameter" }, -{ 1009, "ES: Item Order, unsupported OID in itemRequest. Addinfo: OID" }, -{ 1010, "Init/AC: Bad Userid" }, -{ 1011, "Init/AC: Bad Userid and/or Password" }, -{ 1012, "Init/AC: No searches remaining (pre-purchased searches exhausted)" }, -{ 1013, "Init/AC: Incorrect interface type (specified id valid only when used with a particular access method or client)" }, -{ 1014, "Init/AC: Authentication System error" }, -{ 1015, "Init/AC: Maximum number of simultaneous sessions for Userid" }, -{ 1016, "Init/AC: Blocked network address"}, -{ 1017, "Init/AC: No databases available for specified userId"}, -{ 1018, "Init/AC: System temporarily out of resources"}, -{ 1019, "Init/AC: System not available due to maintenance" }, -{ 1020, "Init/AC: System temporarily unavailable (Addinfo: when it's expected back up)"}, -{ 1021, "Init/AC: Account has expired"}, -{ 1022, "Init/AC: Password has expired so a new one must be supplied"}, -{ 1023, "Init/AC: Password has been changed by an administrator so a new one must be supplied"}, -{ 1024, "Unsupported Attribute" }, -{ 1025, "Service not supported for this database" }, -{ 1026, "Record cannot be opened because it is locked"}, -{ 1027, "SQL error" }, -{ 1028, "Record deleted" }, -{ 1029, "Scan: too many terms requested. Addinfo: max terms supported" }, -/* 1030 - 1039 /currently unnassigned */ - -/* The following, 1040 - 1047, were approved at the June 1998 ZIG meeting. - These were originally proposed for addition to the Extended Services - diagnostic set. */ -{ 1040, "ES: Invalid function" }, -{ 1041, "ES: Error in retention time" }, -{ 1042, "ES: Permissions data not understood" }, -{ 1043, "ES: Invalid OID for task specific parameters" }, -{ 1044, "ES: Invalid action" }, -{ 1045, "ES: Unknown schema" }, -{ 1046, "ES: Too many records in package" }, -{ 1047, "ES: Invalid wait action" }, -/* The following, 1048 - 1053, were approved at the October 1998 ZIG - meeting. */ -{ 1048, "ES: Cannot create task package -- exceeds maximum permissable size"}, -{ 1049, "ES: Cannot return task package -- exceeds maximum permissable size"}, -{ 1050, "ES: Extended services request too large"}, -{ 1051, "Scan: Attribute set id required -- not supplied"}, -{ 1052, "ES: Cannot process task package record -- exceeds maximum " - "permissible record size for ES" }, -{ 1053, "ES: Cannot return task package record -- exceeds maximum " - "permissible record size for ES response" }, -/* The following, 1054 - 1057, were approved at the March 1999 ZIG - meeting. 1054 and 1055 are added for support of the Model for Z39.50 - Negotiation During Initialization - . 1056 was added in - conjunction with the clarification Single-PDU, Multi-database Searching - -- Status */ -{ 1054, "Init: Required negotiation record not included"}, -{ 1055, "Init: negotiation option required"}, -{ 1056, "Attribute not supported for database" }, -{ 1057, "ES: Unsupported value of task package parameter"}, -/* The following, 1058 - 1066, were approved at the August 1999 ZIG - meeting. 1058 through 1065 are added for support of the Z39.50 Duplicate - Detection Service . */ -{ 1058, "Duplicate Detection: Cannot dedup on requested record portion" }, -{ 1059, "Duplicate Detection: Requested detection criterion not supported" }, -{ 1060, "Duplicate Detection: Requested level of match not supported" }, -{ 1061, "Duplicate Detection: Requested regular expression not supported" }, -{ 1062, "Duplicate Detection: Cannot do clustering" }, -{ 1063, "Duplicate Detection: Retention criterion not supported"}, -{ 1064, "Duplicate Detection: Requested number (or percentage) of entries " - "for retention too large" }, -{ 1065, "Duplicate Detection: Requested sort criterion not supported" }, -{ 1066, "CompSpec: Unknown schema, or schema not supported."}, -/* The following, 1067 - 1069, were approved at the January 2000 ZIG - meeting. 1067 and 1068 are added for support of encapsulation - . */ -{ 1067, "Encapsulation: Encapsulated sequence of PDUs not supported" }, -{ 1068, "Encapsulation: Base operation (and encapsulated PDUs) not executed " - "based on pre-screening analysis" }, -{ 1069, "No syntaxes available for this request" }, -/* The following, 1070-1071, were approved at the July 2000 ZIG meeting. - These are defined in conjunction with the clarification Server Selected - Record Syntax */ -{ 1070, "user not authorized to receive record(s) in requested syntax" }, -{ 1071, "preferredRecordSyntax not supplied" }, -/* The following diagnostic was approved at the October 2001 ZIG meeting. - See http://lists.w3.org/Archives/Public/www-zig/2001Jun/0006.html */ -{ 1072, "Query term includes characters that do not translate into the " - "target character set"}, -{ 0, NULL} -}; - -const char *diagbib1_str (int code) -{ - int i; - for (i=0; msg_tab[i].msg; i++) - if (msg_tab[i].code == code) - return msg_tab[i].msg; - return "Unknown error"; -} diff --git a/zutil/grs1disp.c b/zutil/grs1disp.c deleted file mode 100644 index 21221b5..0000000 --- a/zutil/grs1disp.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2002, Index Data. - * See the file LICENSE for details. - * - * $Id: grs1disp.c,v 1.1 2002-10-22 10:29:58 adam Exp $ - */ - -#include -#include -#include -#include - -#include - -static void display_variant(WRBUF w, Z_Variant *v, int level) -{ - int i; - - for (i = 0; i < v->num_triples; i++) - { - printf("%*sclass=%d,type=%d", level * 4, "", *v->triples[i]->zclass, - *v->triples[i]->type); - if (v->triples[i]->which == Z_Triple_internationalString) - printf(",value=%s\n", v->triples[i]->value.internationalString); - else - printf("\n"); - } -} - -static void display_grs1(WRBUF w, Z_GenericRecord *r, int level) -{ - int i; - - if (!r) - { - return; - } - for (i = 0; i < r->num_elements; i++) - { - Z_TaggedElement *t; - - wrbuf_printf(w, "%*s", level * 4, ""); - t = r->elements[i]; - wrbuf_printf(w, "("); - if (t->tagType) - wrbuf_printf(w, "%d,", *t->tagType); - else - wrbuf_printf(w, "?,"); - if (t->tagValue->which == Z_StringOrNumeric_numeric) - wrbuf_printf(w, "%d) ", *t->tagValue->u.numeric); - else - wrbuf_printf(w, "%s) ", t->tagValue->u.string); - if (t->content->which == Z_ElementData_subtree) - { - if (!t->content->u.subtree) - printf (" (no subtree)\n"); - else - { - wrbuf_printf(w, "\n"); - display_grs1(w, t->content->u.subtree, level+1); - } - } - else if (t->content->which == Z_ElementData_string) - wrbuf_printf(w, "%s\n", t->content->u.string); - else if (t->content->which == Z_ElementData_numeric) - wrbuf_printf(w, "%d\n", *t->content->u.numeric); - else if (t->content->which == Z_ElementData_oid) - { - int *ip = t->content->u.oid; - oident *oent; - - if ((oent = oid_getentbyoid(t->content->u.oid))) - wrbuf_printf(w, "OID: %s\n", oent->desc); - else - { - wrbuf_printf(w, "{"); - while (ip && *ip >= 0) - wrbuf_printf(w, " %d", *(ip++)); - wrbuf_printf(w, " }\n"); - } - } - else if (t->content->which == Z_ElementData_noDataRequested) - wrbuf_printf(w, "[No data requested]\n"); - else if (t->content->which == Z_ElementData_elementEmpty) - wrbuf_printf(w, "[Element empty]\n"); - else if (t->content->which == Z_ElementData_elementNotThere) - wrbuf_printf(w, "[Element not there]\n"); - else if (t->content->which == Z_ElementData_date) - wrbuf_printf(w, "Date: %s\n", t->content->u.date); - else if (t->content->which == Z_ElementData_ext) - { - printf ("External\n"); - /* we cannot print externals here. Srry */ - } - else - wrbuf_printf(w, "? type = %d\n",t->content->which); - if (t->appliedVariant) - display_variant(w, t->appliedVariant, level+1); - if (t->metaData && t->metaData->supportedVariants) - { - int c; - - wrbuf_printf(w, "%*s---- variant list\n", (level+1)*4, ""); - for (c = 0; c < t->metaData->num_supportedVariants; c++) - { - wrbuf_printf(w, "%*svariant #%d\n", (level+1)*4, "", c); - display_variant(w, t->metaData->supportedVariants[c], level+2); - } - } - } -} - -void yaz_display_grs1(WRBUF wrbuf, Z_GenericRecord *r, int flags) -{ - display_grs1 (wrbuf, r, 0); -} - diff --git a/zutil/logrpn.c b/zutil/logrpn.c deleted file mode 100644 index 6da0070..0000000 --- a/zutil/logrpn.c +++ /dev/null @@ -1,368 +0,0 @@ -/* - * Copyright (C) 1995-2003, Index Data - * All rights reserved. - * - * $Id: logrpn.c,v 1.11 2003-02-27 19:56:00 adam Exp $ - */ -#include - -#include -#include - -static const char *relToStr(int v) -{ - const char *str = 0; - switch (v) - { - case 1: str = "Less than"; break; - case 2: str = "Less than or equal"; break; - case 3: str = "Equal"; break; - case 4: str = "Greater or equal"; break; - case 5: str = "Greater than"; break; - case 6: str = "Not equal"; break; - case 100: str = "Phonetic"; break; - case 101: str = "Stem"; break; - case 102: str = "Relevance"; break; - case 103: str = "AlwaysMatches"; break; - } - return str; -} -static void attrStr (int type, int value, enum oid_value ast, char *str) -{ - const char *rstr; - *str = '\0'; - switch (ast) - { - case VAL_BIB1: - case VAL_EXP1: - case VAL_GILS: - switch (type) - { - case 1: - sprintf (str, "use"); - break; - case 2: - rstr = relToStr(value); - if (rstr) - sprintf (str, "relation=%s", rstr); - else - sprintf (str, "relation=%d", value); - break; - case 3: - switch (value) - { - case 1: - sprintf (str, "position=First in field"); - break; - case 2: - sprintf (str, "position=First in any subfield"); - break; - case 3: - sprintf (str, "position=Any position in field"); - break; - default: - sprintf (str, "position"); - } - break; - case 4: - switch (value) - { - case 1: - sprintf (str, "structure=Phrase"); - break; - case 2: - sprintf (str, "structure=Word"); - break; - case 3: - sprintf (str, "structure=Key"); - break; - case 4: - sprintf (str, "structure=Year"); - break; - case 5: - sprintf (str, "structure=Date"); - break; - case 6: - sprintf (str, "structure=Word list"); - break; - case 100: - sprintf (str, "structure=Date (un)"); - break; - case 101: - sprintf (str, "structure=Name (norm)"); - break; - case 102: - sprintf (str, "structure=Name (un)"); - break; - case 103: - sprintf (str, "structure=Structure"); - break; - case 104: - sprintf (str, "structure=urx"); - break; - case 105: - sprintf (str, "structure=free-form-text"); - break; - case 106: - sprintf (str, "structure=document-text"); - break; - case 107: - sprintf (str, "structure=local-number"); - break; - case 108: - sprintf (str, "structure=string"); - break; - case 109: - sprintf (str, "structure=numeric string"); - break; - default: - sprintf (str, "structure"); - } - break; - case 5: - switch (value) - { - case 1: - sprintf (str, "truncation=Right"); - break; - case 2: - sprintf (str, "truncation=Left"); - break; - case 3: - sprintf (str, "truncation=Left&right"); - break; - case 100: - sprintf (str, "truncation=Do not truncate"); - break; - case 101: - sprintf (str, "truncation=Process #"); - break; - case 102: - sprintf (str, "truncation=re-1"); - break; - case 103: - sprintf (str, "truncation=re-2"); - break; - case 104: - sprintf (str, "truncation=CCL"); - break; - default: - sprintf (str, "truncation"); - } - break; - case 6: - switch (value) - { - case 1: - sprintf (str, "completeness=Incomplete subfield"); - break; - case 2: - sprintf (str, "completeness=Complete subfield"); - break; - case 3: - sprintf (str, "completeness=Complete field"); - break; - default: - sprintf (str, "completeness"); - } - break; - } - break; - default: - break; - } - if (*str) - sprintf (str + strlen(str), " (%d=%d)", type, value); - else - sprintf (str, "%d=%d", type, value); -} - -/* - * zlog_attributes: print attributes of term - */ -static void zlog_attributes (Z_AttributesPlusTerm *t, int level, - enum oid_value ast) -{ - int of, i; - char str[80]; - int num_attributes = t->attributes->num_attributes; - - for (of = 0; of < num_attributes; of++) - { - const char *attset_name = ""; - Z_AttributeElement *element; - element = t->attributes->attributes[of]; - if (element->attributeSet) - { - oident *attrset; - attrset = oid_getentbyoid (element->attributeSet); - attset_name = attrset->desc; - } - switch (element->which) - { - case Z_AttributeValue_numeric: - attrStr (*element->attributeType, - *element->value.numeric, ast, str); - yaz_log (LOG_LOG, "%*.0s%s %s", level, "", attset_name, str); - break; - case Z_AttributeValue_complex: - yaz_log (LOG_LOG, "%*.0s%s attributeType=%d complex", - level, "", attset_name, *element->attributeType); - for (i = 0; ivalue.complex->num_list; i++) - { - if (element->value.complex->list[i]->which == - Z_StringOrNumeric_string) - yaz_log (LOG_LOG, "%*.0s string: '%s'", level, "", - element->value.complex->list[i]->u.string); - else if (element->value.complex->list[i]->which == - Z_StringOrNumeric_numeric) - yaz_log (LOG_LOG, "%*.0s numeric: '%d'", level, "", - *element->value.complex->list[i]->u.numeric); - } - break; - default: - yaz_log (LOG_LOG, "%.*s%s attribute unknown", - level, "", attset_name); - } - } -} - -static void zlog_structure (Z_RPNStructure *zs, int level, enum oid_value ast) -{ - if (zs->which == Z_RPNStructure_complex) - { - Z_Operator *op = zs->u.complex->roperator; - const char *rstr = 0; - const char *unit = "private"; - switch (op->which) - { - case Z_Operator_and: - yaz_log (LOG_LOG, "%*.0s and", level, ""); - break; - case Z_Operator_or: - yaz_log (LOG_LOG, "%*.0s or", level, ""); - break; - case Z_Operator_and_not: - yaz_log (LOG_LOG, "%*.0s and-not", level, ""); - break; - case Z_Operator_prox: - if (op->u.prox->which == Z_ProximityOperator_known) - { - switch(*op->u.prox->u.known) - { - case Z_ProxUnit_character: unit = "character"; break; - case Z_ProxUnit_word: unit = "word"; break; - case Z_ProxUnit_sentence: unit = "sentence"; break; - case Z_ProxUnit_paragraph: unit = "paragraph"; break; - case Z_ProxUnit_section: unit = "section"; break; - case Z_ProxUnit_chapter: unit = "chapter"; break; - case Z_ProxUnit_document: unit = "document"; break; - case Z_ProxUnit_element: unit = "element"; break; - case Z_ProxUnit_subelement: unit = "subelement"; break; - case Z_ProxUnit_elementType: unit = "elementType"; break; - case Z_ProxUnit_byte: unit = "byte"; break; - default: unit = "unknown"; break; - } - } - rstr = relToStr(*op->u.prox->relationType); - yaz_log (LOG_LOG, "%*.0s prox excl=%s dist=%d order=%s " - "rel=%s unit=%s", - level, "", op->u.prox->exclusion ? - (*op->u.prox->exclusion ? "T" : "F") : "N", - *op->u.prox->distance, - *op->u.prox->ordered ? "T" : "F", - rstr ? rstr : "unknown", - unit); - break; - default: - yaz_log (LOG_LOG, "%*.0s unknown complex", level, ""); - return; - } - zlog_structure (zs->u.complex->s1, level+2, ast); - zlog_structure (zs->u.complex->s2, level+2, ast); - } - else if (zs->which == Z_RPNStructure_simple) - { - if (zs->u.simple->which == Z_Operand_APT) - { - Z_AttributesPlusTerm *zapt = zs->u.simple->u.attributesPlusTerm; - - switch (zapt->term->which) - { - case Z_Term_general: - yaz_log (LOG_LOG, "%*.0s term '%.*s' (general)", level, "", - zapt->term->u.general->len, - zapt->term->u.general->buf); - break; - case Z_Term_characterString: - yaz_log (LOG_LOG, "%*.0s term '%s' (string)", level, "", - zapt->term->u.characterString); - break; - case Z_Term_numeric: - yaz_log (LOG_LOG, "%*.0s term '%d' (numeric)", level, "", - *zapt->term->u.numeric); - break; - case Z_Term_null: - yaz_log (LOG_LOG, "%*.0s term (null)", level, ""); - break; - default: - yaz_log (LOG_LOG, "%*.0s term (not general)", level, ""); - } - zlog_attributes (zapt, level+2, ast); - } - else if (zs->u.simple->which == Z_Operand_resultSetId) - { - yaz_log (LOG_LOG, "%*.0s set '%s'", level, "", - zs->u.simple->u.resultSetId); - } - else - yaz_log (LOG_LOG, "%*.0s unknown simple structure", level, ""); - } - else - yaz_log (LOG_LOG, "%*.0s unknown structure", level, ""); -} - -void log_rpn_query (Z_RPNQuery *rpn) -{ - oident *attrset; - enum oid_value ast; - - attrset = oid_getentbyoid (rpn->attributeSetId); - if (attrset) - { - ast = attrset->value; - yaz_log (LOG_LOG, "RPN query. Type: %s", attrset->desc); - } - else - { - ast = VAL_NONE; - yaz_log (LOG_LOG, "RPN query. Unknown type"); - } - zlog_structure (rpn->RPNStructure, 0, ast); -} - -void log_scan_term (Z_AttributesPlusTerm *zapt, oid_value ast) -{ - int level = 0; - if (zapt->term->which == Z_Term_general) - { - yaz_log (LOG_LOG, "%*.0s term '%.*s' (general)", level, "", - zapt->term->u.general->len, zapt->term->u.general->buf); - } - else - yaz_log (LOG_LOG, "%*.0s term (not general)", level, ""); - zlog_attributes (zapt, level+2, ast); -} - -void yaz_log_zquery (Z_Query *q) -{ - switch (q->which) - { - case Z_Query_type_1: case Z_Query_type_101: - log_rpn_query (q->u.type_1); - break; - case Z_Query_type_104: - if (q->u.type_104->which == Z_External_CQL) - yaz_log (LOG_LOG, "CQL: %s", q->u.type_104->u.cql); - } -} diff --git a/zutil/opacdisp.c b/zutil/opacdisp.c deleted file mode 100644 index e1dcec2..0000000 --- a/zutil/opacdisp.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2003, Index Data. - * See the file LICENSE for details. - * - * $Id: opacdisp.c,v 1.4 2003-07-30 10:00:27 adam Exp $ - */ - -#include -#include -#include -#include - -#include - -static void opac_element_str(WRBUF wrbuf, int l, const char *elem, - const char *data) -{ - if (data) - { - while (--l >= 0) - wrbuf_puts(wrbuf, " "); - wrbuf_puts(wrbuf, "<"); - wrbuf_puts(wrbuf, elem); - wrbuf_puts(wrbuf, ">"); - wrbuf_xmlputs(wrbuf, data); - wrbuf_puts(wrbuf, "\n"); - } -} - -static void opac_element_bool(WRBUF wrbuf, int l, const char *elem, int *data) -{ - if (data) - { - while (--l >= 0) - wrbuf_puts(wrbuf, " "); - wrbuf_puts(wrbuf, "<"); - wrbuf_puts(wrbuf, elem); - if (*data) - wrbuf_puts(wrbuf, " value=\"1\""); - else - wrbuf_puts(wrbuf, " value=\"0\""); - wrbuf_puts(wrbuf, "/>\n"); - } -} - -void yaz_display_OPAC(WRBUF wrbuf, Z_OPACRecord *r, int flags) -{ - int i; - wrbuf_puts(wrbuf, "\n"); - - for (i = 0; i < r->num_holdingsData; i++) - { - Z_HoldingsRecord *h = r->holdingsData[i]; - wrbuf_puts(wrbuf, " \n"); - - if (h->which == Z_HoldingsRecord_marcHoldingsRecord) - { - wrbuf_puts (wrbuf, " \n"); - /* h->u.marcHoldingsRecord) */ - } - else if (h->which == Z_HoldingsRecord_holdingsAndCirc) - { - int j; - - Z_HoldingsAndCircData *d = h->u.holdingsAndCirc; - - opac_element_str(wrbuf, 2, "typeOfRecord", d->typeOfRecord); - opac_element_str(wrbuf, 2, "encodingLevel", d->encodingLevel); - opac_element_str(wrbuf, 2, "format", d->format); - opac_element_str(wrbuf, 2, "receiptAcqStatus", d->receiptAcqStatus); - opac_element_str (wrbuf, 2, "generalRetention", d->generalRetention); - opac_element_str (wrbuf, 2, "completeness", d->completeness); - opac_element_str (wrbuf, 2, "dateOfReport", d->dateOfReport); - opac_element_str (wrbuf, 2, "nucCode", d->nucCode); - opac_element_str (wrbuf, 2, "localLocation", d->localLocation); - opac_element_str (wrbuf, 2, "shelvingLocation", d->shelvingLocation); - opac_element_str (wrbuf, 2, "callNumber", d->callNumber); - opac_element_str (wrbuf, 2, "copyNumber", d->copyNumber); - opac_element_str (wrbuf, 2, "publicNote", d->publicNote); - opac_element_str (wrbuf, 2, "reproductionNote", d->reproductionNote); - opac_element_str (wrbuf, 2, "termsUseRepro", d->termsUseRepro); - opac_element_str (wrbuf, 2, "enumAndChron", d->enumAndChron); - if (d->num_volumes) - { - wrbuf_puts (wrbuf, " \n"); - for (j = 0; jnum_volumes; j++) - { - wrbuf_puts (wrbuf, " \n"); - opac_element_str (wrbuf, 4, "enumeration", - d->volumes[j]->enumeration); - opac_element_str (wrbuf, 4, "chronology", - d->volumes[j]->chronology); - opac_element_str (wrbuf, 4, "enumAndChron", - d->volumes[j]->enumAndChron); - wrbuf_puts (wrbuf, " \n"); - } - wrbuf_puts (wrbuf, " \n"); - } - if (d->num_circulationData) - { - wrbuf_puts (wrbuf, " \n"); - for (j = 0; jnum_circulationData; j++) - { - wrbuf_puts (wrbuf," \n"); - opac_element_bool (wrbuf, 4, "availableNow", - d->circulationData[j]->availableNow); - opac_element_str (wrbuf, 4, "availabiltyDate", - d->circulationData[j]->availablityDate); - opac_element_str (wrbuf, 4, "availableThru", - d->circulationData[j]->availableThru); - opac_element_str (wrbuf, 4, "restrictions", - d->circulationData[j]->restrictions); - opac_element_str (wrbuf, 4, "itemId", - d->circulationData[j]->itemId); - opac_element_bool (wrbuf, 4, "renewable", - d->circulationData[j]->renewable); - opac_element_bool (wrbuf, 4, "onHold", - d->circulationData[j]->onHold); - opac_element_str (wrbuf, 4, "enumAndChron", - d->circulationData[j]->enumAndChron); - opac_element_str (wrbuf, 4, "midspine", - d->circulationData[j]->midspine); - opac_element_str (wrbuf, 4, "temporaryLocation", - d->circulationData[j]->temporaryLocation); - wrbuf_puts (wrbuf, " \n"); - } - wrbuf_puts (wrbuf, " \n"); - } - } - wrbuf_puts(wrbuf, " \n"); - } - wrbuf_puts(wrbuf, "\n"); -} diff --git a/zutil/otherinfo.c b/zutil/otherinfo.c deleted file mode 100644 index 9ee8550..0000000 --- a/zutil/otherinfo.c +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (c) 1999-2003, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: otherinfo.c,v 1.7 2003-01-06 08:20:29 adam Exp $ - */ - -#include -#include - -#include - -void yaz_oi_APDU(Z_APDU *apdu, Z_OtherInformation ***oip) -{ - switch (apdu->which) - { - case Z_APDU_initRequest: - *oip = &apdu->u.initRequest->otherInfo; - break; - case Z_APDU_searchRequest: - *oip = &apdu->u.searchRequest->otherInfo; - break; - case Z_APDU_presentRequest: - *oip = &apdu->u.presentRequest->otherInfo; - break; - case Z_APDU_sortRequest: - *oip = &apdu->u.sortRequest->otherInfo; - break; - case Z_APDU_scanRequest: - *oip = &apdu->u.scanRequest->otherInfo; - break; - case Z_APDU_extendedServicesRequest: - *oip = &apdu->u.extendedServicesRequest->otherInfo; - break; - case Z_APDU_deleteResultSetRequest: - *oip = &apdu->u.deleteResultSetRequest->otherInfo; - break; - case Z_APDU_initResponse: - *oip = &apdu->u.initResponse->otherInfo; - break; - case Z_APDU_searchResponse: - *oip = &apdu->u.searchResponse->otherInfo; - break; - case Z_APDU_presentResponse: - *oip = &apdu->u.presentResponse->otherInfo; - break; - case Z_APDU_sortResponse: - *oip = &apdu->u.sortResponse->otherInfo; - break; - case Z_APDU_scanResponse: - *oip = &apdu->u.scanResponse->otherInfo; - break; - case Z_APDU_extendedServicesResponse: - *oip = &apdu->u.extendedServicesResponse->otherInfo; - break; - case Z_APDU_deleteResultSetResponse: - *oip = &apdu->u.deleteResultSetResponse->otherInfo; - break; - case Z_APDU_duplicateDetectionRequest: - *oip = &apdu->u.duplicateDetectionRequest->otherInfo; - break; - case Z_APDU_duplicateDetectionResponse: - *oip = &apdu->u.duplicateDetectionResponse->otherInfo; - break; - default: - *oip = 0; - break; - } -} - -Z_OtherInformationUnit *yaz_oi_update ( - Z_OtherInformation **otherInformationP, ODR odr, - int *oid, int categoryValue, int delete_flag) -{ - int i; - Z_OtherInformation *otherInformation; - - if (!otherInformationP) - return 0; - otherInformation = *otherInformationP; - if (!otherInformation) - { - if (!odr) - return 0; - otherInformation = *otherInformationP = (Z_OtherInformation *) - odr_malloc (odr, sizeof(*otherInformation)); - otherInformation->num_elements = 0; - otherInformation->list = 0; - } - for (i = 0; inum_elements; i++) - { - if (!oid) - { - if (!otherInformation->list[i]->category) - return otherInformation->list[i]; - } - else - { - if (otherInformation->list[i]->category && - categoryValue == - *otherInformation->list[i]->category->categoryValue && - !oid_oidcmp (oid, otherInformation->list[i]->category-> - categoryTypeId)) - { - Z_OtherInformationUnit *this_list = otherInformation->list[i]; - - if (delete_flag) - { - (otherInformation->num_elements)--; - while (i < otherInformation->num_elements) - { - otherInformation->list[i] = - otherInformation->list[i+1]; - i++; - } - } - return this_list; - } - } - } - if (!odr) - return 0; - else - { - Z_OtherInformationUnit **newlist = (Z_OtherInformationUnit**) - odr_malloc(odr, (otherInformation->num_elements+1) * - sizeof(*newlist)); - for (i = 0; inum_elements; i++) - newlist[i] = otherInformation->list[i]; - otherInformation->list = newlist; - - otherInformation->list[i] = (Z_OtherInformationUnit*) - odr_malloc (odr, sizeof(Z_OtherInformationUnit)); - if (oid) - { - otherInformation->list[i]->category = (Z_InfoCategory*) - odr_malloc (odr, sizeof(Z_InfoCategory)); - otherInformation->list[i]->category->categoryTypeId = (int*) - odr_oiddup (odr, oid); - otherInformation->list[i]->category->categoryValue = (int*) - odr_malloc (odr, sizeof(int)); - *otherInformation->list[i]->category->categoryValue = - categoryValue; - } - else - otherInformation->list[i]->category = 0; - otherInformation->list[i]->which = Z_OtherInfo_characterInfo; - otherInformation->list[i]->information.characterInfo = 0; - - otherInformation->num_elements = i+1; - return otherInformation->list[i]; - } -} - -void yaz_oi_set_string_oid ( - Z_OtherInformation **otherInformation, ODR odr, - int *oid, int categoryValue, - const char *str) -{ - Z_OtherInformationUnit *oi = - yaz_oi_update(otherInformation, odr, oid, categoryValue, 0); - if (!oi) - return; - oi->which = Z_OtherInfo_characterInfo; - oi->information.characterInfo = odr_strdup (odr, str); -} - -void yaz_oi_set_string_oidval ( - Z_OtherInformation **otherInformation, ODR odr, - int oidval, int categoryValue, - const char *str) -{ - int oid[OID_SIZE]; - struct oident ent; - ent.proto = PROTO_Z3950; - ent.oclass = CLASS_USERINFO; - ent.value = (oid_value) oidval; - if (!oid_ent_to_oid (&ent, oid)) - return ; - yaz_oi_set_string_oid(otherInformation, - odr, oid, categoryValue, str); -} - -char *yaz_oi_get_string_oid ( - Z_OtherInformation **otherInformation, - int *oid, int categoryValue, int delete_flag) -{ - Z_OtherInformationUnit *oi; - - if ((oi = yaz_oi_update(otherInformation, 0, oid, 1, delete_flag)) && - oi->which == Z_OtherInfo_characterInfo) - return oi->information.characterInfo; - return 0; -} - -char *yaz_oi_get_string_oidval(Z_OtherInformation **otherInformation, - int oidval, int categoryValue, int delete_flag) -{ - int oid[OID_SIZE]; - struct oident ent; - ent.proto = PROTO_Z3950; - ent.oclass = CLASS_USERINFO; - ent.value = (oid_value) oidval; - - if (!oid_ent_to_oid (&ent, oid)) - return 0; - return yaz_oi_get_string_oid (otherInformation, oid, categoryValue, - delete_flag); -} - diff --git a/zutil/pquery.c b/zutil/pquery.c deleted file mode 100644 index 2840557..0000000 --- a/zutil/pquery.c +++ /dev/null @@ -1,817 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data. - * See the file LICENSE for details. - * - * $Id: pquery.c,v 1.20 2003-01-06 08:20:29 adam Exp $ - */ - -#include -#include -#include -#include - -#include -#include -#include - -static oid_value p_query_dfset = VAL_NONE; - -struct yaz_pqf_parser { - const char *query_buf; - const char *query_ptr; - const char *lex_buf; - size_t lex_len; - int query_look; - char *left_sep; - char *right_sep; - int escape_char; - int term_type; - int external_type; - int error; -}; - -static Z_RPNStructure *rpn_structure (struct yaz_pqf_parser *li, ODR o, - oid_proto, - int num_attr, int max_attr, - int *attr_list, char **attr_clist, - oid_value *attr_set); - -static enum oid_value query_oid_getvalbyname (struct yaz_pqf_parser *li) -{ - enum oid_value value; - char buf[32]; - - if (li->lex_len > 31) - return VAL_NONE; - memcpy (buf, li->lex_buf, li->lex_len); - buf[li->lex_len] = '\0'; - value = oid_getvalbyname (buf); - return value; -} - -static int compare_term (struct yaz_pqf_parser *li, const char *src, - size_t off) -{ - size_t len=strlen(src); - - if (li->lex_len == len+off && !memcmp (li->lex_buf+off, src, len-off)) - return 1; - return 0; -} - -static int query_token (struct yaz_pqf_parser *li) -{ - int sep_char = ' '; - const char *sep_match; - const char **qptr = &li->query_ptr; - - while (**qptr == ' ') - (*qptr)++; - if (**qptr == '\0') - return 0; - li->lex_len = 0; - if ((sep_match = strchr (li->left_sep, **qptr))) - { - sep_char = li->right_sep[sep_match - li->left_sep]; - ++(*qptr); - } - li->lex_buf = *qptr; - - if (**qptr == li->escape_char && isdigit ((*qptr)[1])) - { - ++(li->lex_len); - ++(*qptr); - return 'l'; - } - while (**qptr && **qptr != sep_char) - { - if (**qptr == '\\') - { - ++(li->lex_len); - ++(*qptr); - } - ++(li->lex_len); - ++(*qptr); - } - if (**qptr) - ++(*qptr); - if (sep_char == ' ' && - li->lex_len >= 1 && li->lex_buf[0] == li->escape_char) - { - if (compare_term (li, "and", 1)) - return 'a'; - if (compare_term (li, "or", 1)) - return 'o'; - if (compare_term (li, "not", 1)) - return 'n'; - if (compare_term (li, "attr", 1)) - return 'l'; - if (compare_term (li, "set", 1)) - return 's'; - if (compare_term (li, "attrset", 1)) - return 'r'; - if (compare_term (li, "prox", 1)) - return 'p'; - if (compare_term (li, "term", 1)) - return 'y'; - } - return 't'; -} - -static int lex (struct yaz_pqf_parser *li) -{ - return li->query_look = query_token (li); -} - -static int escape_string(char *out_buf, const char *in, int len) -{ - - char *out = out_buf; - while (--len >= 0) - if (*in == '\\' && len > 0) - { - --len; - switch (*++in) - { - case 't': - *out++ = '\t'; - break; - case 'n': - *out++ = '\n'; - break; - case 'r': - *out++ = '\r'; - break; - case 'f': - *out++ = '\f'; - break; - case 'x': - if (len > 1) - { - char s[4]; - int n = 0; - s[0] = *++in; - s[1] = *++in; - s[2] = '\0'; - len = len - 2; - sscanf (s, "%x", &n); - *out++ = n; - } - break; - case '0': - case '1': - case '2': - case '3': - if (len > 1) - { - char s[4]; - int n = 0; - s[0] = *in; - s[1] = *++in; - s[2] = *++in; - s[3] = '\0'; - len = len - 2; - sscanf (s, "%o", &n); - *out++ = n; - } - break; - default: - *out++ = *in; - break; - } - in++; - } - else - *out++ = *in++; - return out - out_buf; -} - -static int p_query_parse_attr(struct yaz_pqf_parser *li, ODR o, - int num_attr, int *attr_list, - char **attr_clist, oid_value *attr_set) -{ - const char *cp; - if (!(cp = strchr (li->lex_buf, '=')) || - (size_t) (cp-li->lex_buf) > li->lex_len) - { - attr_set[num_attr] = query_oid_getvalbyname (li); - if (attr_set[num_attr] == VAL_NONE) - { - li->error = YAZ_PQF_ERROR_ATTSET; - return 0; - } - if (!lex (li)) - { - li->error = YAZ_PQF_ERROR_MISSING; - return 0; - } - if (!(cp = strchr (li->lex_buf, '='))) - { - li->error = YAZ_PQF_ERROR_BADATTR; - return 0; - } - } - else - { - if (num_attr > 0) - attr_set[num_attr] = attr_set[num_attr-1]; - else - attr_set[num_attr] = VAL_NONE; - } - attr_list[2*num_attr] = atoi(li->lex_buf); - cp++; - if (*cp >= '0' && *cp <= '9') - { - attr_list[2*num_attr+1] = atoi (cp); - attr_clist[num_attr] = 0; - } - else - { - int len = li->lex_len - (cp - li->lex_buf); - attr_list[2*num_attr+1] = 0; - attr_clist[num_attr] = (char *) odr_malloc (o, len+1); - len = escape_string(attr_clist[num_attr], cp, len); - attr_clist[num_attr][len] = '\0'; - } - return 1; -} - -static Z_AttributesPlusTerm *rpn_term (struct yaz_pqf_parser *li, ODR o, - oid_proto proto, - int num_attr, int *attr_list, - char **attr_clist, oid_value *attr_set) -{ - Z_AttributesPlusTerm *zapt; - Odr_oct *term_octet; - Z_Term *term; - Z_AttributeElement **elements; - - zapt = (Z_AttributesPlusTerm *)odr_malloc (o, sizeof(*zapt)); - term_octet = (Odr_oct *)odr_malloc (o, sizeof(*term_octet)); - term = (Z_Term *)odr_malloc (o, sizeof(*term)); - - if (!num_attr) - elements = (Z_AttributeElement**)odr_nullval(); - else - { - int i, k = 0; - int *attr_tmp; - - elements = (Z_AttributeElement**) - odr_malloc (o, num_attr * sizeof(*elements)); - - attr_tmp = (int *)odr_malloc (o, num_attr * 2 * sizeof(int)); - memcpy (attr_tmp, attr_list, num_attr * 2 * sizeof(int)); - for (i = num_attr; --i >= 0; ) - { - int j; - for (j = i+1; jattributeType = &attr_tmp[2*i]; - elements[k]->attributeSet = - yaz_oidval_to_z3950oid(o, CLASS_ATTSET, attr_set[i]); - - if (attr_clist[i]) - { - elements[k]->which = Z_AttributeValue_complex; - elements[k]->value.complex = (Z_ComplexAttribute *) - odr_malloc (o, sizeof(Z_ComplexAttribute)); - elements[k]->value.complex->num_list = 1; - elements[k]->value.complex->list = - (Z_StringOrNumeric **) - odr_malloc (o, 1 * sizeof(Z_StringOrNumeric *)); - elements[k]->value.complex->list[0] = - (Z_StringOrNumeric *) - odr_malloc (o, sizeof(Z_StringOrNumeric)); - elements[k]->value.complex->list[0]->which = - Z_StringOrNumeric_string; - elements[k]->value.complex->list[0]->u.string = - attr_clist[i]; - elements[k]->value.complex->semanticAction = (int **) - odr_nullval(); - elements[k]->value.complex->num_semanticAction = 0; - } - else - { - elements[k]->which = Z_AttributeValue_numeric; - elements[k]->value.numeric = &attr_tmp[2*i+1]; - } - k++; - } - num_attr = k; - } - zapt->attributes = (Z_AttributeList *) - odr_malloc (o, sizeof(*zapt->attributes)); - zapt->attributes->num_attributes = num_attr; - zapt->attributes->attributes = elements; - - zapt->term = term; - - term_octet->buf = (unsigned char *)odr_malloc (o, 1 + li->lex_len); - term_octet->size = term_octet->len = - escape_string ((char *) (term_octet->buf), li->lex_buf, li->lex_len); - term_octet->buf[term_octet->size] = 0; /* null terminate */ - - switch (li->term_type) - { - case Z_Term_general: - term->which = Z_Term_general; - term->u.general = term_octet; - break; - case Z_Term_characterString: - term->which = Z_Term_characterString; - term->u.characterString = (char*) term_octet->buf; - /* null terminated above */ - break; - case Z_Term_numeric: - term->which = Z_Term_numeric; - term->u.numeric = odr_intdup (o, atoi((char*) (term_octet->buf))); - break; - case Z_Term_null: - term->which = Z_Term_null; - term->u.null = odr_nullval(); - break; - case Z_Term_external: - term->which = Z_Term_external; - term->u.external = 0; - break; - default: - term->which = Z_Term_null; - term->u.null = odr_nullval(); - break; - } - return zapt; -} - -static Z_Operand *rpn_simple (struct yaz_pqf_parser *li, ODR o, oid_proto proto, - int num_attr, int *attr_list, char **attr_clist, - oid_value *attr_set) -{ - Z_Operand *zo; - - zo = (Z_Operand *)odr_malloc (o, sizeof(*zo)); - switch (li->query_look) - { - case 't': - zo->which = Z_Operand_APT; - if (!(zo->u.attributesPlusTerm = - rpn_term (li, o, proto, num_attr, attr_list, attr_clist, - attr_set))) - return 0; - lex (li); - break; - case 's': - lex (li); - if (!li->query_look) - { - li->error = YAZ_PQF_ERROR_MISSING; - return 0; - } - zo->which = Z_Operand_resultSetId; - zo->u.resultSetId = (char *)odr_malloc (o, li->lex_len+1); - memcpy (zo->u.resultSetId, li->lex_buf, li->lex_len); - zo->u.resultSetId[li->lex_len] = '\0'; - lex (li); - break; - default: - /* we're only called if one of the above types are seens so - this shouldn't happen */ - li->error = YAZ_PQF_ERROR_INTERNAL; - return 0; - } - return zo; -} - -static Z_ProximityOperator *rpn_proximity (struct yaz_pqf_parser *li, ODR o) -{ - Z_ProximityOperator *p = (Z_ProximityOperator *)odr_malloc (o, sizeof(*p)); - - if (!lex (li)) - { - li->error = YAZ_PQF_ERROR_MISSING; - return NULL; - } - if (*li->lex_buf == '1') - { - p->exclusion = (int *)odr_malloc (o, sizeof(*p->exclusion)); - *p->exclusion = 1; - } - else if (*li->lex_buf == '0') - { - p->exclusion = (int *)odr_malloc (o, sizeof(*p->exclusion)); - *p->exclusion = 0; - } - else - p->exclusion = NULL; - - if (!lex (li)) - { - li->error = YAZ_PQF_ERROR_MISSING; - return NULL; - } - p->distance = (int *)odr_malloc (o, sizeof(*p->distance)); - *p->distance = atoi (li->lex_buf); - - if (!lex (li)) - { - li->error = YAZ_PQF_ERROR_MISSING; - return NULL; - } - p->ordered = (int *)odr_malloc (o, sizeof(*p->ordered)); - *p->ordered = atoi (li->lex_buf); - - if (!lex (li)) - { - li->error = YAZ_PQF_ERROR_MISSING; - return NULL; - } - p->relationType = (int *)odr_malloc (o, sizeof(*p->relationType)); - *p->relationType = atoi (li->lex_buf); - - if (!lex (li)) - { - li->error = YAZ_PQF_ERROR_MISSING; - return NULL; - } - if (*li->lex_buf == 'k') - p->which = 0; - else if (*li->lex_buf == 'p') - p->which = 1; - else - p->which = atoi (li->lex_buf); - - if (!lex (li)) - { - li->error = YAZ_PQF_ERROR_MISSING; - return NULL; - } - p->which = Z_ProximityOperator_known; - p->u.known = (int *)odr_malloc (o, sizeof(*p->u.known)); - *p->u.known = atoi (li->lex_buf); - return p; -} - -static Z_Complex *rpn_complex (struct yaz_pqf_parser *li, ODR o, oid_proto proto, - int num_attr, int max_attr, - int *attr_list, char **attr_clist, - oid_value *attr_set) -{ - Z_Complex *zc; - Z_Operator *zo; - - zc = (Z_Complex *)odr_malloc (o, sizeof(*zc)); - zo = (Z_Operator *)odr_malloc (o, sizeof(*zo)); - zc->roperator = zo; - switch (li->query_look) - { - case 'a': - zo->which = Z_Operator_and; - zo->u.and_not = odr_nullval(); - break; - case 'o': - zo->which = Z_Operator_or; - zo->u.and_not = odr_nullval(); - break; - case 'n': - zo->which = Z_Operator_and_not; - zo->u.and_not = odr_nullval(); - break; - case 'p': - zo->which = Z_Operator_prox; - zo->u.prox = rpn_proximity (li, o); - if (!zo->u.prox) - return NULL; - break; - default: - /* we're only called if one of the above types are seens so - this shouldn't happen */ - li->error = YAZ_PQF_ERROR_INTERNAL; - return NULL; - } - lex (li); - if (!(zc->s1 = - rpn_structure (li, o, proto, num_attr, max_attr, attr_list, - attr_clist, attr_set))) - return NULL; - if (!(zc->s2 = - rpn_structure (li, o, proto, num_attr, max_attr, attr_list, - attr_clist, attr_set))) - return NULL; - return zc; -} - -static void rpn_term_type (struct yaz_pqf_parser *li, ODR o) -{ - if (!li->query_look) - return ; - if (compare_term (li, "general", 0)) - li->term_type = Z_Term_general; - else if (compare_term (li, "numeric", 0)) - li->term_type = Z_Term_numeric; - else if (compare_term (li, "string", 0)) - li->term_type = Z_Term_characterString; - else if (compare_term (li, "oid", 0)) - li->term_type = Z_Term_oid; - else if (compare_term (li, "datetime", 0)) - li->term_type = Z_Term_dateTime; - else if (compare_term (li, "null", 0)) - li->term_type = Z_Term_null; - else if (compare_term(li, "range", 0)) - { - /* prepare for external: range search .. */ - li->term_type = Z_Term_external; - li->external_type = VAL_MULTISRCH2; - } - lex (li); -} - -static Z_RPNStructure *rpn_structure (struct yaz_pqf_parser *li, ODR o, - oid_proto proto, - int num_attr, int max_attr, - int *attr_list, - char **attr_clist, - oid_value *attr_set) -{ - Z_RPNStructure *sz; - - sz = (Z_RPNStructure *)odr_malloc (o, sizeof(*sz)); - switch (li->query_look) - { - case 'a': - case 'o': - case 'n': - case 'p': - sz->which = Z_RPNStructure_complex; - if (!(sz->u.complex = - rpn_complex (li, o, proto, num_attr, max_attr, attr_list, - attr_clist, attr_set))) - return NULL; - break; - case 't': - case 's': - sz->which = Z_RPNStructure_simple; - if (!(sz->u.simple = - rpn_simple (li, o, proto, num_attr, attr_list, - attr_clist, attr_set))) - return NULL; - break; - case 'l': - lex (li); - if (!li->query_look) - { - li->error = YAZ_PQF_ERROR_MISSING; - return 0; - } - if (num_attr >= max_attr) - { - li->error = YAZ_PQF_ERROR_TOOMANY; - return 0; - } - if (!p_query_parse_attr(li, o, num_attr, attr_list, - attr_clist, attr_set)) - return 0; - num_attr++; - lex (li); - return - rpn_structure (li, o, proto, num_attr, max_attr, attr_list, - attr_clist, attr_set); - case 'y': - lex (li); - rpn_term_type (li, o); - return - rpn_structure (li, o, proto, num_attr, max_attr, attr_list, - attr_clist, attr_set); - case 0: /* operator/operand expected! */ - li->error = YAZ_PQF_ERROR_MISSING; - return 0; - } - return sz; -} - -Z_RPNQuery *p_query_rpn_mk (ODR o, struct yaz_pqf_parser *li, oid_proto proto, - const char *qbuf) -{ - Z_RPNQuery *zq; - int attr_array[1024]; - char *attr_clist[512]; - oid_value attr_set[512]; - oid_value topSet = VAL_NONE; - - zq = (Z_RPNQuery *)odr_malloc (o, sizeof(*zq)); - lex (li); - if (li->query_look == 'r') - { - lex (li); - topSet = query_oid_getvalbyname (li); - if (topSet == VAL_NONE) - { - li->error = YAZ_PQF_ERROR_ATTSET; - return NULL; - } - - lex (li); - } - if (topSet == VAL_NONE) - topSet = p_query_dfset; - if (topSet == VAL_NONE) - topSet = VAL_BIB1; - - zq->attributeSetId = yaz_oidval_to_z3950oid(o, CLASS_ATTSET, topSet); - - if (!zq->attributeSetId) - { - li->error = YAZ_PQF_ERROR_ATTSET; - return 0; - } - - if (!(zq->RPNStructure = rpn_structure (li, o, proto, 0, 512, - attr_array, attr_clist, attr_set))) - return 0; - if (li->query_look) - { - li->error = YAZ_PQF_ERROR_EXTRA; - return 0; - } - return zq; -} - -Z_RPNQuery *p_query_rpn (ODR o, oid_proto proto, - const char *qbuf) -{ - struct yaz_pqf_parser li; - - li.error = 0; - li.left_sep = "{\""; - li.right_sep = "}\""; - li.escape_char = '@'; - li.term_type = Z_Term_general; - li.query_buf = li.query_ptr = qbuf; - li.lex_buf = 0; - return p_query_rpn_mk (o, &li, proto, qbuf); -} - - -Z_AttributesPlusTerm *p_query_scan_mk (struct yaz_pqf_parser *li, - ODR o, oid_proto proto, - Odr_oid **attributeSetP, - const char *qbuf) -{ - int attr_list[1024]; - char *attr_clist[512]; - oid_value attr_set[512]; - int num_attr = 0; - int max_attr = 512; - oid_value topSet = VAL_NONE; - Z_AttributesPlusTerm *apt; - - lex (li); - if (li->query_look == 'r') - { - lex (li); - topSet = query_oid_getvalbyname (li); - - lex (li); - } - if (topSet == VAL_NONE) - topSet = p_query_dfset; - if (topSet == VAL_NONE) - topSet = VAL_BIB1; - - *attributeSetP = yaz_oidval_to_z3950oid (o, CLASS_ATTSET, topSet); - - while (1) - { - if (li->query_look == 'l') - { - lex (li); - if (!li->query_look) - { - li->error = YAZ_PQF_ERROR_MISSING; - return 0; - } - if (num_attr >= max_attr) - { - li->error = YAZ_PQF_ERROR_TOOMANY; - return 0; - } - if (!p_query_parse_attr(li, o, num_attr, attr_list, - attr_clist, attr_set)) - return 0; - num_attr++; - lex (li); - } - else if (li->query_look == 'y') - { - lex (li); - rpn_term_type (li, o); - } - else - break; - } - if (!li->query_look) - { - li->error = YAZ_PQF_ERROR_MISSING; - return 0; - } - apt = rpn_term (li, o, proto, num_attr, attr_list, attr_clist, attr_set); - - lex (li); - - if (li->query_look != 0) - { - li->error = YAZ_PQF_ERROR_EXTRA; - return 0; - } - return apt; -} - -Z_AttributesPlusTerm *p_query_scan (ODR o, oid_proto proto, - Odr_oid **attributeSetP, - const char *qbuf) -{ - struct yaz_pqf_parser li; - - li.error = 0; - li.left_sep = "{\""; - li.right_sep = "}\""; - li.escape_char = '@'; - li.term_type = Z_Term_general; - li.query_buf = li.query_ptr = qbuf; - li.lex_buf = 0; - - return p_query_scan_mk (&li, o, proto, attributeSetP, qbuf); -} - -int p_query_attset (const char *arg) -{ - p_query_dfset = oid_getvalbyname (arg); - return (p_query_dfset == VAL_NONE) ? -1 : 0; -} - -YAZ_PQF_Parser yaz_pqf_create (void) -{ - YAZ_PQF_Parser p = (YAZ_PQF_Parser) xmalloc (sizeof(*p)); - - p->error = 0; - p->left_sep = "{\""; - p->right_sep = "}\""; - p->escape_char = '@'; - p->term_type = Z_Term_general; - - return p; -} - -void yaz_pqf_destroy (YAZ_PQF_Parser p) -{ - xfree (p); -} - -Z_RPNQuery *yaz_pqf_parse (YAZ_PQF_Parser p, ODR o, const char *qbuf) -{ - if (!p) - return 0; - p->query_buf = p->query_ptr = qbuf; - p->lex_buf = 0; - return p_query_rpn_mk (o, p, PROTO_Z3950, qbuf); -} - -Z_AttributesPlusTerm *yaz_pqf_scan (YAZ_PQF_Parser p, ODR o, - Odr_oid **attributeSetP, - const char *qbuf) -{ - if (!p) - return 0; - p->query_buf = p->query_ptr = qbuf; - p->lex_buf = 0; - return p_query_scan_mk (p, o, PROTO_Z3950, attributeSetP, qbuf); -} - -int yaz_pqf_error (YAZ_PQF_Parser p, const char **msg, size_t *off) -{ - switch (p->error) - { - case YAZ_PQF_ERROR_NONE: - *msg = "no error"; break; - case YAZ_PQF_ERROR_EXTRA: - *msg = "extra token"; break; - case YAZ_PQF_ERROR_MISSING: - *msg = "missing token"; break; - case YAZ_PQF_ERROR_ATTSET: - *msg = "unknown attribute set"; break; - case YAZ_PQF_ERROR_TOOMANY: - *msg = "too many attributes"; break; - case YAZ_PQF_ERROR_BADATTR: - *msg = "bad attribute specification"; break; - case YAZ_PQF_ERROR_INTERNAL: - *msg = "internal error"; break; - default: - *msg = "unknown error"; break; - } - *off = p->query_ptr - p->query_buf; - return p->error; -} diff --git a/zutil/query.c b/zutil/query.c deleted file mode 100644 index a3b8338..0000000 --- a/zutil/query.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 1995-2001, Index Data - * See the file LICENSE for details. - * - * $Id: query.c,v 1.4 2001-11-13 23:00:43 adam Exp $ - */ - -#include -#include -#include - -#include -#include - -static Z_Complex *makecomplex(ODR o, char **buf); -static Z_Operand *makesimple(ODR o, char **buf); -Z_RPNStructure *makerpn(ODR o, char **buf); - -void skip_spaces(char**p) -{ - while (**p && isspace(**p)) - (*p)++; -} - -static Z_Operand *makesimple(ODR o, char **buf) -{ - Z_Operand *r; - Z_AttributesPlusTerm *t; - char *b; - - r = odr_malloc(o, sizeof(*r)); - if (**buf == 's' && *((*buf) + 1) == '=') - { - char *b = odr_malloc(o, 100); - - r->which = Z_Operand_resultSetId; - r->u.resultSetId = b; - (*buf)++; - (*buf)++; - while (**buf && !isspace(**buf)) - *(b++) = *((*buf)++); - *b = 0; - return r; - } - else if (**buf != '"') - return 0; - (*buf)++; - r->which = Z_Operand_APT; - r->u.attributesPlusTerm = t = odr_malloc(o, sizeof(*t)); - t->attributes = odr_malloc(o, sizeof(*t)); - t->attributes->num_attributes = 0; - t->attributes->attributes = 0; - t->term = odr_malloc(o, sizeof(*t->term)); - t->term->which = Z_Term_general; - t->term->u.general = odr_malloc(o, sizeof(Odr_oct)); - t->term->u.general->buf = odr_malloc(o, 100); - t->term->u.general->size = 100; - t->term->u.general->len = 0; - b = (char*) t->term->u.general->buf; - while (**buf && **buf != '"') - { - *(b++) = *((*buf)++); - t->term->u.general->len++; - } - if (**buf != '"') - return 0; - (*buf)++; - return r; -} - -static Z_Complex *makecomplex(ODR o, char **buf) -{ - Z_Complex *r; - char op[100], *b; - - r = odr_malloc(o, sizeof(*r)); - r->roperator = odr_malloc(o, sizeof(*r->roperator)); - - b = op; - while (**buf && !isspace(**buf)) - *(b++) = *((*buf)++); - *b = 0; - if (!strcmp(op, "and")) - r->roperator->which = Z_Operator_and; - else if (!strcmp(op, "or")) - r->roperator->which = Z_Operator_or; - else if (!strcmp(op, "not")) - r->roperator->which = Z_Operator_and_not; - r->roperator->u.and = ""; - while (**buf && !isspace(**buf)) - (*buf)++; - if (!(r->s1 = makerpn(o, buf))) - return 0; - if (!(r->s2 = makerpn(o, buf))) - return 0; - return r; -} - -Z_RPNStructure *makerpn(ODR o, char **buf) -{ - Z_RPNStructure *r; - - r = odr_malloc(o, sizeof(*r)); - skip_spaces(buf); - if (**buf == '"' || **buf == 's') - { - r->which = Z_RPNStructure_simple; - if (!(r->u.simple = makesimple(o, buf))) - return 0; - return r; - } - r->which = Z_RPNStructure_complex; - if (!(r->u.complex = makecomplex(o, buf))) - return 0; - return r; -} diff --git a/zutil/soap.c b/zutil/soap.c deleted file mode 100644 index 2fbbc17..0000000 --- a/zutil/soap.c +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 2002-2003, Index Data. - * See the file LICENSE for details. - * - * $Id: soap.c,v 1.9 2003-04-23 20:36:05 adam Exp $ - */ - -#include - -#if HAVE_XML2 -#include -#include - -static const char *soap_v1_1 = "http://schemas.xmlsoap.org/soap/envelope/"; -static const char *soap_v1_2 = "http://www.w3.org/2001/06/soap-envelope"; - -int z_soap_error(ODR o, Z_SOAP *p, - const char *fault_code, const char *fault_string, - const char *details) -{ - p->which = Z_SOAP_error; - p->u.soap_error = (Z_SOAP_Fault *) - odr_malloc(o, sizeof(*p->u.soap_error)); - p->u.soap_error->fault_code = odr_strdup(o, fault_code); - p->u.soap_error->fault_string = odr_strdup(o, fault_string); - if (details) - p->u.soap_error->details = odr_strdup(o, details); - else - p->u.soap_error->details = 0; - return -1; -} - -int z_soap_codec_enc(ODR o, Z_SOAP **pp, - char **content_buf, int *content_len, - Z_SOAP_Handler *handlers, - const char *encoding) -{ - if (o->direction == ODR_DECODE) - { - Z_SOAP *p; - xmlNodePtr ptr, pptr; - xmlDocPtr doc; - int i, ret; - - if (!content_buf || !*content_buf || !content_len) - return -1; - - *pp = p = (Z_SOAP *) odr_malloc(o, sizeof(*p)); - p->ns = soap_v1_1; - - doc = xmlParseMemory(*content_buf, *content_len); - if (!doc) - return z_soap_error(o, p, "SOAP-ENV:Client", - "Bad XML Document", 0); - /* check that root node is Envelope */ - ptr = xmlDocGetRootElement(doc); - if (!ptr || ptr->type != XML_ELEMENT_NODE || - strcmp(ptr->name, "Envelope") || !ptr->ns) - { - xmlFreeDoc(doc); - return z_soap_error(o, p, "SOAP-ENV:Client", - "No Envelope element", 0); - } - else - { - /* determine SOAP version */ - const char * ns_envelope = ptr->ns->href; - if (!strcmp(ns_envelope, soap_v1_1)) - p->ns = soap_v1_1; - else if (!strcmp(ns_envelope, soap_v1_2)) - p->ns = soap_v1_2; - else - { - xmlFreeDoc(doc); - return z_soap_error(o, p, "SOAP-ENV:Client", - "Bad SOAP version", 0); - } - } - ptr = ptr->children; - while(ptr && ptr->type == XML_TEXT_NODE) - ptr = ptr->next; - if (ptr && ptr->type == XML_ELEMENT_NODE && - !strcmp(ptr->ns->href, p->ns) && - !strcmp(ptr->name, "Header")) - { - ptr = ptr->next; - while(ptr && ptr->type == XML_TEXT_NODE) - ptr = ptr->next; - } - /* check that Body is present */ - if (!ptr || ptr->type != XML_ELEMENT_NODE || - strcmp(ptr->name, "Body")) - { - xmlFreeDoc(doc); - return z_soap_error(o, p, "SOAP-ENV:Client", - "SOAP Body element not found", 0); - } - if (strcmp(ptr->ns->href, p->ns)) - { - xmlFreeDoc(doc); - return z_soap_error(o, p, "SOAP-ENV:Client", - "SOAP bad NS for Body element", 0); - } - pptr = ptr; - ptr = ptr->children; - while (ptr && ptr->type == XML_TEXT_NODE) - ptr = ptr->next; - if (!ptr || ptr->type != XML_ELEMENT_NODE) - { - xmlFreeDoc(doc); - return z_soap_error(o, p, "SOAP-ENV:Client", - "SOAP No content for Body", 0); - } - /* check for fault package */ - if (!strcmp(ptr->ns->href, p->ns) - && !strcmp(ptr->name, "Fault") && ptr->children) - { - ptr = ptr->children; - - p->which = Z_SOAP_fault; - p->u.fault = odr_malloc(o, sizeof(*p->u.fault)); - p->u.fault->fault_code = 0; - p->u.fault->fault_string = 0; - p->u.fault->details = 0; - while (ptr) - { - if (ptr->children && ptr->children->type == XML_TEXT_NODE) - { - if (!strcmp(ptr->name, "faultcode")) - p->u.fault->fault_code = - odr_strdup(o, ptr->children->content); - if (!strcmp(ptr->name, "faultstring")) - p->u.fault->fault_string = - odr_strdup(o, ptr->children->content); - if (!strcmp(ptr->name, "details")) - p->u.fault->details = - odr_strdup(o, ptr->children->content); - } - ptr = ptr->next; - } - ret = 0; - } - else - { - for (i = 0; handlers[i].ns; i++) - if (!strcmp(ptr->ns->href, handlers[i].ns)) - break; - if (handlers[i].ns) - { - void *handler_data = 0; - ret = (*handlers[i].f)(o, pptr, &handler_data, - handlers[i].client_data, - handlers[i].ns); - if (ret || !handler_data) - z_soap_error(o, p, "SOAP-ENV:Client", - "SOAP Handler returned error", 0); - else - { - p->which = Z_SOAP_generic; - p->u.generic = odr_malloc(o, sizeof(*p->u.generic)); - p->u.generic->no = i; - p->u.generic->ns = handlers[i].ns; - p->u.generic->p = handler_data; - } - } - else - { - ret = z_soap_error(o, p, "SOAP-ENV:Client", - "No handler for NS", ptr->ns->href); - } - } - xmlFreeDoc(doc); - return ret; - } - else if (o->direction == ODR_ENCODE) - { - Z_SOAP *p = *pp; - xmlNsPtr ns_env; - xmlNodePtr envelope_ptr, body_ptr; - - xmlDocPtr doc = xmlNewDoc("1.0"); - - envelope_ptr = xmlNewNode(0, "Envelope"); - ns_env = xmlNewNs(envelope_ptr, p->ns, "SOAP-ENV"); - xmlSetNs(envelope_ptr, ns_env); - - body_ptr = xmlNewChild(envelope_ptr, ns_env, "Body", 0); - xmlDocSetRootElement(doc, envelope_ptr); - - if (p->which == Z_SOAP_fault || p->which == Z_SOAP_error) - { - Z_SOAP_Fault *f = p->u.fault; - xmlNodePtr fault_ptr = xmlNewChild(body_ptr, ns_env, "Fault", 0); - xmlNewChild(fault_ptr, ns_env, "faultcode", f->fault_code); - xmlNewChild(fault_ptr, ns_env, "faultstring", f->fault_string); - if (f->details) - xmlNewChild(fault_ptr, ns_env, "details", f->details); - } - else if (p->which == Z_SOAP_generic) - { - int ret, no = p->u.generic->no; - - ret = (*handlers[no].f)(o, body_ptr, &p->u.generic->p, - handlers[no].client_data, - handlers[no].ns); - if (ret) - return ret; - } - if (p->which == Z_SOAP_generic && !strcmp(p->ns, "SRU")) - { - xmlDocSetRootElement(doc, body_ptr->children); - } - if (1) - { - xmlChar *buf_out; - int len_out; - if (encoding) - xmlDocDumpMemoryEnc(doc, &buf_out, &len_out, encoding); - else - xmlDocDumpMemory(doc, &buf_out, &len_out); - *content_buf = (char *) odr_malloc(o, len_out); - *content_len = len_out; - memcpy(*content_buf, buf_out, len_out); - xmlFree(buf_out); - } - xmlFreeDoc(doc); - return 0; - } - return 0; -} -#else -int z_soap_codec_enc(ODR o, Z_SOAP **pp, - char **content_buf, int *content_len, - Z_SOAP_Handler *handlers, const char *encoding) -{ - static char *err_xml = - "\n" - "\n" - "\t\n" - "\t\t\n" - "\t\t\tSOAP-ENV:Server\n" - "\t\t\tHTTP error\n" - "\t\t\tSOAP not supported in this YAZ configuration\n" - "\t\t\n" - "\t\n" - "\n"; - if (o->direction == ODR_ENCODE) - { - *content_buf = err_xml; - *content_len = strlen(err_xml); - } - return -1; -} -#endif -int z_soap_codec(ODR o, Z_SOAP **pp, - char **content_buf, int *content_len, - Z_SOAP_Handler *handlers) -{ - return z_soap_codec_enc(o, pp, content_buf, content_len, handlers, 0); -} - diff --git a/zutil/sortspec.c b/zutil/sortspec.c deleted file mode 100644 index 3ffee80..0000000 --- a/zutil/sortspec.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 1995-2001, Index Data. - * See the file LICENSE for details. - * - * $Id: sortspec.c,v 1.4 2001-11-13 23:00:43 adam Exp $ - */ - -#include -#include -#include - -#include -#include -#include - -Z_SortKeySpecList *yaz_sort_spec (ODR out, const char *arg) -{ - char sort_string_buf[32], sort_flags[32]; - Z_SortKeySpecList *sksl = (Z_SortKeySpecList *) - odr_malloc (out, sizeof(*sksl)); - int off; - - sksl->num_specs = 0; - sksl->specs = (Z_SortKeySpec **)odr_malloc (out, sizeof(sksl->specs) * 20); - - while ((sscanf (arg, "%31s %31s%n", sort_string_buf, - sort_flags, &off)) == 2 && off > 1) - { - int i; - char *sort_string_sep; - char *sort_string = sort_string_buf; - Z_SortKeySpec *sks = (Z_SortKeySpec *)odr_malloc (out, sizeof(*sks)); - Z_SortKey *sk = (Z_SortKey *)odr_malloc (out, sizeof(*sk)); - - arg += off; - sksl->specs[sksl->num_specs++] = sks; - sks->sortElement = (Z_SortElement *) - odr_malloc (out, sizeof(*sks->sortElement)); - sks->sortElement->which = Z_SortElement_generic; - sks->sortElement->u.generic = sk; - - if ((sort_string_sep = strchr (sort_string, '='))) - { - int i = 0; - sk->which = Z_SortKey_sortAttributes; - sk->u.sortAttributes = (Z_SortAttributes *) - odr_malloc (out, sizeof(*sk->u.sortAttributes)); - sk->u.sortAttributes->id = - yaz_oidval_to_z3950oid(out, CLASS_ATTSET, VAL_BIB1); - sk->u.sortAttributes->list = (Z_AttributeList *) - odr_malloc (out, sizeof(*sk->u.sortAttributes->list)); - sk->u.sortAttributes->list->attributes = (Z_AttributeElement **) - odr_malloc (out, 10 * - sizeof(*sk->u.sortAttributes->list->attributes)); - while (i < 10 && sort_string && sort_string_sep) - { - Z_AttributeElement *el = (Z_AttributeElement *) - odr_malloc (out, sizeof(*el)); - sk->u.sortAttributes->list->attributes[i] = el; - el->attributeSet = 0; - el->attributeType = odr_intdup (out, atoi (sort_string)); - el->which = Z_AttributeValue_numeric; - el->value.numeric = - odr_intdup (out, atoi (sort_string_sep + 1)); - i++; - sort_string = strchr(sort_string, ','); - if (sort_string) - { - sort_string++; - sort_string_sep = strchr (sort_string, '='); - } - } - sk->u.sortAttributes->list->num_attributes = i; - } - else - { - sk->which = Z_SortKey_sortField; - sk->u.sortField = odr_strdup (out, sort_string); - } - sks->sortRelation = odr_intdup (out, Z_SortRelation_ascending); - sks->caseSensitivity = odr_intdup (out, Z_SortCase_caseSensitive); - - sks->which = Z_SortKeySpec_null; - sks->u.null = odr_nullval (); - - for (i = 0; sort_flags[i]; i++) - { - switch (sort_flags[i]) - { - case 'd': - case 'D': - case '>': - *sks->sortRelation = Z_SortRelation_descending; - break; - case 'a': - case 'A': - case '<': - *sks->sortRelation = Z_SortRelation_ascending; - break; - case 'i': - case 'I': - *sks->caseSensitivity = Z_SortCase_caseInsensitive; - break; - case 'S': - case 's': - *sks->caseSensitivity = Z_SortCase_caseSensitive; - break; - } - } - } - if (!sksl->num_specs) - return 0; - return sksl; -} diff --git a/zutil/srw.c b/zutil/srw.c deleted file mode 100644 index 5b6657e..0000000 --- a/zutil/srw.c +++ /dev/null @@ -1,855 +0,0 @@ -/* - * Copyright (c) 2002-2003, Index Data. - * See the file LICENSE for details. - * - * $Id: srw.c,v 1.15 2003-05-12 22:36:10 adam Exp $ - */ - -#include - -#if HAVE_XML2 -#include -#include - -static void add_XML_n(xmlNodePtr ptr, const char *elem, char *val, int len) -{ - if (val) - { - xmlDocPtr doc = xmlParseMemory(val,len); - if (doc) - { - xmlNodePtr c = xmlNewChild(ptr, 0, elem, 0); - xmlNodePtr t = xmlDocGetRootElement(doc); - xmlAddChild(c, xmlCopyNode(t,1)); - xmlFreeDoc(doc); - } - } -} - -static void add_xsd_string_n(xmlNodePtr ptr, const char *elem, char *val, - int len) -{ - if (val) - { - xmlNodePtr c = xmlNewChild(ptr, 0, elem, 0); - xmlNodePtr t = xmlNewTextLen(val, len); - xmlAddChild(c, t); - } -} - -static void add_xsd_string(xmlNodePtr ptr, const char *elem, char *val) -{ - if (val) - xmlNewChild(ptr, 0, elem, val); -} - -static void add_xsd_integer(xmlNodePtr ptr, const char *elem, int *val) -{ - if (val) - { - char str[30]; - sprintf(str, "%d", *val); - xmlNewChild(ptr, 0, elem, str); - } -} - -static int match_element(xmlNodePtr ptr, const char *elem) -{ - if (ptr->type == XML_ELEMENT_NODE && !strcmp(ptr->name, elem)) - return 1; - return 0; -} - -#define CHECK_TYPE 0 - -static int match_xsd_string_n(xmlNodePtr ptr, const char *elem, ODR o, - char **val, int *len) -{ -#if CHECK_TYPE - struct _xmlAttr *attr; -#endif - if (!match_element(ptr, elem)) - return 0; -#if CHECK_TYPE - for (attr = ptr->properties; attr; attr = attr->next) - if (!strcmp(attr->name, "type") && - attr->children && attr->children->type == XML_TEXT_NODE) - { - const char *t = strchr(attr->children->content, ':'); - if (t) - t = t + 1; - else - t = attr->children->content; - if (!strcmp(t, "string")) - break; - } - if (!attr) - return 0; -#endif - ptr = ptr->children; - if (!ptr || ptr->type != XML_TEXT_NODE) - return 0; - *val = odr_strdup(o, ptr->content); - if (len) - *len = strlen(ptr->content); - return 1; -} - - -static int match_xsd_string(xmlNodePtr ptr, const char *elem, ODR o, - char **val) -{ - return match_xsd_string_n(ptr, elem, o, val, 0); -} - -static int match_xsd_XML_n(xmlNodePtr ptr, const char *elem, ODR o, - char **val, int *len) -{ - xmlBufferPtr buf; - - if (!match_element(ptr, elem)) - return 0; - ptr = ptr->children; - if (!ptr) - return 0; - buf = xmlBufferCreate(); - - xmlNodeDump(buf, ptr->doc, ptr, 0, 0); - - *val = odr_malloc(o, buf->use+1); - memcpy (*val, buf->content, buf->use); - (*val)[buf->use] = '\0'; - - if (len) - *len = buf->use; - - xmlBufferFree(buf); - - return 1; -} - - -static int match_xsd_integer(xmlNodePtr ptr, const char *elem, ODR o, int **val) -{ -#if CHECK_TYPE - struct _xmlAttr *attr; -#endif - if (!match_element(ptr, elem)) - return 0; -#if CHECK_TYPE - for (attr = ptr->properties; attr; attr = attr->next) - if (!strcmp(attr->name, "type") && - attr->children && attr->children->type == XML_TEXT_NODE) - { - const char *t = strchr(attr->children->content, ':'); - if (t) - t = t + 1; - else - t = attr->children->content; - if (!strcmp(t, "integer")) - break; - } - if (!attr) - return 0; -#endif - ptr = ptr->children; - if (!ptr || ptr->type != XML_TEXT_NODE) - return 0; - *val = odr_intdup(o, atoi(ptr->content)); - return 1; -} - -static int yaz_srw_records(ODR o, xmlNodePtr pptr, Z_SRW_record **recs, - int *num, void *client_data, const char *ns) -{ - if (o->direction == ODR_DECODE) - { - int i; - xmlNodePtr ptr; - *num = 0; - for (ptr = pptr->children; ptr; ptr = ptr->next) - { - if (ptr->type == XML_ELEMENT_NODE && - !strcmp(ptr->name, "record")) - (*num)++; - } - if (!*num) - return 1; - *recs = odr_malloc(o, *num * sizeof(**recs)); - for (i = 0, ptr = pptr->children; ptr; ptr = ptr->next, i++) - { - if (ptr->type == XML_ELEMENT_NODE && - !strcmp(ptr->name, "record")) - { - xmlNodePtr rptr; - (*recs)[i].recordSchema = 0; - (*recs)[i].recordPacking = Z_SRW_recordPacking_string; - (*recs)[i].recordData_buf = 0; - (*recs)[i].recordData_len = 0; - (*recs)[i].recordPosition = 0; - for (rptr = ptr->children; rptr; rptr = rptr->next) - { - if (match_xsd_string(rptr, "recordSchema", o, - &(*recs)[i].recordSchema)) - ; - else if (match_xsd_string_n(rptr, "recordData", o, - &(*recs)[i].recordData_buf, - &(*recs)[i].recordData_len)) - ; - else if (match_xsd_XML_n(rptr, "recordXML", o, - &(*recs)[i].recordData_buf, - &(*recs)[i].recordData_len)) - (*recs)[i].recordPacking = Z_SRW_recordPacking_XML; - else if (match_xsd_integer(rptr, "recordPosition", o, - &(*recs)[i].recordPosition)) - ; - } - } - } - } - else if (o->direction == ODR_ENCODE) - { - int i; - for (i = 0; i < *num; i++) - { - xmlNodePtr rptr = xmlNewChild(pptr, 0, "record", 0); - add_xsd_string(rptr, "recordSchema", (*recs)[i].recordSchema); - switch((*recs)[i].recordPacking) - { - case Z_SRW_recordPacking_string: - add_xsd_string_n(rptr, "recordData", (*recs)[i].recordData_buf, - (*recs)[i].recordData_len); - break; - case Z_SRW_recordPacking_XML: - add_XML_n(rptr, "recordXML", (*recs)[i].recordData_buf, - (*recs)[i].recordData_len); - break; - } - add_xsd_integer(rptr, "recordPosition", (*recs)[i].recordPosition); - } - } - return 0; -} - -static int yaz_srw_diagnostics(ODR o, xmlNodePtr pptr, Z_SRW_diagnostic **recs, - int *num, void *client_data, const char *ns) -{ - if (o->direction == ODR_DECODE) - { - int i; - xmlNodePtr ptr; - *num = 0; - for (ptr = pptr->children; ptr; ptr = ptr->next) - { - if (ptr->type == XML_ELEMENT_NODE && - !strcmp(ptr->name, "diagnostic")) - (*num)++; - } - if (!*num) - return 1; - *recs = odr_malloc(o, *num * sizeof(**recs)); - for (i = 0, ptr = pptr->children; ptr; ptr = ptr->next, i++) - { - if (ptr->type == XML_ELEMENT_NODE && - !strcmp(ptr->name, "diagnostic")) - { - xmlNodePtr rptr; - (*recs)[i].code = 0; - (*recs)[i].details = 0; - for (rptr = ptr->children; rptr; rptr = rptr->next) - { - if (match_xsd_integer(rptr, "code", o, - &(*recs)[i].code)) - ; - else if (match_xsd_string(rptr, "details", o, - &(*recs)[i].details)) - ; - } - i++; - } - } - } - else if (o->direction == ODR_ENCODE) - { - int i; - for (i = 0; i < *num; i++) - { - xmlNodePtr rptr = xmlNewChild(pptr, 0, "diagnostic", 0); - add_xsd_integer(rptr, "code", (*recs)[i].code); - add_xsd_string(rptr, "details", (*recs)[i].details); - } - } - return 0; -} - - -int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data, - void *client_data, const char *ns) -{ - xmlNodePtr pptr = vptr; - if (o->direction == ODR_DECODE) - { - xmlNodePtr method = pptr->children; - - while (method && method->type == XML_TEXT_NODE) - method = method->next; - - if (!method || method->type != XML_ELEMENT_NODE) - return -1; - if (!strcmp(method->name, "searchRetrieveRequest")) - { - Z_SRW_PDU **p = handler_data; - xmlNodePtr ptr = method->children; - Z_SRW_searchRetrieveRequest *req; - - *p = odr_malloc(o, sizeof(**p)); - (*p)->which = Z_SRW_searchRetrieve_request; - req = (*p)->u.request = odr_malloc(o, sizeof(*req)); - req->query_type = Z_SRW_query_type_cql; - req->query.cql = 0; - req->sort_type = Z_SRW_sort_type_none; - req->sort.none = 0; - req->startRecord = 0; - req->maximumRecords = 0; - req->recordSchema = 0; - req->recordPacking = 0; - req->database = 0; - - for (; ptr; ptr = ptr->next) - { - if (match_xsd_string(ptr, "query", o, - &req->query.cql)) - req->query_type = Z_SRW_query_type_cql; - else if (match_xsd_string(ptr, "pQuery", o, - &req->query.pqf)) - req->query_type = Z_SRW_query_type_pqf; - else if (match_xsd_string(ptr, "xQuery", o, - &req->query.xcql)) - req->query_type = Z_SRW_query_type_xcql; - else if (match_xsd_string(ptr, "sortKeys", o, - &req->sort.sortKeys)) - req->sort_type = Z_SRW_sort_type_sort; - else if (match_xsd_string(ptr, "recordSchema", o, - &req->recordSchema)) - ; - else if (match_xsd_string(ptr, "recordPacking", o, - &req->recordPacking)) - ; - else if (match_xsd_integer(ptr, "startRecord", o, - &req->startRecord)) - ; - else if (match_xsd_integer(ptr, "maximumRecords", o, - &req->maximumRecords)) - ; - else if (match_xsd_string(ptr, "database", o, - &req->database)) - ; - /* missing is xQuery, xSortKeys .. */ - } - } - else if (!strcmp(method->name, "searchRetrieveResponse")) - { - Z_SRW_PDU **p = handler_data; - xmlNodePtr ptr = method->children; - Z_SRW_searchRetrieveResponse *res; - - *p = odr_malloc(o, sizeof(**p)); - (*p)->which = Z_SRW_searchRetrieve_response; - res = (*p)->u.response = odr_malloc(o, sizeof(*res)); - - res->numberOfRecords = 0; - res->resultSetId = 0; - res->resultSetIdleTime = 0; - res->records = 0; - res->num_records = 0; - res->diagnostics = 0; - res->num_diagnostics = 0; - res->nextRecordPosition = 0; - - for (; ptr; ptr = ptr->next) - { - if (match_xsd_integer(ptr, "numberOfRecords", o, - &res->numberOfRecords)) - ; - else if (match_xsd_string(ptr, "resultSetId", o, - &res->resultSetId)) - ; - else if (match_xsd_integer(ptr, "resultSetIdleTime", o, - &res->resultSetIdleTime)) - ; - else if (match_element(ptr, "records")) - yaz_srw_records(o, ptr, &res->records, - &res->num_records, client_data, - ns); - else if (match_element(ptr, "diagnostics")) - yaz_srw_diagnostics(o, ptr, &res->diagnostics, - &res->num_diagnostics, - client_data, ns); - else if (match_xsd_integer(ptr, "nextRecordPosition", o, - &res->nextRecordPosition)) - ; - } - } - else if (!strcmp(method->name, "explainRequest")) - { - Z_SRW_PDU **p = handler_data; - Z_SRW_explainRequest *req; - - *p = odr_malloc(o, sizeof(**p)); - (*p)->which = Z_SRW_explain_request; - req = (*p)->u.explain_request = odr_malloc(o, sizeof(*req)); - req->dummy = 0; - } - else if (!strcmp(method->name, "explainResponse")) - { - Z_SRW_PDU **p = handler_data; - Z_SRW_explainResponse *res; - xmlNodePtr ptr = method->children; - - *p = odr_malloc(o, sizeof(**p)); - (*p)->which = Z_SRW_explain_response; - res = (*p)->u.explain_response = odr_malloc(o, sizeof(*res)); - res->explainData_buf = 0; - res->explainData_len = 0; - res->explainPacking = Z_SRW_recordPacking_string; - for (; ptr; ptr = ptr->next) - { - match_xsd_string_n(ptr, "Explain", o, - &res->explainData_buf, - &res->explainData_len); - } - } - else - return -1; - - } - else if (o->direction == ODR_ENCODE) - { - Z_SRW_PDU **p = handler_data; - if ((*p)->which == Z_SRW_searchRetrieve_request) - { - Z_SRW_searchRetrieveRequest *req = (*p)->u.request; - xmlNodePtr ptr = xmlNewChild(pptr, 0, - "searchRetrieveRequest", 0); - xmlNsPtr ns_srw = xmlNewNs(ptr, ns, "zs"); - - xmlSetNs(ptr, ns_srw); - - switch(req->query_type) - { - case Z_SRW_query_type_cql: - add_xsd_string(ptr, "query", req->query.cql); - break; - case Z_SRW_query_type_xcql: - add_xsd_string(ptr, "xQuery", req->query.xcql); - break; - case Z_SRW_query_type_pqf: - add_xsd_string(ptr, "pQuery", req->query.pqf); - break; - } - switch(req->sort_type) - { - case Z_SRW_sort_type_none: - break; - case Z_SRW_sort_type_sort: - add_xsd_string(ptr, "sortKeys", req->sort.sortKeys); - break; - case Z_SRW_sort_type_xSort: - add_xsd_string(ptr, "xSortKeys", req->sort.xSortKeys); - break; - } - add_xsd_integer(ptr, "startRecord", req->startRecord); - add_xsd_integer(ptr, "maximumRecords", req->maximumRecords); - add_xsd_string(ptr, "recordSchema", req->recordSchema); - add_xsd_string(ptr, "recordPacking", req->recordPacking); - add_xsd_string(ptr, "database", req->database); - } - else if ((*p)->which == Z_SRW_searchRetrieve_response) - { - Z_SRW_searchRetrieveResponse *res = (*p)->u.response; - xmlNodePtr ptr = xmlNewChild(pptr, 0, - "searchRetrieveResponse", 0); - xmlNsPtr ns_srw = xmlNewNs(ptr, ns, "zs"); - - xmlSetNs(ptr, ns_srw); - add_xsd_integer(ptr, "numberOfRecords", res->numberOfRecords); - add_xsd_string(ptr, "resultSetId", res->resultSetId); - add_xsd_integer(ptr, "resultSetIdleTime", res->resultSetIdleTime); - if (res->num_records) - { - xmlNodePtr rptr = xmlNewChild(ptr, 0, "records", 0); - yaz_srw_records(o, rptr, &res->records, &res->num_records, - client_data, ns); - } - if (res->num_diagnostics) - { - xmlNodePtr rptr = xmlNewChild(ptr, 0, "diagnostics", 0); - yaz_srw_diagnostics(o, rptr, &res->diagnostics, - &res->num_diagnostics, client_data, ns); - } - add_xsd_integer(ptr, "nextRecordPosition", res->nextRecordPosition); - } - else if ((*p)->which == Z_SRW_explain_request) - { - xmlNodePtr ptr = xmlNewChild(pptr, 0, "explainRequest", 0); - xmlNsPtr ns_srw = xmlNewNs(ptr, ns, "zs"); - - xmlSetNs(ptr, ns_srw); - } - else if ((*p)->which == Z_SRW_explain_response) - { - Z_SRW_explainResponse *res = (*p)->u.explain_response; - xmlNodePtr ptr = xmlNewChild(pptr, 0, "explainResponse", 0); - xmlNsPtr ns_srw = xmlNewNs(ptr, ns, "zs"); - - xmlSetNs(ptr, ns_srw); - - add_xsd_string_n(ptr, "Explain", res->explainData_buf, - res->explainData_len); - } - else - return -1; - - } - return 0; -} - -Z_SRW_PDU *yaz_srw_get(ODR o, int which) -{ - Z_SRW_PDU *sr = odr_malloc(o, sizeof(*o)); - sr->which = which; - switch(which) - { - case Z_SRW_searchRetrieve_request: - sr->u.request = (Z_SRW_searchRetrieveRequest *) - odr_malloc(o, sizeof(*sr->u.request)); - sr->u.request->query_type = Z_SRW_query_type_cql; - sr->u.request->query.cql = 0; - sr->u.request->sort_type = Z_SRW_sort_type_none; - sr->u.request->sort.none = 0; - sr->u.request->startRecord = 0; - sr->u.request->maximumRecords = 0; - sr->u.request->recordSchema = 0; - sr->u.request->recordPacking = 0; - sr->u.request->database = 0; - break; - case Z_SRW_searchRetrieve_response: - sr->u.response = (Z_SRW_searchRetrieveResponse *) - odr_malloc(o, sizeof(*sr->u.response)); - sr->u.response->numberOfRecords = 0; - sr->u.response->resultSetId = 0; - sr->u.response->resultSetIdleTime = 0; - sr->u.response->records = 0; - sr->u.response->num_records = 0; - sr->u.response->diagnostics = 0; - sr->u.response->num_diagnostics = 0; - sr->u.response->nextRecordPosition = 0; - break; - case Z_SRW_explain_request: - sr->u.explain_request = (Z_SRW_explainRequest *) - odr_malloc(o, sizeof(*sr->u.explain_request)); - sr->u.explain_request->dummy = 0; - break; - case Z_SRW_explain_response: - sr->u.explain_response = (Z_SRW_explainResponse *) - odr_malloc(o, sizeof(*sr->u.explain_response)); - sr->u.explain_response->explainPacking = 0; - sr->u.explain_response->explainData_buf = 0; - sr->u.explain_response->explainData_len = 0; - } - return sr; -} - -#endif - - -static struct { - int code; - const char *msg; -} yaz_srw_codes [] = { -{1, "Permanent system error"}, -{2, "System temporarily unavailable"}, -{3, "Authentication error"}, -/* Diagnostics Relating to CQL */ -{10, "Illegal query"}, -{11, "Unsupported query type (XCQL vs CQL)"}, -{12, "Too many characters in query"}, -{13, "Unbalanced or illegal use of parentheses"}, -{14, "Unbalanced or illegal use of quotes"}, -{15, "Illegal or unsupported index set"}, -{16, "Illegal or unsupported index"}, -{17, "Illegal or unsupported combination of index and index set"}, -{18, "Illegal or unsupported combination of indexes"}, -{19, "Illegal or unsupported relation"}, -{20, "Illegal or unsupported relation modifier"}, -{21, "Illegal or unsupported combination of relation modifers"}, -{22, "Illegal or unsupported combination of relation and index"}, -{23, "Too many characters in term"}, -{24, "Illegal combination of relation and term"}, -{25, "Special characters not quoted in term"}, -{26, "Non special character escaped in term"}, -{27, "Empty term unsupported"}, -{28, "Masking character not supported"}, -{29, "Masked words too short"}, -{30, "Too many masking characters in term"}, -{31, "Anchoring character not supported"}, -{32, "Anchoring character in illegal or unsupported position"}, -{33, "Combination of proximity/adjacency and masking characters not supported"}, -{34, "Combination of proximity/adjacency and anchoring characters not supported"}, -{35, "Terms only exclusion (stop) words"}, -{36, "Term in invalid format for index or relation"}, -{37, "Illegal or unsupported boolean operator"}, -{38, "Too many boolean operators in query"}, -{39, "Proximity not supported"}, -{40, "Illegal or unsupported proximity relation"}, -{41, "Illegal or unsupported proximity distance"}, -{42, "Illegal or unsupported proximity unit"}, -{43, "Illegal or unsupported proximity ordering"}, -{44, "Illegal or unsupported combination of proximity modifiers"}, -{45, "Index set name (prefix) assigned to multiple identifiers"}, -/* Diagnostics Relating to Result Sets */ -{50, "Result sets not supported"}, -{51, "Result set does not exist"}, -{52, "Result set temporarily unavailable"}, -{53, "Result sets only supported for retrieval"}, -{54, "Retrieval may only occur from an existing result set"}, -{55, "Combination of result sets with search terms not supported"}, -{56, "Only combination of single result set with search terms supported"}, -{57, "Result set created but no records available"}, -{58, "Result set created with unpredictable partial results available"}, -{59, "Result set created with valid partial results available"}, -/* Diagnostics Relating to Records */ -{60, "Too many records retrieved"}, -{61, "First record position out of range"}, -{62, "Negative number of records requested"}, -{63, "System error in retrieving records"}, -{64, "Record temporarily unavailable"}, -{65, "Record does not exist"}, -{66, "Unknown schema for retrieval"}, -{67, "Record not available in this schema"}, -{68, "Not authorised to send record"}, -{69, "Not authorised to send record in this schema"}, -{70, "Record too large to send"}, -/* Diagnostics Relating to Sorting */ -{80, "Sort not supported"}, -{81, "Unsupported sort type (sortKeys vs xSortKeys)"}, -{82, "Illegal or unsupported sort sequence"}, -{83, "Too many records"}, -{84, "Too many sort keys"}, -{85, "Duplicate sort keys"}, -{86, "Incompatible record formats"}, -{87, "Unsupported schema for sort"}, -{88, "Unsupported tag path for sort"}, -{89, "Tag path illegal or unsupported for schema"}, -{90, "Illegal or unsupported direction value"}, -{91, "Illegal or unsupported case value"}, -{92, "Illegal or unsupported missing value action"}, -/* Diagnostics Relating to Explain */ -{100, "Explain not supported"}, -{101, "Explain request type not supported (SOAP vs GET)"}, -{102, "Explain record temporarily unavailable"}, -{0, 0} -}; - -const char *yaz_diag_srw_str (int code) -{ - int i; - for (i = 0; yaz_srw_codes[i].code; i++) - if (yaz_srw_codes[i].code == code) - return yaz_srw_codes[i].msg; - return 0; -} - - -/* bib1:srw */ -static int srw_bib1_map[] = { - 1, 1, - 2, 2, - 3, 11, - 4, 35, - 5, 12, - 6, 38, - 7, 30, - 8, 32, - 9, 29, - 10, 10, - 11, 12, - 11, 23, - 12, 60, - 13, 61, - 13, 62, - 14, 63, - 14, 64, - 14, 65, - 15, 68, - 15, 69, - 16, 70, - 17, 70, - 18, 50, - 19, 55, - 20, 56, - 21, 52, - 22, 50, - 23, 1, /* bad map */ - 24, 63, /* bad map */ - 25, 63, /* bad map */ - 26, 63, /* bad map */ - 27, 51, - 28, 52, - 29, 52, - 30, 51, - 31, 57, - 32, 58, - 33, 59, - 100, 1, /* bad map */ - 101, 3, - 102, 3, - 103, 3, - 104, 3, - 105, 3, - 106, 66, - 107, 11, - 108, 10, - 108, 13, - 108, 14, - 108, 25, - 108, 26, - 108, 27, - 108, 45, - - 109, 1, - 110, 37, - 111, 1, - 112, 58, - 113, 10, - 114, 16, - 115, 16, - 116, 16, - 117, 19, - 118, 22, - 119, 32, - 119, 31, - 120, 28, - 121, 15, - 122, 32, - 123, 22, - 123, 17, - 123, 18, - 124, 24, - 125, 36, - 126, 36, - 127, 36, - 128, 51, - 129, 39, - 130, 43, - 131, 40, - 132, 42, - 201, 44, - 201, 33, - 201, 34, - 202, 41, - 203, 43, - 205, 1, /* bad map */ - 206, 1, /* bad map */ - 207, 89, - 208, 1, /* bad map */ - 209, 80, - 210, 80, - 210, 81, - 211, 84, - 212, 85, - 213, 92, - 214, 90, - 215, 91, - 216, 92, - 217, 63, - 218, 1, /* bad map */ - 219, 1, /* bad map */ - 220, 1, /* bad map */ - 221, 1, /* bad map */ - 222, 1, /* bad map */ - 223, 1, /* bad map */ - 224, 1, /* bad map */ - 225, 1, /* bad map */ - 226, 1, /* bad map */ - 227, 66, - 228, 1, /* bad map */ - 229, 36, - 230, 83, - 231, 89, - 232, 1, - 233, 1, /* bad map */ - 234, 1, /* bad map */ - 235, 2, - 236, 3, - 237, 82, - 238, 67, - 239, 66, - 240, 1, /* bad map */ - 241, 1, /* bad map */ - 242, 70, - 243, 1, /* bad map */ - 244, 66, - 245, 10, - 246, 10, - 247, 10, - 1001, 1, /* bad map */ - 1002, 1, /* bad map */ - 1003, 1, /* bad map */ - 1004, 1, /* bad map */ - 1005, 1, /* bad map */ - 1006, 1, /* bad map */ - 1007, 100, - 1008, 1, - 1009, 1, - 1010, 3, - 1011, 3, - 1012, 3, - 1013, 3, - 1014, 3, - 1015, 3, - 1015, 3, - 1016, 3, - 1017, 3, - 1018, 2, - 1019, 2, - 1020, 2, - 1021, 3, - 1022, 3, - 1023, 3, - 1024, 16, - 1025, 3, - 1026, 64, - 1027, 1, - 1028, 65, - 1029, 1, - 1040, 1, - /* 1041-1065 */ - 1066, 66, - 1066, 67, - 0 -}; - -int yaz_diag_bib1_to_srw (int code) -{ - const int *p = srw_bib1_map; - while (*p) - { - if (code == p[0]) - return p[1]; - p += 2; - } - return 1; -} - -int yaz_diag_srw_to_bib1(int code) -{ - const int *p = srw_bib1_map; - while (*p) - { - if (code == p[1]) - return p[0]; - p += 2; - } - return 1; -} diff --git a/zutil/srwtst.c b/zutil/srwtst.c deleted file mode 100644 index be4cad7..0000000 --- a/zutil/srwtst.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2002-2003, Index Data. - * See the file LICENSE for details. - * - * $Id: srwtst.c,v 1.5 2003-03-03 19:57:37 adam Exp $ - */ - -#include - -#if HAVE_XML2 -Z_SOAP_Handler h[2] = { - {"http://www.loc.gov/zing/srw/v1.0/", 0, (Z_SOAP_fun) yaz_srw_codec}, - {0, 0, 0} -}; - -int main(int argc, char **argv) -{ - char buf[163840]; - char *content_buf = buf; - int content_len; - int ret; - size_t no; - Z_SOAP *soap_package = 0; - ODR decode, encode; - int debug = 0; - - nmem_init(); - if (argc == 2 && !strcmp(argv[1], "debug")) - debug = 1; - no = fread(buf, 1, sizeof(buf), stdin); - if (no < 1 || no == sizeof(buf)) - { - fprintf(stderr, "Bad file or too big\n"); - exit (1); - } - decode = odr_createmem(ODR_DECODE); - encode = odr_createmem(ODR_ENCODE); - content_len = no; - ret = z_soap_codec(decode, &soap_package, - &content_buf, &content_len, h); - if (!soap_package) - { - fprintf(stderr, "Decoding seriously failed\n"); - exit(1); - } - if (debug) - { - fprintf(stderr, "got NS = %s\n", soap_package->ns); - if (soap_package->which == Z_SOAP_generic && - soap_package->u.generic->no == 0) - { - Z_SRW_PDU *sr = soap_package->u.generic->p; - if (sr->which == Z_SRW_searchRetrieve_request) - { - Z_SRW_searchRetrieveRequest *req = sr->u.request; - switch(req->query_type) - { - case Z_SRW_query_type_cql: - fprintf(stderr, "CQL: %s\n", req->query.cql); - break; - case Z_SRW_query_type_xcql: - fprintf(stderr, "XCQL\n"); - break; - case Z_SRW_query_type_pqf: - fprintf(stderr, "PQF: %s\n", req->query.pqf); - break; - } - } - else if (sr->which == Z_SRW_searchRetrieve_response) - { - Z_SRW_searchRetrieveResponse *res = sr->u.response; - if (res->records && res->num_records) - { - int i; - for (i = 0; inum_records; i++) - { - fprintf (stderr, "%d\n", i); - if (res->records[i].recordData_buf) - fwrite(res->records[i].recordData_buf, 1, - res->records[i].recordData_len, stderr); - } - } - } - - } - } - ret = z_soap_codec(encode, &soap_package, - &content_buf, &content_len, h); - if (content_buf && content_len) - fwrite (content_buf, content_len, 1, stdout); - else - { - fprintf(stderr, "No output!\n"); - exit(1); - } - odr_destroy(decode); - odr_destroy(encode); - nmem_exit(); - exit(0); -} -#else -int main(int argc, char **argv) -{ - fprintf(stderr, "SOAP disabled\n"); - exit(1); -} -#endif diff --git a/zutil/yaz-ccl.c b/zutil/yaz-ccl.c deleted file mode 100644 index 0aa4c5a..0000000 --- a/zutil/yaz-ccl.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1996-2003, Index Data. - * See the file LICENSE for details. - * - * $Id: yaz-ccl.c,v 1.23 2003-06-24 23:03:04 adam Exp $ - */ - -#include -#include -#include -#include - -#include -#include - -Z_RPNQuery *ccl_rpn_query (ODR o, struct ccl_rpn_node *p) -{ - YAZ_PQF_Parser parser = yaz_pqf_create(); - WRBUF wr = wrbuf_alloc(); - Z_RPNQuery *q; - - ccl_pquery(wr, p); - - q = yaz_pqf_parse(parser, o, wrbuf_buf(wr)); - - wrbuf_free(wr, 1); - yaz_pqf_destroy(parser); - return q; -} - -Z_AttributesPlusTerm *ccl_scan_query (ODR o, struct ccl_rpn_node *p) -{ - YAZ_PQF_Parser parser = yaz_pqf_create(); - WRBUF wr = wrbuf_alloc(); - Z_AttributesPlusTerm *q; - Odr_oid *setp; - - ccl_pquery(wr, p); - - q = yaz_pqf_scan(parser, o, &setp, wrbuf_buf(wr)); - - wrbuf_free(wr, 1); - yaz_pqf_destroy(parser); - return q; -} - diff --git a/zutil/z3950oid.c b/zutil/z3950oid.c deleted file mode 100644 index 95687a0..0000000 --- a/zutil/z3950oid.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data - * See the file LICENSE for details. - * - * $Id: z3950oid.c,v 1.5 2003-01-06 08:20:29 adam Exp $ - */ - -#if HAVE_CONFIG_H -#include -#endif - -#include - -Odr_oid *yaz_oidval_to_z3950oid (ODR o, int oid_class, int oid_value) -{ - oident ident; - int oid[OID_SIZE]; - - ident.proto = PROTO_Z3950; - ident.oclass = (enum oid_class) oid_class; - ident.value = (enum oid_value) oid_value; - - if (ident.value == VAL_NONE) - return 0; - - return odr_oiddup(o, oid_ent_to_oid(&ident, oid)); -} - -Odr_oid *yaz_str_to_z3950oid (ODR o, int oid_class, const char *str) -{ - struct oident ident; - int oid[OID_SIZE]; - - ident.proto = PROTO_Z3950; - ident.oclass = (enum oid_class) oid_class; - ident.value = oid_getvalbyname(str); - - if (ident.value == VAL_NONE) - return 0; - - return odr_oiddup(o, oid_ent_to_oid(&ident, oid)); -} - -const char *yaz_z3950oid_to_str (Odr_oid *oid, int *oid_class) -{ - struct oident *ident = oid_getentbyoid(oid); - - if (!ident || ident->value == VAL_NONE) - return 0; - *oid_class = ident->oclass; - return ident->desc; -} - - -const char* yaz_z3950_oid_value_to_str(oid_value ov, oid_class oc) -{ - struct oident tmpentry; - int tmp_oid[OID_SIZE]; - - tmpentry.proto = PROTO_Z3950; - tmpentry.oclass = oc; - tmpentry.value = ov; - - if( oid_ent_to_oid(&tmpentry,tmp_oid) ) - { - return tmpentry.desc; - } - else - { - return ""; - } -} - - -/* - * Local variables: - * tab-width: 8 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=8 fdm=marker - * vim<600: sw=4 ts=8 - */ diff --git a/zutil/zgdu.c b/zutil/zgdu.c deleted file mode 100644 index dbd921e..0000000 --- a/zutil/zgdu.c +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Copyright (c) 2002-2003, Index Data. - * See the file LICENSE for details. - * - * $Id: zgdu.c,v 1.9 2003-03-11 11:09:17 adam Exp $ - */ - -#include -#include -#include - -static int decode_headers_content(ODR o, int off, Z_HTTP_Header **headers, - char **content_buf, int *content_len) -{ - int i = off; - - *headers = 0; - while (i < o->size-1 && o->buf[i] == '\r') - { - int po; - i++; - if (o->buf[i] != '\n') - { - o->error = OHTTP; - return 0; - } - i++; - if (o->buf[i] == '\r') - break; - for (po = i; ; i++) - { - if (i == o->size) - { - o->error = OHTTP; - return 0; - } - else if (o->buf[i] == ':') - break; - } - *headers = (Z_HTTP_Header *) odr_malloc(o, sizeof(**headers)); - (*headers)->name = (char*) odr_malloc(o, i - po + 1); - memcpy ((*headers)->name, o->buf + po, i - po); - (*headers)->name[i - po] = '\0'; - i++; - while (i < o->size-1 && o->buf[i] == ' ') - i++; - for (po = i; i < o->size-1 && o->buf[i] != '\r' ; i++) - ; - - (*headers)->value = (char*) odr_malloc(o, i - po + 1); - memcpy ((*headers)->value, o->buf + po, i - po); - (*headers)->value[i - po] = '\0'; - - headers = &(*headers)->next; - } - *headers = 0; - i++; - if (o->buf[i] != '\n') - { - o->error = OHTTP; - return 0; - } - i++; - - if (i > o->size) - { - o->error = OHTTP; - return 0; - } - else if (i == o->size) - { - *content_buf = 0; - *content_len = 0; - } - else - { - *content_len = o->size - i; - *content_buf = (char*) odr_malloc(o, *content_len + 1); - memcpy(*content_buf, o->buf + i, *content_len); - (*content_buf)[*content_len] = '\0'; - } - return 1; -} - -void z_HTTP_header_add(ODR o, Z_HTTP_Header **hp, const char *n, - const char *v) -{ - while (*hp) - hp = &(*hp)->next; - *hp = (Z_HTTP_Header *) odr_malloc(o, sizeof(**hp)); - (*hp)->name = odr_strdup(o, n); - (*hp)->value = odr_strdup(o, v); - (*hp)->next = 0; -} - -const char *z_HTTP_header_lookup(Z_HTTP_Header *hp, const char *n) -{ - for (; hp; hp = hp->next) - if (!strcmp(hp->name, n)) - return hp->value; - return 0; -} - - -Z_GDU *z_get_HTTP_Request(ODR o) -{ - Z_GDU *p = (Z_GDU *) odr_malloc(o, sizeof(*p)); - Z_HTTP_Request *hreq; - - p->which = Z_GDU_HTTP_Request; - p->u.HTTP_Request = (Z_HTTP_Request *) odr_malloc(o, sizeof(*hreq)); - hreq = p->u.HTTP_Request; - hreq->headers = 0; - hreq->content_len = 0; - hreq->content_buf = 0; - hreq->version = "1.1"; - hreq->method = "POST"; - hreq->path = "/"; - z_HTTP_header_add(o, &hreq->headers, "User-Agent", - "YAZ/" YAZ_VERSION); - return p; -} - -Z_GDU *z_get_HTTP_Response(ODR o, int code) -{ - Z_GDU *p = (Z_GDU *) odr_malloc(o, sizeof(*p)); - Z_HTTP_Response *hres; - - p->which = Z_GDU_HTTP_Response; - p->u.HTTP_Response = (Z_HTTP_Response *) odr_malloc(o, sizeof(*hres)); - hres = p->u.HTTP_Response; - hres->headers = 0; - hres->content_len = 0; - hres->content_buf = 0; - hres->code = code; - hres->version = "1.1"; - z_HTTP_header_add(o, &hres->headers, "Server", - "YAZ/" YAZ_VERSION); - if (code != 200) - { - hres->content_buf = (char*) odr_malloc(o, 400); - sprintf (hres->content_buf, - "\n" - "\n" - " \n" - " YAZ " YAZ_VERSION "\n" - " \n" - " \n" - "

YAZ " - YAZ_VERSION "

\n" - "

Error: %d

\n" - "

Description: %.50s

\n" - " \n" - "\n", - code, z_HTTP_errmsg(code)); - hres->content_len = strlen(hres->content_buf); - z_HTTP_header_add(o, &hres->headers, "Content-Type", "text/html"); - } - return p; -} - -const char *z_HTTP_errmsg(int code) -{ - if (code == 200) - return "OK"; - else if (code == 400) - return "Bad Request"; - else if (code == 404) - return "Not Found"; - else if (code == 405) - return "Method Not Allowed"; - else if (code == 500) - return "Internal Error"; - else - return "Unknown Error"; -} - -int z_GDU (ODR o, Z_GDU **p, int opt, const char *name) -{ - if (o->direction == ODR_DECODE) { - *p = (Z_GDU *) odr_malloc(o, sizeof(**p)); - if (o->size > 10 && !memcmp(o->buf, "HTTP/", 5)) - { - int i, po; - Z_HTTP_Response *hr; - (*p)->which = Z_GDU_HTTP_Response; - - hr = (*p)->u.HTTP_Response = (Z_HTTP_Response *) - odr_malloc(o, sizeof(*hr)); - po = i = 5; - while (i < o->size-2 && o->buf[i] != ' ' && o->buf[i] != '\r') - i++; - hr->version = (char *) odr_malloc(o, i - po + 1); - if (i - po) - memcpy(hr->version, o->buf + po, i - po); - hr->version[i-po] = 0; - if (o->buf[i] != ' ') - { - o->error = OHTTP; - return 0; - } - i++; - hr->code = 0; - while (i < o->size-2 && o->buf[i] >= '0' && o->buf[i] <= '9') - { - hr->code = hr->code*10 + (o->buf[i] - '0'); - i++; - } - while (i < o->size-1 && o->buf[i] != '\r') - i++; - return decode_headers_content(o, i, &hr->headers, - &hr->content_buf, &hr->content_len); - } - else if (o->size > 5 && - o->buf[0] >= 0x20 && o->buf[0] < 0x7f - && o->buf[1] >= 0x20 && o->buf[1] < 0x7f - && o->buf[2] >= 0x20 && o->buf[2] < 0x7f - && o->buf[3] >= 0x20 && o->buf[3] < 0x7f) - { - int i, po; - Z_HTTP_Request *hr; - - (*p)->which = Z_GDU_HTTP_Request; - hr = (*p)->u.HTTP_Request = - (Z_HTTP_Request *) odr_malloc(o, sizeof(*hr)); - - /* method .. */ - for (i = 0; o->buf[i] != ' '; i++) - if (i >= o->size-5 || i > 30) - { - o->error = OHTTP; - return 0; - } - hr->method = (char *) odr_malloc(o, i+1); - memcpy (hr->method, o->buf, i); - hr->method[i] = '\0'; - /* path */ - po = i+1; - for (i = po; o->buf[i] != ' '; i++) - if (i >= o->size-5) - { - o->error = OHTTP; - return 0; - } - hr->path = (char *) odr_malloc(o, i - po + 1); - memcpy (hr->path, o->buf+po, i - po); - hr->path[i - po] = '\0'; - /* HTTP version */ - i++; - if (i > o->size-5 || memcmp(o->buf+i, "HTTP/", 5)) - { - o->error = OHTTP; - return 0; - } - i+= 5; - po = i; - while (o->buf[i] != '\r') - { - if (i >= o->size-1) - { - o->error = OHTTP; - return 0; - } - i++; - } - hr->version = (char *) odr_malloc(o, i - po + 1); - memcpy(hr->version, o->buf + po, i - po); - hr->version[i - po] = '\0'; - /* headers */ - return decode_headers_content(o, i, &hr->headers, - &hr->content_buf, &hr->content_len); - - } - else - { - (*p)->which = Z_GDU_Z3950; - return z_APDU(o, &(*p)->u.z3950, opt, 0); - } - } - else /* ENCODE or PRINT */ - { - int top0 = o->top; - char sbuf[80]; - Z_HTTP_Header *h; - switch((*p)->which) - { - case Z_GDU_HTTP_Response: - sprintf(sbuf, "HTTP/%s %d %s\r\n", (*p)->u.HTTP_Response->version, - (*p)->u.HTTP_Response->code, - z_HTTP_errmsg((*p)->u.HTTP_Response->code)); - odr_write(o, (unsigned char *) sbuf, strlen(sbuf)); - /* apply Content-Length if not already applied */ - if (!z_HTTP_header_lookup((*p)->u.HTTP_Response->headers, - "Content-Length")) - { - char lstr[20]; - sprintf(lstr, "%d", (*p)->u.HTTP_Response->content_len); - z_HTTP_header_add(o, - &(*p)->u.HTTP_Response->headers, - "Content-Length", lstr); - } - for (h = (*p)->u.HTTP_Response->headers; h; h = h->next) - { - odr_write(o, (unsigned char *) h->name, strlen(h->name)); - odr_write(o, (unsigned char *) ": ", 2); - odr_write(o, (unsigned char *) h->value, strlen(h->value)); - odr_write(o, (unsigned char *) "\r\n", 2); - } - odr_write(o, (unsigned char *) "\r\n", 2); - if ((*p)->u.HTTP_Response->content_buf) - odr_write(o, (unsigned char *) - (*p)->u.HTTP_Response->content_buf, - (*p)->u.HTTP_Response->content_len); - if (o->direction == ODR_PRINT) - { - fprintf(o->print, "-- HTTP response:\n%.*s\n", o->top - top0, - o->buf + top0); - fprintf(o->print, "-- \n"); - } - break; - case Z_GDU_HTTP_Request: - odr_write(o, (unsigned char *) (*p)->u.HTTP_Request->method, - strlen((*p)->u.HTTP_Request->method)); - odr_write(o, (unsigned char *) " ", 1); - odr_write(o, (unsigned char *) (*p)->u.HTTP_Request->path, - strlen((*p)->u.HTTP_Request->path)); - odr_write(o, (unsigned char *) " HTTP/", 6); - odr_write(o, (unsigned char *) (*p)->u.HTTP_Request->version, - strlen((*p)->u.HTTP_Request->version)); - odr_write(o, (unsigned char *) "\r\n", 2); - if ((*p)->u.HTTP_Request->content_len && - !z_HTTP_header_lookup((*p)->u.HTTP_Request->headers, - "Content-Length")) - { - char lstr[20]; - sprintf(lstr, "%d", (*p)->u.HTTP_Request->content_len); - z_HTTP_header_add(o, - &(*p)->u.HTTP_Request->headers, - "Content-Length", lstr); - } - for (h = (*p)->u.HTTP_Request->headers; h; h = h->next) - { - odr_write(o, (unsigned char *) h->name, strlen(h->name)); - odr_write(o, (unsigned char *) ": ", 2); - odr_write(o, (unsigned char *) h->value, strlen(h->value)); - odr_write(o, (unsigned char *) "\r\n", 2); - } - odr_write(o, (unsigned char *) "\r\n", 2); - if ((*p)->u.HTTP_Request->content_buf) - odr_write(o, (unsigned char *) - (*p)->u.HTTP_Request->content_buf, - (*p)->u.HTTP_Request->content_len); - if (o->direction == ODR_PRINT) - { - fprintf(o->print, "-- HTTP request:\n%.*s\n", o->top, o->buf); - } - break; - case Z_GDU_Z3950: - return z_APDU(o, &(*p)->u.z3950, opt, 0); - } - } - return 1; -} - diff --git a/zutil/zget.c b/zutil/zget.c deleted file mode 100644 index 629f082..0000000 --- a/zutil/zget.c +++ /dev/null @@ -1,498 +0,0 @@ -/* - * Copyright (c) 1995-2003, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: zget.c,v 1.15 2003-10-08 21:48:19 adam Exp $ - */ - -#include - -Z_InitRequest *zget_InitRequest(ODR o) -{ - Z_InitRequest *r = (Z_InitRequest *)odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->options = (Odr_bitmask *)odr_malloc(o, sizeof(*r->options)); - ODR_MASK_ZERO(r->options); - r->protocolVersion = (Odr_bitmask *) - odr_malloc(o, sizeof(*r->protocolVersion)); - - ODR_MASK_SET(r->options, Z_Options_search); - ODR_MASK_SET(r->options, Z_Options_present); - - ODR_MASK_ZERO(r->protocolVersion); - - ODR_MASK_SET(r->protocolVersion, Z_ProtocolVersion_1); - ODR_MASK_SET(r->protocolVersion, Z_ProtocolVersion_2); - - r->preferredMessageSize = odr_intdup(o, 30*1024); - r->maximumRecordSize = odr_intdup(o, 30*1024); - r->idAuthentication = 0; - r->implementationId = "81"; - r->implementationName = "Index Data/YAZ"; - r->implementationVersion = YAZ_VERSION -#ifdef YAZ_DATE_STR - " (" YAZ_DATE_STR ")" -#endif -#ifdef YAZ_OS - " " YAZ_OS -#endif - ; - r->userInformationField = 0; - r->otherInfo = 0; - return r; -} - -Z_InitResponse *zget_InitResponse(ODR o) -{ - Z_InitResponse *r = (Z_InitResponse *)odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->options = (Odr_bitmask *)odr_malloc(o, sizeof(*r->options)); - ODR_MASK_ZERO(r->options); - r->protocolVersion = (Odr_bitmask *)odr_malloc(o, sizeof(*r->protocolVersion)); - ODR_MASK_ZERO(r->protocolVersion); - r->preferredMessageSize = odr_intdup(o, 30*1024); - r->maximumRecordSize = odr_intdup(o, 30*1024); - r->result = odr_intdup(o, 1); - r->implementationId = "81"; - r->implementationName = "Index Data/YAZ"; - r->implementationVersion = YAZ_VERSION -#ifdef YAZ_DATE_STR - " (" YAZ_DATE_STR ")" -#endif -#ifdef YAZ_OS - " " YAZ_OS -#endif - ; - r->userInformationField = 0; - r->otherInfo = 0; - return r; -} - -Z_SearchRequest *zget_SearchRequest(ODR o) -{ - Z_SearchRequest *r = (Z_SearchRequest *)odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->smallSetUpperBound = odr_intdup(o, 0); - r->largeSetLowerBound = odr_intdup(o, 1); - r->mediumSetPresentNumber = odr_intdup(o, 0); - r->replaceIndicator = odr_intdup(o, 1); - r->resultSetName = "default"; - r->num_databaseNames = 0; - r->databaseNames = 0; - r->smallSetElementSetNames = 0; - r->mediumSetElementSetNames = 0; - r->preferredRecordSyntax = 0; - r->query = 0; - r->additionalSearchInfo = 0; - r->otherInfo = 0; - return r; -} - -Z_SearchResponse *zget_SearchResponse(ODR o) -{ - Z_SearchResponse *r = (Z_SearchResponse *)odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->resultCount = odr_intdup(o, 0); - r->numberOfRecordsReturned = odr_intdup(o, 0); - r->nextResultSetPosition = odr_intdup(o, 0); - r->searchStatus = odr_intdup(o, 1); - r->resultSetStatus = 0; - r->presentStatus = 0; - r->records = 0; - r->additionalSearchInfo = 0; - r->otherInfo = 0; - return r; -} - -Z_PresentRequest *zget_PresentRequest(ODR o) -{ - Z_PresentRequest *r = (Z_PresentRequest *)odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->resultSetId = "default"; - r->resultSetStartPoint = odr_intdup(o, 1); - r->numberOfRecordsRequested = odr_intdup(o, 10); - r->num_ranges = 0; - r->additionalRanges = 0; - r->recordComposition = 0; - r->preferredRecordSyntax = 0; - r->maxSegmentCount = 0; - r->maxRecordSize = 0; - r->maxSegmentSize = 0; - r->otherInfo = 0; - return r; -} - -Z_PresentResponse *zget_PresentResponse(ODR o) -{ - Z_PresentResponse *r = (Z_PresentResponse *)odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->numberOfRecordsReturned = odr_intdup(o, 0); - r->nextResultSetPosition = odr_intdup(o, 0); - r->presentStatus = odr_intdup(o, Z_PresentStatus_success); - r->records = 0; - r->otherInfo = 0; - return r; -} - -Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o) -{ - Z_DeleteResultSetRequest *r = (Z_DeleteResultSetRequest *) - odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->deleteFunction = odr_intdup(o, Z_DeleteRequest_list); - r->num_resultSetList = 0; - r->resultSetList = 0; - r->otherInfo = 0; - return r; -} - -Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o) -{ - Z_DeleteResultSetResponse *r = (Z_DeleteResultSetResponse *) - odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->deleteOperationStatus = odr_intdup(o, Z_DeleteStatus_success); - r->deleteListStatuses = 0; - r->numberNotDeleted = 0; - r->bulkStatuses = 0; - r->deleteMessage = 0; - r->otherInfo = 0; - return r; -} - -Z_ScanRequest *zget_ScanRequest(ODR o) -{ - Z_ScanRequest *r = (Z_ScanRequest *)odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->num_databaseNames = 0; - r->databaseNames = 0; - r->attributeSet = 0; - r->termListAndStartPoint = 0; - r->stepSize = 0; - r->numberOfTermsRequested = odr_intdup(o, 20); - r->preferredPositionInResponse = 0; - r->otherInfo = 0; - return r; -} - -Z_ScanResponse *zget_ScanResponse(ODR o) -{ - Z_ScanResponse *r = (Z_ScanResponse *)odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->stepSize = 0; - r->scanStatus = odr_intdup(o, Z_Scan_success); - r->numberOfEntriesReturned = odr_intdup(o, 0); - r->positionOfTerm =0; - r->entries = 0; - r->attributeSet = 0; - r->otherInfo = 0; - return r; -} - -Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o) -{ - Z_TriggerResourceControlRequest *r = (Z_TriggerResourceControlRequest *) - odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->requestedAction = odr_intdup(o, Z_TriggerResourceCtrl_resourceReport); - r->prefResourceReportFormat = 0; - r->resultSetWanted = 0; - r->otherInfo = 0; - return r; -} - -Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o) -{ - Z_ResourceControlRequest *r = (Z_ResourceControlRequest *) - odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->suspendedFlag = 0; - r->resourceReport = 0; - r->partialResultsAvailable = 0; - r->responseRequired = odr_intdup(o, 0); - r->triggeredRequestFlag = 0; - r->otherInfo = 0; - return r; -} - -Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o) -{ - Z_ResourceControlResponse *r = (Z_ResourceControlResponse *) - odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->continueFlag = odr_intdup(o, 1); - r->resultSetWanted = 0; - r->otherInfo = 0; - return r; -} - -Z_AccessControlRequest *zget_AccessControlRequest(ODR o) -{ - Z_AccessControlRequest *r = (Z_AccessControlRequest *) - odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->which = Z_AccessRequest_simpleForm; - r->u.simpleForm = 0; - r->otherInfo = 0; - return r; -} - -Z_AccessControlResponse *zget_AccessControlResponse(ODR o) -{ - Z_AccessControlResponse *r = (Z_AccessControlResponse *) - odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->which = Z_AccessResponse_simpleForm; - r->u.simpleForm = 0; - r->diagnostic = 0; - r->otherInfo = 0; - return r; -} - -Z_Segment *zget_Segment(ODR o) -{ - Z_Segment *r = (Z_Segment *)odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->numberOfRecordsReturned = odr_intdup(o, 0); - r->num_segmentRecords = 0; - r->segmentRecords = (Z_NamePlusRecord **) odr_nullval(); - r->otherInfo = 0; - return r; -} - -Z_Close *zget_Close(ODR o) -{ - Z_Close *r = (Z_Close *)odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->closeReason = odr_intdup(o, Z_Close_finished); - r->diagnosticInformation = 0; - r->resourceReportFormat = 0; - r->resourceReport = 0; - r->otherInfo = 0; - return r; -} - -Z_ResourceReportRequest *zget_ResourceReportRequest(ODR o) -{ - Z_ResourceReportRequest *r = (Z_ResourceReportRequest *) - odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->opId = 0; - r->prefResourceReportFormat = 0; - r->otherInfo = 0; - return r; -} - -Z_ResourceReportResponse *zget_ResourceReportResponse(ODR o) -{ - Z_ResourceReportResponse *r = (Z_ResourceReportResponse *) - odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->resourceReportStatus = odr_intdup(o, Z_ResourceReportStatus_success); - r->resourceReport = 0; - r->otherInfo = 0; - return r; -} - -Z_SortRequest *zget_SortRequest(ODR o) -{ - Z_SortRequest *r = (Z_SortRequest *)odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->inputResultSetNames = 0; - r->sortedResultSetName = 0; - r->sortSequence = 0; - r->otherInfo = 0; - return r; -} - -Z_SortResponse *zget_SortResponse(ODR o) -{ - Z_SortResponse *r = (Z_SortResponse *)odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->sortStatus = odr_intdup(o, Z_SortStatus_success); - r->resultSetStatus = odr_intdup(o, Z_SortResultSetStatus_empty); - r->diagnostics = 0; - r->resultCount = 0; - r->otherInfo = 0; - return r; -} - -Z_ExtendedServicesRequest *zget_ExtendedServicesRequest(ODR o) -{ - Z_ExtendedServicesRequest *r = (Z_ExtendedServicesRequest *) - odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->function = odr_intdup(o, Z_ExtendedServicesRequest_create); - r->packageType = 0; - r->packageName = 0; - r->userId = 0; - r->retentionTime = 0; - r->permissions = 0; - r->description = 0; - r->taskSpecificParameters = 0; - r->waitAction = odr_intdup(o, Z_ExtendedServicesRequest_waitIfPossible); - r->elements = 0; - r->otherInfo = 0; - return r; -} - -Z_ExtendedServicesResponse *zget_ExtendedServicesResponse(ODR o) -{ - Z_ExtendedServicesResponse *r = (Z_ExtendedServicesResponse *) - odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->operationStatus = odr_intdup(o, Z_ExtendedServicesResponse_done); - r->num_diagnostics = 0; - r->diagnostics = 0; - r->taskPackage = 0; - r->otherInfo = 0; - return r; -} - -Z_DuplicateDetectionRequest *zget_DuplicateDetectionRequest(ODR o) -{ - Z_DuplicateDetectionRequest *r = (Z_DuplicateDetectionRequest *) - odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->num_inputResultSetIds = 0; - r->inputResultSetIds = 0; - r->outputResultSetName = 0; - r->applicablePortionOfRecord = 0; - r->num_duplicateDetectionCriteria = 0; - r->duplicateDetectionCriteria = 0; - r->clustering = 0; - r->num_retentionCriteria = 0; - r->retentionCriteria = 0; - r->num_sortCriteria = 0; - r->sortCriteria = 0; - r->otherInfo = 0; - return r; -} - -Z_DuplicateDetectionResponse *zget_DuplicateDetectionResponse(ODR o) -{ - Z_DuplicateDetectionResponse *r = (Z_DuplicateDetectionResponse *) - odr_malloc(o, sizeof(*r)); - - r->referenceId = 0; - r->status = odr_intdup(o, Z_DuplicateDetectionResponse_success); - r->resultSetCount = 0; - r->num_diagnostics = 0; - r->diagnostics = 0; - r->otherInfo = 0; - return r; -} - -Z_APDU *zget_APDU(ODR o, int which) -{ - Z_APDU *r = (Z_APDU *)odr_malloc(o, sizeof(*r)); - - switch (r->which = which) - { - case Z_APDU_initRequest: - r->u.initRequest = zget_InitRequest(o); - break; - case Z_APDU_initResponse: - r->u.initResponse = zget_InitResponse(o); - break; - case Z_APDU_searchRequest: - r->u.searchRequest = zget_SearchRequest(o); - break; - case Z_APDU_searchResponse: - r->u.searchResponse = zget_SearchResponse(o); - break; - case Z_APDU_presentRequest: - r->u.presentRequest = zget_PresentRequest(o); - break; - case Z_APDU_presentResponse: - r->u.presentResponse = zget_PresentResponse(o); - break; - case Z_APDU_deleteResultSetRequest: - r->u.deleteResultSetRequest = zget_DeleteResultSetRequest(o); - break; - case Z_APDU_deleteResultSetResponse: - r->u.deleteResultSetResponse = zget_DeleteResultSetResponse(o); - break; - case Z_APDU_scanRequest: - r->u.scanRequest = zget_ScanRequest(o); - break; - case Z_APDU_scanResponse: - r->u.scanResponse = zget_ScanResponse(o); - break; - case Z_APDU_triggerResourceControlRequest: - r->u.triggerResourceControlRequest = - zget_TriggerResourceControlRequest(o); - break; - case Z_APDU_resourceControlRequest: - r->u.resourceControlRequest = zget_ResourceControlRequest(o); - break; - case Z_APDU_resourceControlResponse: - r->u.resourceControlResponse = zget_ResourceControlResponse(o); - break; - case Z_APDU_segmentRequest: - r->u.segmentRequest = zget_Segment(o); - break; - case Z_APDU_close: - r->u.close = zget_Close(o); - break; - case Z_APDU_accessControlRequest: - r->u.accessControlRequest = zget_AccessControlRequest(o); - break; - case Z_APDU_accessControlResponse: - r->u.accessControlResponse = zget_AccessControlResponse(o); - break; - case Z_APDU_resourceReportRequest: - r->u.resourceReportRequest = zget_ResourceReportRequest(o); - break; - case Z_APDU_resourceReportResponse: - r->u.resourceReportResponse = zget_ResourceReportResponse(o); - break; - case Z_APDU_sortRequest: - r->u.sortRequest = zget_SortRequest(o); - break; - case Z_APDU_sortResponse: - r->u.sortResponse = zget_SortResponse(o); - break; - case Z_APDU_extendedServicesRequest: - r->u.extendedServicesRequest = zget_ExtendedServicesRequest(o); - break; - case Z_APDU_extendedServicesResponse: - r->u.extendedServicesResponse = zget_ExtendedServicesResponse(o); - break; - case Z_APDU_duplicateDetectionRequest: - r->u.duplicateDetectionRequest = zget_DuplicateDetectionRequest(o); - break; - case Z_APDU_duplicateDetectionResponse: - r->u.duplicateDetectionResponse = zget_DuplicateDetectionResponse(o); - break; - default: - fprintf(stderr, "Bad APDU-type to zget_APDU"); - exit(1); - } - return r; -} diff --git a/zutil/zoom-c.c b/zutil/zoom-c.c deleted file mode 100644 index 59b051d..0000000 --- a/zutil/zoom-c.c +++ /dev/null @@ -1,3224 +0,0 @@ -/* - * Copyright (c) 2000-2003, Index Data - * See the file LICENSE for details. - * - * $Id: zoom-c.c,v 1.41 2003-08-19 12:32:29 adam Exp $ - * - * ZOOM layer for C, connections, result sets, queries. - */ -#include -#include -#include "zoom-p.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if HAVE_SYS_POLL_H -#include -#endif - -typedef enum { - zoom_pending, - zoom_complete -} zoom_ret; - -static zoom_ret ZOOM_connection_send_init (ZOOM_connection c); -static zoom_ret do_write_ex (ZOOM_connection c, char *buf_out, int len_out); - -static ZOOM_Event ZOOM_Event_create (int kind) -{ - ZOOM_Event event = (ZOOM_Event) xmalloc (sizeof(*event)); - event->kind = kind; - event->next = 0; - event->prev = 0; - return event; -} - -static void ZOOM_Event_destroy (ZOOM_Event event) -{ - xfree (event); -} - -static void ZOOM_connection_put_event (ZOOM_connection c, ZOOM_Event event) -{ - if (c->m_queue_back) - { - c->m_queue_back->prev = event; - assert (c->m_queue_front); - } - else - { - assert (!c->m_queue_front); - c->m_queue_front = event; - } - event->next = c->m_queue_back; - event->prev = 0; - c->m_queue_back = event; -} - -static ZOOM_Event ZOOM_connection_get_event(ZOOM_connection c) -{ - ZOOM_Event event = c->m_queue_front; - if (!event) - { - c->last_event = ZOOM_EVENT_NONE; - return 0; - } - assert (c->m_queue_back); - c->m_queue_front = event->prev; - if (c->m_queue_front) - { - assert (c->m_queue_back); - c->m_queue_front->next = 0; - } - else - c->m_queue_back = 0; - c->last_event = event->kind; - return event; -} - - -static void set_dset_error (ZOOM_connection c, int error, - const char *dset, - const char *addinfo, const char *addinfo2) -{ - xfree (c->addinfo); - c->addinfo = 0; - c->error = error; - c->diagset = dset; - if (addinfo && addinfo2) - { - c->addinfo = xmalloc(strlen(addinfo) + strlen(addinfo2) + 2); - strcpy(c->addinfo, addinfo); - strcat(c->addinfo, addinfo2); - } - else if (addinfo) - c->addinfo = xstrdup(addinfo); - if (error) - yaz_log(LOG_DEBUG, "Error %s %s:%d %s %s", - c->host_port ? c->host_port : "<>", dset, error, - addinfo ? addinfo : "", - addinfo2 ? addinfo2 : ""); -} - -#if HAVE_XML2 -static void set_HTTP_error (ZOOM_connection c, int error, - const char *addinfo, const char *addinfo2) -{ - set_dset_error(c, error, "HTTP", addinfo, addinfo2); -} -#endif - -static void set_ZOOM_error (ZOOM_connection c, int error, - const char *addinfo) -{ - set_dset_error(c, error, "ZOOM", addinfo, 0); -} - -static void clear_error (ZOOM_connection c) -{ - - switch (c->error) - { - case ZOOM_ERROR_CONNECT: - case ZOOM_ERROR_MEMORY: - case ZOOM_ERROR_DECODE: - case ZOOM_ERROR_CONNECTION_LOST: - case ZOOM_ERROR_INIT: - case ZOOM_ERROR_INTERNAL: - case ZOOM_ERROR_UNSUPPORTED_PROTOCOL: - break; - default: - set_ZOOM_error(c, ZOOM_ERROR_NONE, 0); - } -} - -ZOOM_task ZOOM_connection_add_task (ZOOM_connection c, int which) -{ - ZOOM_task *taskp = &c->tasks; - while (*taskp) - taskp = &(*taskp)->next; - *taskp = (ZOOM_task) xmalloc (sizeof(**taskp)); - (*taskp)->running = 0; - (*taskp)->which = which; - (*taskp)->next = 0; - clear_error (c); - return *taskp; -} - -ZOOM_task ZOOM_connection_insert_task (ZOOM_connection c, int which) -{ - ZOOM_task task = (ZOOM_task) xmalloc (sizeof(*task)); - - task->next = c->tasks; - c->tasks = task; - - task->running = 0; - task->which = which; - clear_error (c); - return task; -} - -void ZOOM_connection_remove_task (ZOOM_connection c) -{ - ZOOM_task task = c->tasks; - - if (task) - { - c->tasks = task->next; - switch (task->which) - { - case ZOOM_TASK_SEARCH: - - ZOOM_resultset_destroy (task->u.search.resultset); - break; - case ZOOM_TASK_RETRIEVE: - ZOOM_resultset_destroy (task->u.retrieve.resultset); - break; - case ZOOM_TASK_CONNECT: - break; - case ZOOM_TASK_SCAN: - ZOOM_scanset_destroy (task->u.scan.scan); - break; - case ZOOM_TASK_PACKAGE: - ZOOM_package_destroy (task->u.package); - break; - default: - assert (0); - } - xfree (task); - } -} - -static int ZOOM_connection_exec_task (ZOOM_connection c); - -void ZOOM_connection_remove_tasks (ZOOM_connection c) -{ - while (c->tasks) - ZOOM_connection_remove_task(c); -} - -static ZOOM_record record_cache_lookup (ZOOM_resultset r, int pos); - -ZOOM_API(ZOOM_connection) -ZOOM_connection_create (ZOOM_options options) -{ - ZOOM_connection c = (ZOOM_connection) xmalloc (sizeof(*c)); - - c->proto = PROTO_Z3950; - c->cs = 0; - c->mask = 0; - c->reconnect_ok = 0; - c->state = STATE_IDLE; - c->addinfo = 0; - set_ZOOM_error(c, ZOOM_ERROR_NONE, 0); - c->buf_in = 0; - c->len_in = 0; - c->buf_out = 0; - c->len_out = 0; - c->resultsets = 0; - - c->options = ZOOM_options_create_with_parent(options); - - c->host_port = 0; - c->path = 0; - c->proxy = 0; - - c->charset = c->lang = 0; - - c->cookie_out = 0; - c->cookie_in = 0; - c->client_IP = 0; - c->tasks = 0; - - c->odr_in = odr_createmem (ODR_DECODE); - c->odr_out = odr_createmem (ODR_ENCODE); - - c->async = 0; - c->support_named_resultsets = 0; - c->last_event = ZOOM_EVENT_NONE; - - c->m_queue_front = 0; - c->m_queue_back = 0; - return c; -} - -/* set database names. Take local databases (if set); otherwise - take databases given in ZURL (if set); otherwise use Default */ -static char **set_DatabaseNames (ZOOM_connection con, ZOOM_options options, - int *num) -{ - char **databaseNames; - const char *c; - int no = 2; - const char *cp = ZOOM_options_get (options, "databaseName"); - - if (!cp || !*cp) - { - if (strncmp (con->host_port, "unix:", 5) == 0) - cp = strchr (con->host_port+5, ':'); - else - cp = strchr (con->host_port, '/'); - if (cp) - cp++; - } - if (cp) - { - c = cp; - while ((c = strchr(c, '+'))) - { - c++; - no++; - } - } - else - cp = "Default"; - databaseNames = (char**) - odr_malloc (con->odr_out, no * sizeof(*databaseNames)); - no = 0; - while (*cp) - { - c = strchr (cp, '+'); - if (!c) - c = cp + strlen(cp); - else if (c == cp) - { - cp++; - continue; - } - /* cp ptr to first char of db name, c is char - following db name */ - databaseNames[no] = (char*) odr_malloc (con->odr_out, 1+c-cp); - memcpy (databaseNames[no], cp, c-cp); - databaseNames[no++][c-cp] = '\0'; - cp = c; - if (*cp) - cp++; - } - databaseNames[no] = NULL; - *num = no; - return databaseNames; -} - -ZOOM_API(ZOOM_connection) -ZOOM_connection_new (const char *host, int portnum) -{ - ZOOM_connection c = ZOOM_connection_create (0); - - ZOOM_connection_connect (c, host, portnum); - return c; -} - -ZOOM_API(void) -ZOOM_connection_connect(ZOOM_connection c, - const char *host, int portnum) -{ - const char *val; - ZOOM_task task; - - if (c->cs) - { - yaz_log (LOG_DEBUG, "reconnect"); - c->reconnect_ok = 1; - return; - } - yaz_log(LOG_DEBUG, "connect"); - xfree (c->proxy); - val = ZOOM_options_get (c->options, "proxy"); - if (val && *val) - c->proxy = xstrdup (val); - else - c->proxy = 0; - - xfree (c->charset); - val = ZOOM_options_get (c->options, "charset"); - if (val && *val) - c->charset = xstrdup (val); - else - c->charset = 0; - - xfree (c->lang); - val = ZOOM_options_get (c->options, "lang"); - if (val && *val) - c->lang = xstrdup (val); - else - c->lang = 0; - - xfree (c->host_port); - if (portnum) - { - char hostn[128]; - sprintf (hostn, "%.80s:%d", host, portnum); - c->host_port = xstrdup(hostn); - } - else - c->host_port = xstrdup(host); - - ZOOM_options_set(c->options, "host", c->host_port); - - val = ZOOM_options_get (c->options, "cookie"); - if (val && *val) - c->cookie_out = xstrdup (val); - - val = ZOOM_options_get (c->options, "clientIP"); - if (val && *val) - c->client_IP = xstrdup (val); - - c->async = ZOOM_options_get_bool (c->options, "async", 0); - - set_ZOOM_error(c, ZOOM_ERROR_NONE, 0); - - task = ZOOM_connection_add_task (c, ZOOM_TASK_CONNECT); - - if (!c->async) - { - while (ZOOM_event (1, &c)) - ; - } -} - -ZOOM_API(ZOOM_query) -ZOOM_query_create(void) -{ - ZOOM_query s = (ZOOM_query) xmalloc (sizeof(*s)); - - s->refcount = 1; - s->z_query = 0; - s->sort_spec = 0; - s->odr = odr_createmem (ODR_ENCODE); - s->query_string = 0; - - return s; -} - -ZOOM_API(void) -ZOOM_query_destroy(ZOOM_query s) -{ - if (!s) - return; - - (s->refcount)--; - yaz_log (LOG_DEBUG, "ZOOM_query_destroy count=%d", s->refcount); - if (s->refcount == 0) - { - odr_destroy (s->odr); - xfree (s); - } -} - -ZOOM_API(int) -ZOOM_query_prefix(ZOOM_query s, const char *str) -{ - s->query_string = odr_strdup(s->odr, str); - s->z_query = (Z_Query *) odr_malloc (s->odr, sizeof(*s->z_query)); - s->z_query->which = Z_Query_type_1; - s->z_query->u.type_1 = p_query_rpn(s->odr, PROTO_Z3950, str); - if (!s->z_query->u.type_1) - return -1; - return 0; -} - -ZOOM_API(int) -ZOOM_query_cql(ZOOM_query s, const char *str) -{ - Z_External *ext; - - s->query_string = odr_strdup(s->odr, str); - - ext = (Z_External *) odr_malloc(s->odr, sizeof(*ext)); - ext->direct_reference = odr_getoidbystr(s->odr, "1.2.840.10003.16.2"); - ext->indirect_reference = 0; - ext->descriptor = 0; - ext->which = Z_External_CQL; - ext->u.cql = s->query_string; - - s->z_query = (Z_Query *) odr_malloc (s->odr, sizeof(*s->z_query)); - s->z_query->which = Z_Query_type_104; - s->z_query->u.type_104 = ext; - - return 0; -} - -ZOOM_API(int) -ZOOM_query_sortby(ZOOM_query s, const char *criteria) -{ - s->sort_spec = yaz_sort_spec (s->odr, criteria); - if (!s->sort_spec) - return -1; - return 0; -} - -static zoom_ret do_write(ZOOM_connection c); - -ZOOM_API(void) -ZOOM_connection_destroy(ZOOM_connection c) -{ - ZOOM_resultset r; - if (!c) - return; - if (c->cs) - cs_close (c->cs); - for (r = c->resultsets; r; r = r->next) - r->connection = 0; - - xfree (c->buf_in); - xfree (c->addinfo); - odr_destroy (c->odr_in); - odr_destroy (c->odr_out); - ZOOM_options_destroy (c->options); - ZOOM_connection_remove_tasks (c); - xfree (c->host_port); - xfree (c->path); - xfree (c->proxy); - xfree (c->charset); - xfree (c->lang); - xfree (c->cookie_out); - xfree (c->cookie_in); - xfree (c->client_IP); - xfree (c); -} - -void ZOOM_resultset_addref (ZOOM_resultset r) -{ - if (r) - { - (r->refcount)++; - yaz_log (LOG_DEBUG, "ZOOM_resultset_addref r=%p count=%d", - r, r->refcount); - } -} -ZOOM_resultset ZOOM_resultset_create () -{ - ZOOM_resultset r = (ZOOM_resultset) xmalloc (sizeof(*r)); - - yaz_log (LOG_DEBUG, "ZOOM_resultset_create r = %p", r); - r->refcount = 1; - r->size = 0; - r->odr = odr_createmem (ODR_ENCODE); - r->start = 0; - r->piggyback = 1; - r->setname = 0; - r->schema = 0; - r->count = 0; - r->step = 0; - r->record_cache = 0; - r->r_sort_spec = 0; - r->query = 0; - r->connection = 0; - r->next = 0; - return r; -} - -ZOOM_API(ZOOM_resultset) -ZOOM_connection_search_pqf(ZOOM_connection c, const char *q) -{ - ZOOM_resultset r; - ZOOM_query s = ZOOM_query_create(); - - ZOOM_query_prefix (s, q); - - r = ZOOM_connection_search (c, s); - ZOOM_query_destroy (s); - return r; -} - -ZOOM_API(ZOOM_resultset) -ZOOM_connection_search(ZOOM_connection c, ZOOM_query q) -{ - ZOOM_resultset r = ZOOM_resultset_create (); - ZOOM_task task; - const char *cp; - - r->r_sort_spec = q->sort_spec; - r->query = q; - - r->options = ZOOM_options_create_with_parent(c->options); - - r->start = ZOOM_options_get_int(r->options, "start", 0); - r->count = ZOOM_options_get_int(r->options, "count", 0); - r->step = ZOOM_options_get_int(r->options, "step", 0); - r->piggyback = ZOOM_options_get_bool (r->options, "piggyback", 1); - cp = ZOOM_options_get (r->options, "setname"); - if (cp) - r->setname = xstrdup(cp); - cp = ZOOM_options_get (r->options, "schema"); - if (cp) - r->schema = xstrdup(cp); - - r->connection = c; - - r->next = c->resultsets; - c->resultsets = r; - - if (c->host_port && c->proto == PROTO_HTTP) - { - if (!c->cs) - { - yaz_log(LOG_DEBUG, "NO COMSTACK"); - ZOOM_connection_add_task(c, ZOOM_TASK_CONNECT); - } - else - { - yaz_log(LOG_DEBUG, "PREPARE FOR RECONNECT"); - c->reconnect_ok = 1; - } - } - - task = ZOOM_connection_add_task (c, ZOOM_TASK_SEARCH); - task->u.search.resultset = r; - ZOOM_resultset_addref (r); - - (q->refcount)++; - - if (!c->async) - { - while (ZOOM_event (1, &c)) - ; - } - return r; -} - -ZOOM_API(void) -ZOOM_resultset_destroy(ZOOM_resultset r) -{ - if (!r) - return; - (r->refcount)--; - yaz_log (LOG_DEBUG, "ZOOM_resultset_destroy r = %p count=%d", - r, r->refcount); - if (r->refcount == 0) - { - ZOOM_record_cache rc; - - for (rc = r->record_cache; rc; rc = rc->next) - { - if (rc->rec.wrbuf_marc) - wrbuf_free (rc->rec.wrbuf_marc, 1); - if (rc->rec.wrbuf_iconv) - wrbuf_free (rc->rec.wrbuf_iconv, 1); - if (rc->rec.wrbuf_opac) - wrbuf_free (rc->rec.wrbuf_opac, 1); - } - if (r->connection) - { - /* remove ourselves from the resultsets in connection */ - ZOOM_resultset *rp = &r->connection->resultsets; - while (1) - { - assert (*rp); /* we must be in this list!! */ - if (*rp == r) - { /* OK, we're here - take us out of it */ - *rp = (*rp)->next; - break; - } - rp = &(*rp)->next; - } - } - ZOOM_query_destroy (r->query); - ZOOM_options_destroy (r->options); - odr_destroy (r->odr); - xfree (r->setname); - xfree (r->schema); - xfree (r); - } -} - -ZOOM_API(size_t) -ZOOM_resultset_size (ZOOM_resultset r) -{ - return r->size; -} - -static void do_close (ZOOM_connection c) -{ - if (c->cs) - cs_close(c->cs); - c->cs = 0; - c->mask = 0; - c->state = STATE_IDLE; -} - -static void ZOOM_resultset_retrieve (ZOOM_resultset r, - int force_sync, int start, int count) -{ - ZOOM_task task; - ZOOM_connection c; - const char *cp; - - if (!r) - return; - c = r->connection; - if (!c) - return; - - if (c->host_port && c->proto == PROTO_HTTP) - { - if (!c->cs) - { - yaz_log(LOG_DEBUG, "NO COMSTACK"); - ZOOM_connection_add_task(c, ZOOM_TASK_CONNECT); - } - else - { - yaz_log(LOG_DEBUG, "PREPARE FOR RECONNECT"); - c->reconnect_ok = 1; - } - } - task = ZOOM_connection_add_task (c, ZOOM_TASK_RETRIEVE); - task->u.retrieve.resultset = r; - task->u.retrieve.start = start; - task->u.retrieve.count = count; - - cp = ZOOM_options_get (r->options, "schema"); - if (cp) - { - if (!r->schema || strcmp(r->schema, cp)) - { - xfree(r->schema); - r->schema = xstrdup(cp); - } - } - - ZOOM_resultset_addref (r); - - if (!r->connection->async || force_sync) - while (r->connection && ZOOM_event (1, &r->connection)) - ; -} - -ZOOM_API(void) -ZOOM_resultset_records (ZOOM_resultset r, ZOOM_record *recs, - size_t start, size_t count) -{ - int force_present = 0; - - if (!r) - return ; - if (count && recs) - force_present = 1; - ZOOM_resultset_retrieve (r, force_present, start, count); - if (force_present) - { - size_t i; - for (i = 0; i< count; i++) - recs[i] = ZOOM_resultset_record_immediate (r, i+start); - } -} - -static zoom_ret do_connect (ZOOM_connection c) -{ - void *add; - const char *effective_host; - - if (c->proxy) - effective_host = c->proxy; - else - effective_host = c->host_port; - - yaz_log (LOG_DEBUG, "do_connect host=%s", effective_host); - - assert (!c->cs); - c->cs = cs_create_host (effective_host, 0, &add); - - if (c->cs && c->cs->protocol == PROTO_HTTP) - { -#if HAVE_XML2 - const char *path = 0; - - c->proto = PROTO_HTTP; - cs_get_host_args(c->host_port, &path); - xfree(c->path); - c->path = xmalloc(strlen(path)+2); - c->path[0] = '/'; - strcpy (c->path+1, path); -#else - set_ZOOM_error(c, ZOOM_ERROR_UNSUPPORTED_PROTOCOL, "SRW"); - do_close(c); - return zoom_complete; -#endif - } - if (c->cs) - { - int ret = cs_connect (c->cs, add); - if (ret == 0) - { - ZOOM_Event event = ZOOM_Event_create(ZOOM_EVENT_CONNECT); - ZOOM_connection_put_event(c, event); - if (c->proto == PROTO_Z3950) - ZOOM_connection_send_init(c); - else - { - /* no init request for SRW .. */ - assert (c->tasks->which == ZOOM_TASK_CONNECT); - ZOOM_connection_remove_task (c); - c->mask = 0; - ZOOM_connection_exec_task (c); - } - c->state = STATE_ESTABLISHED; - return zoom_pending; - } - else if (ret > 0) - { - c->state = STATE_CONNECTING; - c->mask = ZOOM_SELECT_EXCEPT; - if (c->cs->io_pending & CS_WANT_WRITE) - c->mask += ZOOM_SELECT_WRITE; - if (c->cs->io_pending & CS_WANT_READ) - c->mask += ZOOM_SELECT_READ; - return zoom_pending; - } - } - c->state = STATE_IDLE; - set_ZOOM_error(c, ZOOM_ERROR_CONNECT, effective_host); - return zoom_complete; -} - -int z3950_connection_socket(ZOOM_connection c) -{ - if (c->cs) - return cs_fileno(c->cs); - return -1; -} - -int z3950_connection_mask(ZOOM_connection c) -{ - if (c->cs) - return c->mask; - return 0; -} - -static void otherInfo_attach (ZOOM_connection c, Z_APDU *a, ODR out) -{ - int i; - for (i = 0; i<200; i++) - { - size_t len; - Z_OtherInformation **oi; - char buf[80]; - const char *val; - const char *cp; - int oidval; - - sprintf (buf, "otherInfo%d", i); - val = ZOOM_options_get (c->options, buf); - if (!val) - break; - cp = strchr (val, ':'); - if (!cp) - continue; - len = cp - val; - if (len >= sizeof(buf)) - len = sizeof(buf)-1; - memcpy (buf, val, len); - buf[len] = '\0'; - oidval = oid_getvalbyname (buf); - if (oidval == VAL_NONE) - continue; - - yaz_oi_APDU(a, &oi); - yaz_oi_set_string_oidval(oi, out, oidval, 1, cp+1); - } -} - -static int encode_APDU(ZOOM_connection c, Z_APDU *a, ODR out) -{ - assert (a); - if (c->cookie_out) - { - Z_OtherInformation **oi; - yaz_oi_APDU(a, &oi); - yaz_oi_set_string_oidval(oi, out, VAL_COOKIE, 1, c->cookie_out); - } - if (c->client_IP) - { - Z_OtherInformation **oi; - yaz_oi_APDU(a, &oi); - yaz_oi_set_string_oidval(oi, out, VAL_CLIENT_IP, 1, c->client_IP); - } - otherInfo_attach (c, a, out); - if (!z_APDU(out, &a, 0, 0)) - { - FILE *outf = fopen("/tmp/apdu.txt", "a"); - if (a && outf) - { - ODR odr_pr = odr_createmem(ODR_PRINT); - fprintf (outf, "a=%p\n", a); - odr_setprint(odr_pr, outf); - z_APDU(odr_pr, &a, 0, 0); - odr_destroy(odr_pr); - } - yaz_log (LOG_DEBUG, "encoding failed"); - set_ZOOM_error(c, ZOOM_ERROR_ENCODE, 0); - odr_reset(out); - return -1; - } - - return 0; -} - -static zoom_ret send_APDU (ZOOM_connection c, Z_APDU *a) -{ - ZOOM_Event event; - assert (a); - if (encode_APDU(c, a, c->odr_out)) - return zoom_complete; - yaz_log(LOG_DEBUG, "send APDU type=%d", a->which); - c->buf_out = odr_getbuf(c->odr_out, &c->len_out, 0); - event = ZOOM_Event_create (ZOOM_EVENT_SEND_APDU); - ZOOM_connection_put_event (c, event); - odr_reset(c->odr_out); - return do_write (c); -} - -/* returns 1 if PDU was sent OK (still pending ) - 0 if PDU was not sent OK (nothing to wait for) -*/ - -static zoom_ret ZOOM_connection_send_init (ZOOM_connection c) -{ - const char *impname; - Z_APDU *apdu = zget_APDU(c->odr_out, Z_APDU_initRequest); - Z_InitRequest *ireq = apdu->u.initRequest; - Z_IdAuthentication *auth = (Z_IdAuthentication *) - odr_malloc(c->odr_out, sizeof(*auth)); - const char *auth_groupId = ZOOM_options_get (c->options, "group"); - const char *auth_userId = ZOOM_options_get (c->options, "user"); - const char *auth_password = ZOOM_options_get (c->options, "pass"); - - ODR_MASK_SET(ireq->options, Z_Options_search); - ODR_MASK_SET(ireq->options, Z_Options_present); - ODR_MASK_SET(ireq->options, Z_Options_scan); - ODR_MASK_SET(ireq->options, Z_Options_sort); - ODR_MASK_SET(ireq->options, Z_Options_extendedServices); - ODR_MASK_SET(ireq->options, Z_Options_namedResultSets); - - ODR_MASK_SET(ireq->protocolVersion, Z_ProtocolVersion_1); - ODR_MASK_SET(ireq->protocolVersion, Z_ProtocolVersion_2); - ODR_MASK_SET(ireq->protocolVersion, Z_ProtocolVersion_3); - - impname = ZOOM_options_get (c->options, "implementationName"); - ireq->implementationName = - (char *) odr_malloc (c->odr_out, 15 + (impname ? strlen(impname) : 0)); - strcpy (ireq->implementationName, ""); - if (impname) - { - strcat (ireq->implementationName, impname); - strcat (ireq->implementationName, "/"); - } - strcat (ireq->implementationName, "ZOOM-C/YAZ"); - - *ireq->maximumRecordSize = - ZOOM_options_get_int (c->options, "maximumRecordSize", 1024*1024); - *ireq->preferredMessageSize = - ZOOM_options_get_int (c->options, "preferredMessageSize", 1024*1024); - - if (auth_groupId || auth_password) - { - Z_IdPass *pass = (Z_IdPass *) odr_malloc(c->odr_out, sizeof(*pass)); - int i = 0; - pass->groupId = 0; - if (auth_groupId && *auth_groupId) - { - pass->groupId = (char *) - odr_malloc(c->odr_out, strlen(auth_groupId)+1); - strcpy(pass->groupId, auth_groupId); - i++; - } - pass->userId = 0; - if (auth_userId && *auth_userId) - { - pass->userId = (char *) - odr_malloc(c->odr_out, strlen(auth_userId)+1); - strcpy(pass->userId, auth_userId); - i++; - } - pass->password = 0; - if (auth_password && *auth_password) - { - pass->password = (char *) - odr_malloc(c->odr_out, strlen(auth_password)+1); - strcpy(pass->password, auth_password); - i++; - } - if (i) - { - auth->which = Z_IdAuthentication_idPass; - auth->u.idPass = pass; - ireq->idAuthentication = auth; - } - } - else if (auth_userId) - { - auth->which = Z_IdAuthentication_open; - auth->u.open = (char *) - odr_malloc(c->odr_out, strlen(auth_userId)+1); - strcpy(auth->u.open, auth_userId); - ireq->idAuthentication = auth; - } - if (c->proxy) - yaz_oi_set_string_oidval(&ireq->otherInfo, c->odr_out, - VAL_PROXY, 1, c->host_port); - if (c->charset||c->lang) - { - Z_OtherInformation **oi; - Z_OtherInformationUnit *oi_unit; - - yaz_oi_APDU(apdu, &oi); - - if ((oi_unit = yaz_oi_update(oi, c->odr_out, NULL, 0, 0))) - { - ODR_MASK_SET(ireq->options, Z_Options_negotiationModel); - - oi_unit->which = Z_OtherInfo_externallyDefinedInfo; - oi_unit->information.externallyDefinedInfo = - yaz_set_proposal_charneg - (c->odr_out, - (const char **)&c->charset, (c->charset) ? 1:0, - (const char **)&c->lang, (c->lang) ? 1:0, 1); - } - } - assert (apdu); - return send_APDU (c, apdu); -} - -#if HAVE_XML2 -static zoom_ret send_srw (ZOOM_connection c, Z_SRW_PDU *sr) -{ - char ctype[50]; - Z_SOAP_Handler h[2] = { - {"http://www.loc.gov/zing/srw/v1.0/", 0, (Z_SOAP_fun) yaz_srw_codec}, - {0, 0, 0} - }; - ODR o = odr_createmem(ODR_ENCODE); - int ret; - Z_SOAP *p = odr_malloc(o, sizeof(*p)); - Z_GDU *gdu; - ZOOM_Event event; - - gdu = z_get_HTTP_Request(c->odr_out); - gdu->u.HTTP_Request->path = c->path; - - if (c->host_port) - { - const char *cp0 = strstr(c->host_port, "://"); - const char *cp1 = 0; - if (cp0) - cp0 = cp0+3; - else - cp0 = c->host_port; - - cp1 = strchr(cp0, '/'); - if (!cp1) - cp1 = cp0+strlen(cp0); - - if (cp0 && cp1) - { - char *h = odr_malloc(c->odr_out, cp1 - cp0 + 1); - memcpy (h, cp0, cp1 - cp0); - h[cp1-cp0] = '\0'; - z_HTTP_header_add(c->odr_out, &gdu->u.HTTP_Request->headers, - "host", h); - } - } - - strcpy(ctype, "text/xml"); - if (c->charset && strlen(c->charset) < 20) - { - strcat(ctype, "; charset="); - strcat(ctype, c->charset); - } - z_HTTP_header_add(c->odr_out, &gdu->u.HTTP_Request->headers, - "Content-Type", ctype); - z_HTTP_header_add(c->odr_out, &gdu->u.HTTP_Request->headers, - "SOAPAction", "\"\""); - p->which = Z_SOAP_generic; - p->u.generic = odr_malloc(o, sizeof(*p->u.generic)); - p->u.generic->no = 0; - p->u.generic->ns = 0; - p->u.generic->p = sr; - p->ns = "http://schemas.xmlsoap.org/soap/envelope/"; - - ret = z_soap_codec_enc(o, &p, - &gdu->u.HTTP_Request->content_buf, - &gdu->u.HTTP_Request->content_len, h, - c->charset); - - if (!z_GDU(c->odr_out, &gdu, 0, 0)) - return zoom_complete; - c->buf_out = odr_getbuf(c->odr_out, &c->len_out, 0); - - odr_destroy(o); - - event = ZOOM_Event_create (ZOOM_EVENT_SEND_APDU); - ZOOM_connection_put_event (c, event); - odr_reset(c->odr_out); - return do_write (c); -} -#endif - -#if HAVE_XML2 -static zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c) -{ - int i; - ZOOM_resultset resultset = 0; - Z_SRW_PDU *sr = 0; - const char *recordPacking = 0; - - if (c->error) /* don't continue on error */ - return zoom_complete; - assert (c->tasks); - if (c->tasks->which == ZOOM_TASK_SEARCH) - { - resultset = c->tasks->u.search.resultset; - resultset->setname = xstrdup ("default"); - ZOOM_options_set (resultset->options, "setname", resultset->setname); - } - else if(c->tasks->which == ZOOM_TASK_RETRIEVE) - { - resultset = c->tasks->u.retrieve.resultset; - - resultset->start = c->tasks->u.retrieve.start; - resultset->count = c->tasks->u.retrieve.count; - - if (resultset->start >= resultset->size) - return zoom_complete; - if (resultset->start + resultset->count > resultset->size) - resultset->count = resultset->size - resultset->start; - - for (i = 0; icount; i++) - { - ZOOM_record rec = - record_cache_lookup (resultset, i + resultset->start); - if (!rec) - break; - } - if (i == resultset->count) - return zoom_complete; - } - assert(resultset->query); - - sr = yaz_srw_get(c->odr_out, Z_SRW_searchRetrieve_request); - - if (resultset->query->z_query->which == Z_Query_type_104 - && resultset->query->z_query->u.type_104->which == Z_External_CQL) - { - - sr->u.request->query_type = Z_SRW_query_type_cql; - sr->u.request->query.cql =resultset->query->z_query->u.type_104->u.cql; - } - else if (resultset->query->z_query->which == Z_Query_type_1 && - resultset->query->z_query->u.type_1) - { - sr->u.request->query_type = Z_SRW_query_type_pqf; - sr->u.request->query.pqf = resultset->query->query_string; - } - else - { - set_ZOOM_error(c, ZOOM_ERROR_UNSUPPORTED_QUERY, 0); - return zoom_complete; - } - sr->u.request->startRecord = odr_intdup (c->odr_out, resultset->start + 1); - sr->u.request->maximumRecords = odr_intdup ( - c->odr_out, resultset->step>0 ? resultset->step : resultset->count); - sr->u.request->recordSchema = resultset->schema; - - recordPacking = ZOOM_resultset_option_get (resultset, "recordPacking"); - - if (recordPacking) - sr->u.request->recordPacking = odr_strdup(c->odr_out, recordPacking); - - return send_srw(c, sr); -} -#else -static zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c) -{ - return zoom_complete; -} -#endif - -static zoom_ret ZOOM_connection_send_search (ZOOM_connection c) -{ - ZOOM_resultset r; - int lslb, ssub, mspn; - const char *syntax; - Z_APDU *apdu = zget_APDU(c->odr_out, Z_APDU_searchRequest); - Z_SearchRequest *search_req = apdu->u.searchRequest; - const char *elementSetName; - const char *smallSetElementSetName; - const char *mediumSetElementSetName; - - assert (c->tasks); - assert (c->tasks->which == ZOOM_TASK_SEARCH); - - r = c->tasks->u.search.resultset; - - elementSetName = - ZOOM_options_get (r->options, "elementSetName"); - smallSetElementSetName = - ZOOM_options_get (r->options, "smallSetElementSetName"); - mediumSetElementSetName = - ZOOM_options_get (r->options, "mediumSetElementSetName"); - - if (!smallSetElementSetName) - smallSetElementSetName = elementSetName; - - if (!mediumSetElementSetName) - mediumSetElementSetName = elementSetName; - - assert (r); - assert (r->query); - - /* prepare query for the search request */ - search_req->query = r->query->z_query; - - search_req->databaseNames = - set_DatabaseNames (c, r->options, &search_req->num_databaseNames); - - /* get syntax (no need to provide unless piggyback is in effect) */ - syntax = ZOOM_options_get (r->options, "preferredRecordSyntax"); - - lslb = ZOOM_options_get_int (r->options, "largeSetLowerBound", -1); - ssub = ZOOM_options_get_int (r->options, "smallSetUpperBound", -1); - mspn = ZOOM_options_get_int (r->options, "mediumSetPresentNumber", -1); - if (lslb != -1 && ssub != -1 && mspn != -1) - { - /* So're a Z39.50 expert? Let's hope you don't do sort */ - *search_req->largeSetLowerBound = lslb; - *search_req->smallSetUpperBound = ssub; - *search_req->mediumSetPresentNumber = mspn; - } - else if (r->start == 0 && r->count > 0 - && r->piggyback && !r->r_sort_spec && !r->schema) - { - /* Regular piggyback - do it unless we're going to do sort */ - *search_req->largeSetLowerBound = 2000000000; - *search_req->smallSetUpperBound = 1; - *search_req->mediumSetPresentNumber = r->step>0 ? r->step : r->count; - } - else - { - /* non-piggyback. Need not provide elementsets or syntaxes .. */ - smallSetElementSetName = 0; - mediumSetElementSetName = 0; - syntax = 0; - } - if (smallSetElementSetName && *smallSetElementSetName) - { - Z_ElementSetNames *esn = (Z_ElementSetNames *) - odr_malloc (c->odr_out, sizeof(*esn)); - - esn->which = Z_ElementSetNames_generic; - esn->u.generic = odr_strdup (c->odr_out, smallSetElementSetName); - search_req->smallSetElementSetNames = esn; - } - if (mediumSetElementSetName && *mediumSetElementSetName) - { - Z_ElementSetNames *esn = (Z_ElementSetNames *) - odr_malloc (c->odr_out, sizeof(*esn)); - - esn->which = Z_ElementSetNames_generic; - esn->u.generic = odr_strdup (c->odr_out, mediumSetElementSetName); - search_req->mediumSetElementSetNames = esn; - } - if (syntax) - search_req->preferredRecordSyntax = - yaz_str_to_z3950oid (c->odr_out, CLASS_RECSYN, syntax); - - if (!r->setname) - { - if (c->support_named_resultsets) - { - char setname[14]; - int ord; - /* find the lowest unused ordinal so that we re-use - result sets on the server. */ - for (ord = 1; ; ord++) - { - ZOOM_resultset rp; - sprintf (setname, "%d", ord); - for (rp = c->resultsets; rp; rp = rp->next) - if (rp->setname && !strcmp (rp->setname, setname)) - break; - if (!rp) - break; - } - r->setname = xstrdup (setname); - yaz_log (LOG_DEBUG, "allocating set %s", r->setname); - } - else - r->setname = xstrdup ("default"); - ZOOM_options_set (r->options, "setname", r->setname); - } - search_req->resultSetName = odr_strdup(c->odr_out, r->setname); - /* send search request */ - return send_APDU (c, apdu); -} - -static void response_diag (ZOOM_connection c, Z_DiagRec *p) -{ - int oclass; - Z_DefaultDiagFormat *r; - char *addinfo = 0; - - xfree (c->addinfo); - c->addinfo = 0; - if (p->which != Z_DiagRec_defaultFormat) - { - set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); - return; - } - r = p->u.defaultFormat; - switch (r->which) - { - case Z_DefaultDiagFormat_v2Addinfo: - addinfo = r->u.v2Addinfo; - break; - case Z_DefaultDiagFormat_v3Addinfo: - addinfo = r->u.v3Addinfo; - break; - } - set_dset_error(c, *r->condition, - yaz_z3950oid_to_str(r->diagnosticSetId, &oclass), - addinfo, 0); -} - -ZOOM_API(ZOOM_record) -ZOOM_record_clone (ZOOM_record srec) -{ - char *buf; - int size; - ODR odr_enc; - ZOOM_record nrec; - - odr_enc = odr_createmem(ODR_ENCODE); - if (!z_NamePlusRecord (odr_enc, &srec->npr, 0, 0)) - return 0; - buf = odr_getbuf (odr_enc, &size, 0); - - nrec = (ZOOM_record) xmalloc (sizeof(*nrec)); - nrec->odr = odr_createmem(ODR_DECODE); - nrec->wrbuf_marc = 0; - nrec->wrbuf_iconv = 0; - nrec->wrbuf_opac = 0; - odr_setbuf (nrec->odr, buf, size, 0); - z_NamePlusRecord (nrec->odr, &nrec->npr, 0, 0); - - odr_destroy (odr_enc); - return nrec; -} - -ZOOM_API(ZOOM_record) -ZOOM_resultset_record_immediate (ZOOM_resultset s,size_t pos) -{ - return record_cache_lookup (s, pos); -} - -ZOOM_API(ZOOM_record) -ZOOM_resultset_record (ZOOM_resultset r, size_t pos) -{ - ZOOM_record rec = ZOOM_resultset_record_immediate(r, pos); - - if (!rec) - { - ZOOM_resultset_retrieve (r, 1, pos, 1); - rec = ZOOM_resultset_record_immediate (r, pos); - } - return rec; -} - -ZOOM_API(void) -ZOOM_record_destroy (ZOOM_record rec) -{ - if (!rec) - return; - if (rec->wrbuf_marc) - wrbuf_free (rec->wrbuf_marc, 1); - if (rec->wrbuf_iconv) - wrbuf_free (rec->wrbuf_iconv, 1); - if (rec->wrbuf_opac) - wrbuf_free (rec->wrbuf_opac, 1); - odr_destroy (rec->odr); - xfree (rec); -} - -static const char *record_iconv_return(ZOOM_record rec, int *len, - const char *buf, int sz, - const char *record_charset) -{ - char to[40]; - char from[40]; - yaz_iconv_t cd = 0; - - *from = '\0'; - strcpy(to, "UTF-8"); - if (record_charset && *record_charset) - { - /* Use "from,to" or just "from" */ - const char *cp =strchr(record_charset, ','); - int clen = strlen(record_charset); - if (cp && cp[1]) - { - strncpy( to, cp+1, sizeof(to)-1); - to[sizeof(to)-1] = '\0'; - clen = cp - record_charset; - } - if (clen > sizeof(from)-1) - clen = sizeof(from)-1; - - if (clen) - strncpy(from, record_charset, clen); - from[clen] = '\0'; - } - - if (*from && *to && (cd = yaz_iconv_open(to, from))) - { - char outbuf[12]; - size_t inbytesleft = sz; - const char *inp = buf; - - if (!rec->wrbuf_iconv) - rec->wrbuf_iconv = wrbuf_alloc(); - - wrbuf_rewind(rec->wrbuf_iconv); - - while (inbytesleft) - { - size_t outbytesleft = sizeof(outbuf); - char *outp = outbuf; - size_t r = yaz_iconv (cd, (char**) &inp, - &inbytesleft, - &outp, &outbytesleft); - if (r == (size_t) (-1)) - { - int e = yaz_iconv_error(cd); - if (e != YAZ_ICONV_E2BIG) - break; - } - wrbuf_write(rec->wrbuf_iconv, outbuf, outp - outbuf); - } - wrbuf_puts(rec->wrbuf_iconv, ""); - buf = wrbuf_buf(rec->wrbuf_iconv); - sz = wrbuf_len(rec->wrbuf_iconv); - yaz_iconv_close(cd); - } - if (len) - *len = sz; - return buf; -} - -ZOOM_API(const char *) -ZOOM_record_get (ZOOM_record rec, const char *type_spec, int *len) -{ - char type[40]; - char charset[40]; - const char *cp; - int i; - Z_NamePlusRecord *npr; - - if (len) - *len = 0; /* default return */ - - if (!rec) - return 0; - npr = rec->npr; - if (!npr) - return 0; - - cp = type_spec; - for (i = 0; cp[i] && i < sizeof(type)-1; i++) - { - if (cp[i] == ';' || cp[i] == ' ') - break; - type[i] = cp[i]; - } - type[i] = '\0'; - charset[0] = '\0'; - if (type_spec[i] == ';') - { - i++; - while (type_spec[i] == ' ') - i++; - if (!strncmp(type_spec+i, "charset=", 8)) - { - cp = type_spec+i+8; - for (i = 0; cp[i] && i < sizeof(charset)-1; i++) - { - if (cp[i] == ';' || cp[i] == ' ') - break; - charset[i] = cp[i]; - } - charset[i] = '\0'; - } - } - - if (!strcmp (type, "database")) - { - if (len) - *len = (npr->databaseName ? strlen(npr->databaseName) : 0); - return npr->databaseName; - } - else if (!strcmp (type, "syntax")) - { - const char *desc = 0; - if (npr->which == Z_NamePlusRecord_databaseRecord) - { - Z_External *r = (Z_External *) npr->u.databaseRecord; - oident *ent = oid_getentbyoid(r->direct_reference); - if (ent) - desc = ent->desc; - } - if (!desc) - desc = "none"; - if (len) - *len = strlen(desc); - return desc; - } - else if (!strcmp (type, "render") && - npr->which == Z_NamePlusRecord_databaseRecord) - { - Z_External *r = (Z_External *) npr->u.databaseRecord; - oident *ent = oid_getentbyoid(r->direct_reference); - - /* render bibliographic record .. */ - if (r->which == Z_External_OPAC) - { - r = r->u.opac->bibliographicRecord; - if (!r) - return 0; - ent = oid_getentbyoid(r->direct_reference); - } - if (r->which == Z_External_sutrs) - return record_iconv_return(rec, len, - r->u.sutrs->buf, r->u.sutrs->len, - charset); - else if (r->which == Z_External_octet) - { - yaz_marc_t mt; - switch (ent->value) - { - case VAL_SOIF: - case VAL_HTML: - case VAL_SUTRS: - break; - case VAL_TEXT_XML: - case VAL_APPLICATION_XML: - break; - default: - if (!rec->wrbuf_marc) - rec->wrbuf_marc = wrbuf_alloc(); - - mt = yaz_marc_create(); - wrbuf_rewind (rec->wrbuf_marc); - if (yaz_marc_decode_wrbuf ( - mt, (const char *) r->u.octet_aligned->buf, - r->u.octet_aligned->len, - rec->wrbuf_marc) > 0) - { - yaz_marc_destroy(mt); - return record_iconv_return(rec, len, - wrbuf_buf(rec->wrbuf_marc), - wrbuf_len(rec->wrbuf_marc), - charset); - } - yaz_marc_destroy(mt); - } - return record_iconv_return(rec, len, - (const char *) r->u.octet_aligned->buf, - r->u.octet_aligned->len, - charset); - } - else if (r->which == Z_External_grs1) - { - if (!rec->wrbuf_marc) - rec->wrbuf_marc = wrbuf_alloc(); - wrbuf_rewind (rec->wrbuf_marc); - yaz_display_grs1(rec->wrbuf_marc, r->u.grs1, 0); - return record_iconv_return(rec, len, - wrbuf_buf(rec->wrbuf_marc), - wrbuf_len(rec->wrbuf_marc), - charset); - } - return 0; - } - else if (npr->which == Z_NamePlusRecord_databaseRecord && - (!strcmp (type, "xml") || !strcmp(type, "oai"))) - { - Z_External *r = (Z_External *) npr->u.databaseRecord; - oident *ent = oid_getentbyoid(r->direct_reference); - - /* render bibliographic record .. */ - if (r->which == Z_External_OPAC) - { - r = r->u.opac->bibliographicRecord; - if (!r) - return 0; - ent = oid_getentbyoid(r->direct_reference); - } - - if (r->which == Z_External_sutrs) - return record_iconv_return(rec, len, - (const char *) r->u.sutrs->buf, - r->u.sutrs->len, - charset); - else if (r->which == Z_External_octet) - { - yaz_marc_t mt; - int marc_decode_type = YAZ_MARC_MARCXML; - - if (!strcmp(type, "oai")) - marc_decode_type = YAZ_MARC_OAIMARC; - switch (ent->value) - { - case VAL_SOIF: - case VAL_HTML: - case VAL_SUTRS: - break; - case VAL_TEXT_XML: - case VAL_APPLICATION_XML: - break; - default: - if (!rec->wrbuf_marc) - rec->wrbuf_marc = wrbuf_alloc(); - wrbuf_rewind (rec->wrbuf_marc); - mt = yaz_marc_create(); - - yaz_marc_xml(mt, YAZ_MARC_MARCXML); - if (yaz_marc_decode_wrbuf ( - mt, (const char *) r->u.octet_aligned->buf, - r->u.octet_aligned->len, - rec->wrbuf_marc) > 0) - { - yaz_marc_destroy(mt); - return record_iconv_return(rec, len, - wrbuf_buf(rec->wrbuf_marc), - wrbuf_len(rec->wrbuf_marc), - charset); - } - yaz_marc_destroy(mt); - } - return record_iconv_return(rec, len, - (const char *) r->u.octet_aligned->buf, - r->u.octet_aligned->len, - charset); - } - else if (r->which == Z_External_grs1) - { - if (len) *len = 5; - return "GRS-1"; - } - return 0; - } - else if (!strcmp (type, "raw")) - { - if (npr->which == Z_NamePlusRecord_databaseRecord) - { - Z_External *r = (Z_External *) npr->u.databaseRecord; - - if (r->which == Z_External_sutrs) - { - if (len) *len = r->u.sutrs->len; - return (const char *) r->u.sutrs->buf; - } - else if (r->which == Z_External_octet) - { - if (len) *len = r->u.octet_aligned->len; - return (const char *) r->u.octet_aligned->buf; - } - else /* grs-1, explain, OPAC, ... */ - { - if (len) *len = -1; - return (const char *) npr->u.databaseRecord; - } - } - return 0; - } - else if (!strcmp (type, "ext")) - { - if (npr->which == Z_NamePlusRecord_databaseRecord) - return (const char *) npr->u.databaseRecord; - return 0; - } - else if (npr->which == Z_NamePlusRecord_databaseRecord && - !strcmp (type, "opac")) - - { - Z_External *r = (Z_External *) npr->u.databaseRecord; - if (r->which == Z_External_OPAC) - { - if (!rec->wrbuf_opac) - rec->wrbuf_opac = wrbuf_alloc(); - wrbuf_rewind (rec->wrbuf_opac); - yaz_display_OPAC(rec->wrbuf_opac, r->u.opac, 0); - return record_iconv_return(rec, len, - wrbuf_buf(rec->wrbuf_opac), - wrbuf_len(rec->wrbuf_opac), - charset); - } - } - return 0; -} - -static int strcmp_null(const char *v1, const char *v2) -{ - if (!v1 && !v2) - return 0; - if (!v1 || !v2) - return -1; - return strcmp(v1, v2); -} - -static void record_cache_add (ZOOM_resultset r, Z_NamePlusRecord *npr, - int pos) -{ - ZOOM_record_cache rc; - const char *elementSetName = - ZOOM_resultset_option_get (r, "elementSetName"); - const char *syntax = - ZOOM_resultset_option_get (r, "preferredRecordSyntax"); - - ZOOM_Event event = ZOOM_Event_create(ZOOM_EVENT_RECV_RECORD); - ZOOM_connection_put_event(r->connection, event); - - for (rc = r->record_cache; rc; rc = rc->next) - { - if (pos == rc->pos) - { - if (strcmp_null(r->schema, rc->schema)) - continue; - if (strcmp_null(elementSetName,rc->elementSetName)) - continue; - if (strcmp_null(syntax, rc->syntax)) - continue; - /* not destroying rc->npr (it's handled by nmem )*/ - rc->rec.npr = npr; - /* keeping wrbuf_marc too */ - return; - } - } - rc = (ZOOM_record_cache) odr_malloc (r->odr, sizeof(*rc)); - rc->rec.npr = npr; - rc->rec.odr = 0; - rc->rec.wrbuf_marc = 0; - rc->rec.wrbuf_iconv = 0; - rc->rec.wrbuf_opac = 0; - if (elementSetName) - rc->elementSetName = odr_strdup (r->odr, elementSetName); - else - rc->elementSetName = 0; - - if (syntax) - rc->syntax = odr_strdup (r->odr, syntax); - else - rc->syntax = 0; - - if (r->schema) - rc->schema = odr_strdup (r->odr, r->schema); - else - rc->schema = 0; - - rc->pos = pos; - rc->next = r->record_cache; - r->record_cache = rc; -} - -static ZOOM_record record_cache_lookup (ZOOM_resultset r, int pos) -{ - ZOOM_record_cache rc; - const char *elementSetName = - ZOOM_resultset_option_get (r, "elementSetName"); - const char *syntax = - ZOOM_resultset_option_get (r, "preferredRecordSyntax"); - - for (rc = r->record_cache; rc; rc = rc->next) - { - if (pos == rc->pos) - { - if (strcmp_null(r->schema, rc->schema)) - continue; - if (strcmp_null(elementSetName,rc->elementSetName)) - continue; - if (strcmp_null(syntax, rc->syntax)) - continue; - return &rc->rec; - } - } - return 0; -} - -static void handle_records (ZOOM_connection c, Z_Records *sr, - int present_phase) -{ - ZOOM_resultset resultset; - - if (!c->tasks) - return ; - switch (c->tasks->which) - { - case ZOOM_TASK_SEARCH: - resultset = c->tasks->u.search.resultset; - break; - case ZOOM_TASK_RETRIEVE: - resultset = c->tasks->u.retrieve.resultset; - break; - default: - return; - } - if (sr && sr->which == Z_Records_NSD) - { - Z_DiagRec dr, *dr_p = &dr; - dr.which = Z_DiagRec_defaultFormat; - dr.u.defaultFormat = sr->u.nonSurrogateDiagnostic; - - response_diag (c, dr_p); - } - else if (sr && sr->which == Z_Records_multipleNSD) - { - if (sr->u.multipleNonSurDiagnostics->num_diagRecs >= 1) - response_diag(c, sr->u.multipleNonSurDiagnostics->diagRecs[0]); - else - set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); - } - else - { - if (resultset->count + resultset->start > resultset->size) - resultset->count = resultset->size - resultset->start; - if (resultset->count < 0) - resultset->count = 0; - if (sr && sr->which == Z_Records_DBOSD) - { - int i; - NMEM nmem = odr_extract_mem (c->odr_in); - Z_NamePlusRecordList *p = - sr->u.databaseOrSurDiagnostics; - for (i = 0; inum_records; i++) - { - record_cache_add (resultset, p->records[i], - i+ resultset->start); - } - /* transfer our response to search_nmem .. we need it later */ - nmem_transfer (resultset->odr->mem, nmem); - nmem_destroy (nmem); - if (present_phase && p->num_records == 0) - { - /* present response and we didn't get any records! */ - set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); - } - } - else if (present_phase) - { - /* present response and we didn't get any records! */ - set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); - } - } -} - -static void handle_present_response (ZOOM_connection c, Z_PresentResponse *pr) -{ - handle_records (c, pr->records, 1); -} - -static void handle_search_response (ZOOM_connection c, Z_SearchResponse *sr) -{ - ZOOM_resultset resultset; - ZOOM_Event event; - - yaz_log (LOG_DEBUG, "got search response"); - - if (!c->tasks || c->tasks->which != ZOOM_TASK_SEARCH) - return ; - - event = ZOOM_Event_create(ZOOM_EVENT_RECV_SEARCH); - ZOOM_connection_put_event(c, event); - - resultset = c->tasks->u.search.resultset; - - resultset->size = *sr->resultCount; - handle_records (c, sr->records, 0); -} - -static void sort_response (ZOOM_connection c, Z_SortResponse *res) -{ - if (res->diagnostics && res->num_diagnostics > 0) - response_diag (c, res->diagnostics[0]); -} - -static int scan_response (ZOOM_connection c, Z_ScanResponse *res) -{ - NMEM nmem = odr_extract_mem (c->odr_in); - ZOOM_scanset scan; - - if (!c->tasks || c->tasks->which != ZOOM_TASK_SCAN) - return 0; - scan = c->tasks->u.scan.scan; - - if (res->entries && res->entries->nonsurrogateDiagnostics) - response_diag(c, res->entries->nonsurrogateDiagnostics[0]); - scan->scan_response = res; - nmem_transfer (scan->odr->mem, nmem); - if (res->stepSize) - ZOOM_options_set_int (scan->options, "stepSize", *res->stepSize); - if (res->positionOfTerm) - ZOOM_options_set_int (scan->options, "position", *res->positionOfTerm); - if (res->scanStatus) - ZOOM_options_set_int (scan->options, "scanStatus", *res->scanStatus); - if (res->numberOfEntriesReturned) - ZOOM_options_set_int (scan->options, "number", - *res->numberOfEntriesReturned); - nmem_destroy (nmem); - return 1; -} - -static zoom_ret send_sort (ZOOM_connection c) -{ - ZOOM_resultset resultset; - - if (!c->tasks || c->tasks->which != ZOOM_TASK_SEARCH) - return zoom_complete; - - resultset = c->tasks->u.search.resultset; - - if (c->error) - { - resultset->r_sort_spec = 0; - return zoom_complete; - } - if (resultset->r_sort_spec) - { - Z_APDU *apdu = zget_APDU(c->odr_out, Z_APDU_sortRequest); - Z_SortRequest *req = apdu->u.sortRequest; - - req->num_inputResultSetNames = 1; - req->inputResultSetNames = (Z_InternationalString **) - odr_malloc (c->odr_out, sizeof(*req->inputResultSetNames)); - req->inputResultSetNames[0] = - odr_strdup (c->odr_out, resultset->setname); - req->sortedResultSetName = odr_strdup (c->odr_out, resultset->setname); - req->sortSequence = resultset->r_sort_spec; - resultset->r_sort_spec = 0; - return send_APDU (c, apdu); - } - return zoom_complete; -} - -static zoom_ret send_present (ZOOM_connection c) -{ - Z_APDU *apdu = 0; - Z_PresentRequest *req = 0; - int i = 0; - const char *syntax = 0; - const char *elementSetName = 0; - ZOOM_resultset resultset; - - if (!c->tasks) - return zoom_complete; - - switch (c->tasks->which) - { - case ZOOM_TASK_SEARCH: - resultset = c->tasks->u.search.resultset; - break; - case ZOOM_TASK_RETRIEVE: - resultset = c->tasks->u.retrieve.resultset; - resultset->start = c->tasks->u.retrieve.start; - resultset->count = c->tasks->u.retrieve.count; - - if (resultset->start >= resultset->size) - return zoom_complete; - if (resultset->start + resultset->count > resultset->size) - resultset->count = resultset->size - resultset->start; - break; - default: - return zoom_complete; - } - - syntax = ZOOM_resultset_option_get (resultset, "preferredRecordSyntax"); - elementSetName = ZOOM_resultset_option_get (resultset, "elementSetName"); - - if (c->error) /* don't continue on error */ - return zoom_complete; - if (resultset->start < 0) - return zoom_complete; - for (i = 0; icount; i++) - { - ZOOM_record rec = - record_cache_lookup (resultset, i + resultset->start); - if (!rec) - break; - } - if (i == resultset->count) - return zoom_complete; - - apdu = zget_APDU(c->odr_out, Z_APDU_presentRequest); - req = apdu->u.presentRequest; - - resultset->start += i; - resultset->count -= i; - *req->resultSetStartPoint = resultset->start + 1; - *req->numberOfRecordsRequested = resultset->step>0 ? - resultset->step : resultset->count; - assert (*req->numberOfRecordsRequested > 0); - - if (syntax && *syntax) - req->preferredRecordSyntax = - yaz_str_to_z3950oid (c->odr_out, CLASS_RECSYN, syntax); - - if (resultset->schema && *resultset->schema) - { - Z_RecordComposition *compo = (Z_RecordComposition *) - odr_malloc (c->odr_out, sizeof(*compo)); - - req->recordComposition = compo; - compo->which = Z_RecordComp_complex; - compo->u.complex = (Z_CompSpec *) - odr_malloc(c->odr_out, sizeof(*compo->u.complex)); - compo->u.complex->selectAlternativeSyntax = (bool_t *) - odr_malloc(c->odr_out, sizeof(bool_t)); - *compo->u.complex->selectAlternativeSyntax = 0; - - compo->u.complex->generic = (Z_Specification *) - odr_malloc(c->odr_out, sizeof(*compo->u.complex->generic)); - - compo->u.complex->generic->which = Z_Schema_oid; - compo->u.complex->generic->schema.oid = (Odr_oid *) - yaz_str_to_z3950oid (c->odr_out, CLASS_SCHEMA, resultset->schema); - - if (!compo->u.complex->generic->schema.oid) - { - /* OID wasn't a schema! Try record syntax instead. */ - - compo->u.complex->generic->schema.oid = (Odr_oid *) - yaz_str_to_z3950oid (c->odr_out, CLASS_RECSYN, resultset->schema); - } - if (elementSetName && *elementSetName) - { - compo->u.complex->generic->elementSpec = (Z_ElementSpec *) - odr_malloc(c->odr_out, sizeof(Z_ElementSpec)); - compo->u.complex->generic->elementSpec->which = - Z_ElementSpec_elementSetName; - compo->u.complex->generic->elementSpec->u.elementSetName = - odr_strdup (c->odr_out, elementSetName); - } - else - compo->u.complex->generic->elementSpec = 0; - compo->u.complex->num_dbSpecific = 0; - compo->u.complex->dbSpecific = 0; - compo->u.complex->num_recordSyntax = 0; - compo->u.complex->recordSyntax = 0; - } - else if (elementSetName && *elementSetName) - { - Z_ElementSetNames *esn = (Z_ElementSetNames *) - odr_malloc (c->odr_out, sizeof(*esn)); - Z_RecordComposition *compo = (Z_RecordComposition *) - odr_malloc (c->odr_out, sizeof(*compo)); - - esn->which = Z_ElementSetNames_generic; - esn->u.generic = odr_strdup (c->odr_out, elementSetName); - compo->which = Z_RecordComp_simple; - compo->u.simple = esn; - req->recordComposition = compo; - } - req->resultSetId = odr_strdup(c->odr_out, resultset->setname); - return send_APDU (c, apdu); -} - -ZOOM_API(ZOOM_scanset) -ZOOM_connection_scan (ZOOM_connection c, const char *start) -{ - ZOOM_scanset scan = (ZOOM_scanset) xmalloc (sizeof(*scan)); - - scan->connection = c; - scan->odr = odr_createmem (ODR_DECODE); - scan->options = ZOOM_options_create_with_parent (c->options); - scan->refcount = 1; - scan->scan_response = 0; - - if ((scan->termListAndStartPoint = - p_query_scan(scan->odr, PROTO_Z3950, &scan->attributeSet, - start))) - { - ZOOM_task task = ZOOM_connection_add_task (c, ZOOM_TASK_SCAN); - task->u.scan.scan = scan; - - (scan->refcount)++; - if (!c->async) - { - while (ZOOM_event (1, &c)) - ; - } - } - return scan; -} - -ZOOM_API(void) -ZOOM_scanset_destroy (ZOOM_scanset scan) -{ - if (!scan) - return; - (scan->refcount)--; - if (scan->refcount == 0) - { - odr_destroy (scan->odr); - - ZOOM_options_destroy (scan->options); - xfree (scan); - } -} - -static zoom_ret send_package (ZOOM_connection c) -{ - ZOOM_Event event; - if (!c->tasks) - return zoom_complete; - assert (c->tasks->which == ZOOM_TASK_PACKAGE); - - event = ZOOM_Event_create (ZOOM_EVENT_SEND_APDU); - ZOOM_connection_put_event (c, event); - - return do_write_ex (c, c->tasks->u.package->buf_out, - c->tasks->u.package->len_out); -} - -static zoom_ret send_scan (ZOOM_connection c) -{ - ZOOM_scanset scan; - Z_APDU *apdu = zget_APDU(c->odr_out, Z_APDU_scanRequest); - Z_ScanRequest *req = apdu->u.scanRequest; - if (!c->tasks) - return zoom_complete; - assert (c->tasks->which == ZOOM_TASK_SCAN); - scan = c->tasks->u.scan.scan; - - req->termListAndStartPoint = scan->termListAndStartPoint; - req->attributeSet = scan->attributeSet; - - *req->numberOfTermsRequested = - ZOOM_options_get_int(scan->options, "number", 10); - - req->preferredPositionInResponse = - odr_intdup (c->odr_out, - ZOOM_options_get_int(scan->options, "position", 1)); - - req->stepSize = - odr_intdup (c->odr_out, - ZOOM_options_get_int(scan->options, "stepSize", 0)); - - req->databaseNames = set_DatabaseNames (c, scan->options, - &req->num_databaseNames); - - return send_APDU (c, apdu); -} - -ZOOM_API(size_t) -ZOOM_scanset_size (ZOOM_scanset scan) -{ - if (!scan || !scan->scan_response || !scan->scan_response->entries) - return 0; - return scan->scan_response->entries->num_entries; -} - -ZOOM_API(const char *) -ZOOM_scanset_term (ZOOM_scanset scan, size_t pos, - int *occ, int *len) -{ - const char *term = 0; - size_t noent = ZOOM_scanset_size (scan); - Z_ScanResponse *res = scan->scan_response; - - *len = 0; - *occ = 0; - if (pos >= noent) - return 0; - if (res->entries->entries[pos]->which == Z_Entry_termInfo) - { - Z_TermInfo *t = res->entries->entries[pos]->u.termInfo; - - if (t->term->which == Z_Term_general) - { - term = (const char *) t->term->u.general->buf; - *len = t->term->u.general->len; - } - *occ = t->globalOccurrences ? *t->globalOccurrences : 0; - } - return term; -} - -ZOOM_API(const char *) -ZOOM_scanset_option_get (ZOOM_scanset scan, const char *key) -{ - return ZOOM_options_get (scan->options, key); -} - -ZOOM_API(void) -ZOOM_scanset_option_set (ZOOM_scanset scan, const char *key, - const char *val) -{ - ZOOM_options_set (scan->options, key, val); -} - -static Z_APDU *create_es_package (ZOOM_package p, int type) -{ - const char *str; - Z_APDU *apdu = zget_APDU(p->odr_out, Z_APDU_extendedServicesRequest); - Z_ExtendedServicesRequest *req = apdu->u.extendedServicesRequest; - - *req->function = Z_ExtendedServicesRequest_create; - - str = ZOOM_options_get(p->options, "package-name"); - if (str && *str) - req->packageName = nmem_strdup (p->odr_out->mem, str); - - str = ZOOM_options_get(p->options, "user-id"); - if (str) - req->userId = nmem_strdup (p->odr_out->mem, str); - - req->packageType = yaz_oidval_to_z3950oid(p->odr_out, CLASS_EXTSERV, - type); - - str = ZOOM_options_get(p->options, "function"); - if (str) - { - if (!strcmp (str, "create")) - *req->function = 1; - if (!strcmp (str, "delete")) - *req->function = 2; - if (!strcmp (str, "modify")) - *req->function = 3; - } - return apdu; -} - -static const char *ill_array_lookup (void *clientData, const char *idx) -{ - ZOOM_package p = (ZOOM_package) clientData; - return ZOOM_options_get (p->options, idx+4); -} - -static Z_External *encode_ill_request (ZOOM_package p) -{ - ODR out = p->odr_out; - ILL_Request *req; - Z_External *r = 0; - struct ill_get_ctl ctl; - - ctl.odr = p->odr_out; - ctl.clientData = p; - ctl.f = ill_array_lookup; - - req = ill_get_ILLRequest(&ctl, "ill", 0); - - if (!ill_Request (out, &req, 0, 0)) - { - int ill_request_size; - char *ill_request_buf = odr_getbuf (out, &ill_request_size, 0); - if (ill_request_buf) - odr_setbuf (out, ill_request_buf, ill_request_size, 1); - return 0; - } - else - { - oident oid; - int illRequest_size = 0; - char *illRequest_buf = odr_getbuf (out, &illRequest_size, 0); - - oid.proto = PROTO_GENERAL; - oid.oclass = CLASS_GENERAL; - oid.value = VAL_ISO_ILL_1; - - r = (Z_External *) odr_malloc (out, sizeof(*r)); - r->direct_reference = odr_oiddup(out,oid_getoidbyent(&oid)); - r->indirect_reference = 0; - r->descriptor = 0; - r->which = Z_External_single; - - r->u.single_ASN1_type = (Odr_oct *) - odr_malloc (out, sizeof(*r->u.single_ASN1_type)); - r->u.single_ASN1_type->buf = (unsigned char*) - odr_malloc (out, illRequest_size); - r->u.single_ASN1_type->len = illRequest_size; - r->u.single_ASN1_type->size = illRequest_size; - memcpy (r->u.single_ASN1_type->buf, illRequest_buf, illRequest_size); - } - return r; -} - -static Z_ItemOrder *encode_item_order(ZOOM_package p) -{ - Z_ItemOrder *req = (Z_ItemOrder *) odr_malloc (p->odr_out, sizeof(*req)); - const char *str; - - req->which=Z_IOItemOrder_esRequest; - req->u.esRequest = (Z_IORequest *) - odr_malloc(p->odr_out,sizeof(Z_IORequest)); - - /* to keep part ... */ - req->u.esRequest->toKeep = (Z_IOOriginPartToKeep *) - odr_malloc(p->odr_out,sizeof(Z_IOOriginPartToKeep)); - req->u.esRequest->toKeep->supplDescription = 0; - req->u.esRequest->toKeep->contact = (Z_IOContact *) - odr_malloc (p->odr_out, sizeof(*req->u.esRequest->toKeep->contact)); - - str = ZOOM_options_get(p->options, "contact-name"); - req->u.esRequest->toKeep->contact->name = str ? - nmem_strdup (p->odr_out->mem, str) : 0; - - str = ZOOM_options_get(p->options, "contact-phone"); - req->u.esRequest->toKeep->contact->phone = str ? - nmem_strdup (p->odr_out->mem, str) : 0; - - str = ZOOM_options_get(p->options, "contact-email"); - req->u.esRequest->toKeep->contact->email = str ? - nmem_strdup (p->odr_out->mem, str) : 0; - - req->u.esRequest->toKeep->addlBilling = 0; - - /* not to keep part ... */ - req->u.esRequest->notToKeep = (Z_IOOriginPartNotToKeep *) - odr_malloc(p->odr_out,sizeof(Z_IOOriginPartNotToKeep)); - - str = ZOOM_options_get(p->options, "itemorder-setname"); - if (!str) - str = "default"; - - if (!*str) - req->u.esRequest->notToKeep->resultSetItem = 0; - else - { - req->u.esRequest->notToKeep->resultSetItem = (Z_IOResultSetItem *) - odr_malloc(p->odr_out, sizeof(Z_IOResultSetItem)); - - req->u.esRequest->notToKeep->resultSetItem->resultSetId = - nmem_strdup (p->odr_out->mem, str); - req->u.esRequest->notToKeep->resultSetItem->item = - (int *) odr_malloc(p->odr_out, sizeof(int)); - - str = ZOOM_options_get(p->options, "itemorder-item"); - *req->u.esRequest->notToKeep->resultSetItem->item = - (str ? atoi(str) : 1); - } - req->u.esRequest->notToKeep->itemRequest = encode_ill_request(p); - - return req; -} - -ZOOM_API(void) - ZOOM_package_send (ZOOM_package p, const char *type) -{ - Z_APDU *apdu = 0; - ZOOM_connection c; - if (!p) - return; - c = p->connection; - odr_reset (p->odr_out); - xfree (p->buf_out); - p->buf_out = 0; - if (!strcmp(type, "itemorder")) - { - Z_External *r; - apdu = create_es_package (p, VAL_ITEMORDER); - if (apdu) - { - r = (Z_External *) odr_malloc (p->odr_out, sizeof(*r)); - - r->direct_reference = - yaz_oidval_to_z3950oid(p->odr_out, CLASS_EXTSERV, - VAL_ITEMORDER); - r->descriptor = 0; - r->which = Z_External_itemOrder; - r->indirect_reference = 0; - r->u.itemOrder = encode_item_order (p); - - apdu->u.extendedServicesRequest->taskSpecificParameters = r; - } - } - if (apdu) - { - if (encode_APDU(p->connection, apdu, p->odr_out) == 0) - { - char *buf; - - ZOOM_task task = ZOOM_connection_add_task (c, ZOOM_TASK_PACKAGE); - task->u.package = p; - buf = odr_getbuf(p->odr_out, &p->len_out, 0); - p->buf_out = (char *) xmalloc (p->len_out); - memcpy (p->buf_out, buf, p->len_out); - - (p->refcount)++; - if (!c->async) - { - while (ZOOM_event (1, &c)) - ; - } - } - } -} - -ZOOM_API(ZOOM_package) - ZOOM_connection_package (ZOOM_connection c, ZOOM_options options) -{ - ZOOM_package p = (ZOOM_package) xmalloc (sizeof(*p)); - - p->connection = c; - p->odr_out = odr_createmem (ODR_ENCODE); - p->options = ZOOM_options_create_with_parent2 (options, c->options); - p->refcount = 1; - p->buf_out = 0; - p->len_out = 0; - return p; -} - -ZOOM_API(void) - ZOOM_package_destroy(ZOOM_package p) -{ - if (!p) - return; - (p->refcount)--; - if (p->refcount == 0) - { - odr_destroy (p->odr_out); - xfree (p->buf_out); - - ZOOM_options_destroy (p->options); - xfree (p); - } -} - -ZOOM_API(const char *) -ZOOM_package_option_get (ZOOM_package p, const char *key) -{ - return ZOOM_options_get (p->options, key); -} - - -ZOOM_API(void) -ZOOM_package_option_set (ZOOM_package p, const char *key, - const char *val) -{ - ZOOM_options_set (p->options, key, val); -} - -static int ZOOM_connection_exec_task (ZOOM_connection c) -{ - ZOOM_task task = c->tasks; - zoom_ret ret = zoom_complete; - - if (!task) - { - yaz_log (LOG_DEBUG, "ZOOM_connection_exec_task task="); - return 0; - } - yaz_log (LOG_DEBUG, "ZOOM_connection_exec_task type=%d run=%d", - task->which, task->running); - if (c->error != ZOOM_ERROR_NONE) - { - yaz_log (LOG_DEBUG, "remove tasks because of error = %d", c->error); - ZOOM_connection_remove_tasks (c); - return 0; - } - if (task->running) - { - yaz_log (LOG_DEBUG, "task already running"); - return 0; - } - task->running = 1; - ret = zoom_complete; - if (c->cs || task->which == ZOOM_TASK_CONNECT) - { - switch (task->which) - { - case ZOOM_TASK_SEARCH: - if (c->proto == PROTO_HTTP) - ret = ZOOM_connection_srw_send_search(c); - else - ret = ZOOM_connection_send_search(c); - break; - case ZOOM_TASK_RETRIEVE: - if (c->proto == PROTO_HTTP) - ret = ZOOM_connection_srw_send_search(c); - else - ret = send_present (c); - break; - case ZOOM_TASK_CONNECT: - ret = do_connect(c); - break; - case ZOOM_TASK_SCAN: - ret = send_scan(c); - break; - case ZOOM_TASK_PACKAGE: - ret = send_package(c); - break; - } - } - else - { - yaz_log (LOG_DEBUG, "remove tasks because no connection exist"); - ZOOM_connection_remove_tasks (c); - } - if (ret == zoom_complete) - { - yaz_log (LOG_DEBUG, "task removed (complete)"); - ZOOM_connection_remove_task (c); - return 0; - } - yaz_log (LOG_DEBUG, "task pending"); - return 1; -} - -static zoom_ret send_sort_present (ZOOM_connection c) -{ - zoom_ret r = send_sort (c); - if (r == zoom_complete) - r = send_present (c); - return r; -} - -static int es_response (ZOOM_connection c, - Z_ExtendedServicesResponse *res) -{ - if (!c->tasks || c->tasks->which != ZOOM_TASK_PACKAGE) - return 0; - if (res->diagnostics && res->num_diagnostics > 0) - response_diag(c, res->diagnostics[0]); - if (res->taskPackage && - res->taskPackage->which == Z_External_extendedService) - { - Z_TaskPackage *taskPackage = res->taskPackage->u.extendedService; - Odr_oct *id = taskPackage->targetReference; - - if (id) - ZOOM_options_setl (c->tasks->u.package->options, - "targetReference", (char*) id->buf, id->len); - } - return 1; -} - - -static void handle_apdu (ZOOM_connection c, Z_APDU *apdu) -{ - Z_InitResponse *initrs; - - c->mask = 0; - yaz_log (LOG_DEBUG, "recv APDU type=%d", apdu->which); - switch(apdu->which) - { - case Z_APDU_initResponse: - initrs = apdu->u.initResponse; - ZOOM_connection_option_set(c, "targetImplementationId", - initrs->implementationId ? - initrs->implementationId : ""); - ZOOM_connection_option_set(c, "targetImplementationName", - initrs->implementationName ? - initrs->implementationName : ""); - ZOOM_connection_option_set(c, "targetImplementationVersion", - initrs->implementationVersion ? - initrs->implementationVersion : ""); - if (!*initrs->result) - { - set_ZOOM_error(c, ZOOM_ERROR_INIT, 0); - } - else - { - char *cookie = - yaz_oi_get_string_oidval (&apdu->u.initResponse->otherInfo, - VAL_COOKIE, 1, 0); - xfree (c->cookie_in); - c->cookie_in = 0; - if (cookie) - c->cookie_in = xstrdup(cookie); - if (ODR_MASK_GET(initrs->options, Z_Options_namedResultSets) && - ODR_MASK_GET(initrs->protocolVersion, Z_ProtocolVersion_3)) - c->support_named_resultsets = 1; - if (c->tasks) - { - assert (c->tasks->which == ZOOM_TASK_CONNECT); - ZOOM_connection_remove_task (c); - } - ZOOM_connection_exec_task (c); - } - if (ODR_MASK_GET(initrs->options, Z_Options_negotiationModel)) - { - NMEM tmpmem = nmem_create(); - Z_CharSetandLanguageNegotiation *p = - yaz_get_charneg_record(initrs->otherInfo); - - if (p) - { - char *charset=NULL, *lang=NULL; - int sel; - - yaz_get_response_charneg(tmpmem, p, &charset, &lang, &sel); - yaz_log(LOG_DEBUG, "Target accepted: charset %s, " - "language %s, select %d", - charset ? charset : "none", lang ? lang : "none", sel); - if (charset) - ZOOM_connection_option_set (c, "negotiation-charset", - charset); - if (lang) - ZOOM_connection_option_set (c, "negotiation-lang", - lang); - nmem_destroy(tmpmem); - } - } - break; - case Z_APDU_searchResponse: - handle_search_response (c, apdu->u.searchResponse); - if (send_sort_present (c) == zoom_complete) - ZOOM_connection_remove_task (c); - break; - case Z_APDU_presentResponse: - handle_present_response (c, apdu->u.presentResponse); - if (send_present (c) == zoom_complete) - ZOOM_connection_remove_task (c); - break; - case Z_APDU_sortResponse: - sort_response (c, apdu->u.sortResponse); - if (send_present (c) == zoom_complete) - ZOOM_connection_remove_task (c); - break; - case Z_APDU_scanResponse: - scan_response (c, apdu->u.scanResponse); - ZOOM_connection_remove_task (c); - break; - case Z_APDU_extendedServicesResponse: - es_response (c, apdu->u.extendedServicesResponse); - ZOOM_connection_remove_task (c); - break; - case Z_APDU_close: - if (c->reconnect_ok) - { - do_close(c); - c->tasks->running = 0; - ZOOM_connection_insert_task (c, ZOOM_TASK_CONNECT); - } - else - { - set_ZOOM_error(c, ZOOM_ERROR_CONNECTION_LOST, 0); - do_close(c); - } - break; - default: - set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); - do_close(c); - } -} - -#if HAVE_XML2 -static void handle_srw_response(ZOOM_connection c, - Z_SRW_searchRetrieveResponse *res) -{ - ZOOM_resultset resultset = 0; - int i; - NMEM nmem; - ZOOM_Event event; - - if (!c->tasks) - return; - - if (c->tasks->which == ZOOM_TASK_SEARCH) - resultset = c->tasks->u.search.resultset; - else if (c->tasks->which == ZOOM_TASK_RETRIEVE) - resultset = c->tasks->u.retrieve.resultset; - else - return ; - - event = ZOOM_Event_create(ZOOM_EVENT_RECV_SEARCH); - ZOOM_connection_put_event(c, event); - - resultset->size = 0; - - yaz_log(LOG_DEBUG, "got SRW response OK"); - - if (res->numberOfRecords) - resultset->size = *res->numberOfRecords; - - for (i = 0; inum_records; i++) - { - int pos; - - Z_NamePlusRecord *npr = (Z_NamePlusRecord *) - odr_malloc(c->odr_in, sizeof(Z_NamePlusRecord)); - - if (res->records[i].recordPosition && - *res->records[i].recordPosition > 0) - pos = *res->records[i].recordPosition - 1; - else - pos = resultset->start + i; - - npr->databaseName = 0; - npr->which = Z_NamePlusRecord_databaseRecord; - npr->u.databaseRecord = (Z_External *) - odr_malloc(c->odr_in, sizeof(Z_External)); - npr->u.databaseRecord->descriptor = 0; - npr->u.databaseRecord->direct_reference = - yaz_oidval_to_z3950oid(c->odr_in, CLASS_RECSYN, VAL_TEXT_XML); - npr->u.databaseRecord->which = Z_External_octet; - npr->u.databaseRecord->u.octet_aligned = (Odr_oct *) - odr_malloc(c->odr_in, sizeof(Odr_oct)); - npr->u.databaseRecord->u.octet_aligned->buf = - res->records[i].recordData_buf; - npr->u.databaseRecord->u.octet_aligned->len = - npr->u.databaseRecord->u.octet_aligned->size = - res->records[i].recordData_len; - record_cache_add (resultset, npr, pos); - } - if (res->num_diagnostics > 0) - { - set_dset_error(c, *res->diagnostics[0].code, "SRW", - res->diagnostics[0].details, 0); - } - nmem = odr_extract_mem(c->odr_in); - nmem_transfer(resultset->odr->mem, nmem); - nmem_destroy(nmem); -} -#endif - -#if HAVE_XML2 -static void handle_http(ZOOM_connection c, Z_HTTP_Response *hres) -{ - int ret = -1; - const char *content_type = z_HTTP_header_lookup(hres->headers, - "Content-Type"); - const char *connection_head = z_HTTP_header_lookup(hres->headers, - "Connection"); - c->mask = 0; - yaz_log (LOG_DEBUG, "handle_http"); - - if (content_type && !yaz_strcmp_del("text/xml", content_type, "; ")) - { - Z_SOAP *soap_package = 0; - ODR o = odr_createmem(ODR_DECODE); - Z_SOAP_Handler soap_handlers[2] = { - {"http://www.loc.gov/zing/srw/v1.0/", 0, - (Z_SOAP_fun) yaz_srw_codec}, - {0, 0, 0} - }; - ret = z_soap_codec(o, &soap_package, - &hres->content_buf, &hres->content_len, - soap_handlers); - if (!ret && soap_package->which == Z_SOAP_generic && - soap_package->u.generic->no == 0) - { - Z_SRW_PDU *sr = soap_package->u.generic->p; - if (sr->which == Z_SRW_searchRetrieve_response) - handle_srw_response(c, sr->u.response); - else - ret = -1; - } - else if (!ret && (soap_package->which == Z_SOAP_fault - || soap_package->which == Z_SOAP_error)) - { - set_HTTP_error(c, hres->code, - soap_package->u.fault->fault_code, - soap_package->u.fault->fault_string); - } - else - ret = -1; - odr_destroy(o); - } - if (ret) - { - if (hres->code != 200) - set_HTTP_error(c, hres->code, 0, 0); - else - set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); - do_close (c); - } - ZOOM_connection_remove_task(c); - if (!strcmp(hres->version, "1.0")) - { - /* HTTP 1.0: only if Keep-Alive we stay alive.. */ - if (!connection_head || strcmp(connection_head, "Keep-Alive")) - do_close(c); - } - else - { - /* HTTP 1.1: only if no close we stay alive .. */ - if (connection_head && !strcmp(connection_head, "close")) - do_close(c); - } -} -#endif - -static int do_read (ZOOM_connection c) -{ - int r, more; - ZOOM_Event event; - - event = ZOOM_Event_create (ZOOM_EVENT_RECV_DATA); - ZOOM_connection_put_event (c, event); - - - r = cs_get (c->cs, &c->buf_in, &c->len_in); - more = cs_more(c->cs); - yaz_log (LOG_DEBUG, "do_read len=%d more=%d", r, more); - if (r == 1) - return 0; - if (r <= 0) - { - if (c->reconnect_ok) - { - do_close (c); - c->reconnect_ok = 0; - yaz_log (LOG_DEBUG, "reconnect read"); - c->tasks->running = 0; - ZOOM_connection_insert_task (c, ZOOM_TASK_CONNECT); - } - else - { - set_ZOOM_error(c, ZOOM_ERROR_CONNECTION_LOST, 0); - do_close (c); - } - } - else - { - Z_GDU *gdu; - ZOOM_Event event; - - odr_reset (c->odr_in); - odr_setbuf (c->odr_in, c->buf_in, r, 0); - event = ZOOM_Event_create (ZOOM_EVENT_RECV_APDU); - ZOOM_connection_put_event (c, event); - - if (!z_GDU (c->odr_in, &gdu, 0, 0)) - { - set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); - do_close (c); - } - else if (gdu->which == Z_GDU_Z3950) - handle_apdu (c, gdu->u.z3950); - else if (gdu->which == Z_GDU_HTTP_Response) - { -#if HAVE_XML2 - handle_http (c, gdu->u.HTTP_Response); -#else - set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); - do_close (c); -#endif - } - c->reconnect_ok = 0; - } - return 1; -} - -static zoom_ret do_write_ex (ZOOM_connection c, char *buf_out, int len_out) -{ - int r; - ZOOM_Event event; - - event = ZOOM_Event_create(ZOOM_EVENT_SEND_DATA); - ZOOM_connection_put_event (c, event); - - yaz_log (LOG_DEBUG, "do_write_ex len=%d", len_out); - if ((r=cs_put (c->cs, buf_out, len_out)) < 0) - { - if (c->reconnect_ok) - { - do_close (c); - c->reconnect_ok = 0; - yaz_log (LOG_DEBUG, "reconnect write"); - c->tasks->running = 0; - ZOOM_connection_insert_task (c, ZOOM_TASK_CONNECT); - return zoom_pending; - } - if (c->state == STATE_CONNECTING) - set_ZOOM_error(c, ZOOM_ERROR_CONNECT, 0); - else - set_ZOOM_error(c, ZOOM_ERROR_CONNECTION_LOST, 0); - do_close (c); - return zoom_complete; - } - else if (r == 1) - { - c->mask = ZOOM_SELECT_EXCEPT; - if (c->cs->io_pending & CS_WANT_WRITE) - c->mask += ZOOM_SELECT_WRITE; - if (c->cs->io_pending & CS_WANT_READ) - c->mask += ZOOM_SELECT_READ; - yaz_log (LOG_DEBUG, "do_write_ex 1 mask=%d", c->mask); - } - else - { - c->mask = ZOOM_SELECT_READ|ZOOM_SELECT_EXCEPT; - yaz_log (LOG_DEBUG, "do_write_ex 2 mask=%d", c->mask); - } - return zoom_pending; -} - -static zoom_ret do_write(ZOOM_connection c) -{ - return do_write_ex (c, c->buf_out, c->len_out); -} - - -ZOOM_API(const char *) -ZOOM_connection_option_get (ZOOM_connection c, const char *key) -{ - return ZOOM_options_get (c->options, key); -} - -ZOOM_API(void) -ZOOM_connection_option_set (ZOOM_connection c, const char *key, - const char *val) -{ - ZOOM_options_set (c->options, key, val); -} - -ZOOM_API(const char *) -ZOOM_resultset_option_get (ZOOM_resultset r, const char *key) -{ - return ZOOM_options_get (r->options, key); -} - -ZOOM_API(void) -ZOOM_resultset_option_set (ZOOM_resultset r, const char *key, - const char *val) -{ - ZOOM_options_set (r->options, key, val); -} - - -ZOOM_API(int) -ZOOM_connection_errcode (ZOOM_connection c) -{ - return ZOOM_connection_error (c, 0, 0); -} - -ZOOM_API(const char *) -ZOOM_connection_errmsg (ZOOM_connection c) -{ - const char *msg; - ZOOM_connection_error (c, &msg, 0); - return msg; -} - -ZOOM_API(const char *) -ZOOM_connection_addinfo (ZOOM_connection c) -{ - const char *addinfo; - ZOOM_connection_error (c, 0, &addinfo); - return addinfo; -} - -ZOOM_API(const char *) -ZOOM_diag_str (int error) -{ - switch (error) - { - case ZOOM_ERROR_NONE: - return "No error"; - case ZOOM_ERROR_CONNECT: - return "Connect failed"; - case ZOOM_ERROR_MEMORY: - return "Out of memory"; - case ZOOM_ERROR_ENCODE: - return "Encoding failed"; - case ZOOM_ERROR_DECODE: - return "Decoding failed"; - case ZOOM_ERROR_CONNECTION_LOST: - return "Connection lost"; - case ZOOM_ERROR_INIT: - return "Init rejected"; - case ZOOM_ERROR_INTERNAL: - return "Internal failure"; - case ZOOM_ERROR_TIMEOUT: - return "Timeout"; - case ZOOM_ERROR_UNSUPPORTED_PROTOCOL: - return "Unsupported protocol"; - case ZOOM_ERROR_UNSUPPORTED_QUERY: - return "Unsupported query type"; - default: - return diagbib1_str (error); - } -} - -ZOOM_API(int) -ZOOM_connection_error_x (ZOOM_connection c, const char **cp, - const char **addinfo, const char **diagset) -{ - int error = c->error; - if (cp) - { - if (!c->diagset || !strcmp(c->diagset, "ZOOM")) - *cp = ZOOM_diag_str(error); - else if (!strcmp(c->diagset, "HTTP")) - *cp = z_HTTP_errmsg(c->error); - else if (!strcmp(c->diagset, "Bib-1")) - *cp = ZOOM_diag_str(error); - else if (!strcmp(c->diagset, "SRW")) - *cp = yaz_diag_srw_str(c->error); - else - *cp = "Unknown error and diagnostic set"; - } - if (addinfo) - *addinfo = c->addinfo ? c->addinfo : ""; - if (diagset) - *diagset = c->diagset ? c->diagset : ""; - return c->error; -} - -ZOOM_API(int) -ZOOM_connection_error (ZOOM_connection c, const char **cp, - const char **addinfo) -{ - return ZOOM_connection_error_x(c, cp, addinfo, 0); -} - -static int ZOOM_connection_do_io(ZOOM_connection c, int mask) -{ - ZOOM_Event event = 0; - int r = cs_look(c->cs); - yaz_log (LOG_DEBUG, "ZOOM_connection_do_io c=%p mask=%d cs_look=%d", - c, mask, r); - - if (r == CS_NONE) - { - event = ZOOM_Event_create (ZOOM_EVENT_CONNECT); - set_ZOOM_error(c, ZOOM_ERROR_CONNECT, 0); - do_close (c); - ZOOM_connection_put_event (c, event); - } - else if (r == CS_CONNECT) - { - int ret; - event = ZOOM_Event_create (ZOOM_EVENT_CONNECT); - - ret = cs_rcvconnect (c->cs); - yaz_log (LOG_DEBUG, "cs_rcvconnect returned %d", ret); - if (ret == 1) - { - c->mask = ZOOM_SELECT_EXCEPT; - if (c->cs->io_pending & CS_WANT_WRITE) - c->mask += ZOOM_SELECT_WRITE; - if (c->cs->io_pending & CS_WANT_READ) - c->mask += ZOOM_SELECT_READ; - ZOOM_connection_put_event (c, event); - } - else if (ret == 0) - { - ZOOM_connection_put_event (c, event); - if (c->proto == PROTO_Z3950) - ZOOM_connection_send_init(c); - else - { - /* no init request for SRW .. */ - assert (c->tasks->which == ZOOM_TASK_CONNECT); - ZOOM_connection_remove_task (c); - c->mask = 0; - ZOOM_connection_exec_task (c); - } - c->state = STATE_ESTABLISHED; - } - else - { - set_ZOOM_error(c, ZOOM_ERROR_CONNECT, 0); - do_close (c); - ZOOM_connection_put_event (c, event); - } - } - else - { - if (mask & ZOOM_SELECT_READ) - do_read (c); - if (c->cs && (mask & ZOOM_SELECT_WRITE)) - do_write (c); - } - return 1; -} - -ZOOM_API(int) -ZOOM_connection_last_event(ZOOM_connection cs) -{ - if (!cs) - return ZOOM_EVENT_NONE; - return cs->last_event; -} - -ZOOM_API(int) -ZOOM_event (int no, ZOOM_connection *cs) -{ - int timeout = 5000; -#if HAVE_SYS_POLL_H - struct pollfd pollfds[1024]; - ZOOM_connection poll_cs[1024]; -#else - struct timeval tv; - fd_set input, output, except; -#endif - int i, r, nfds; - int max_fd = 0; - - for (i = 0; ioptions, "timeout", -1); - if (this_timeout != -1 && this_timeout < timeout) - timeout = this_timeout; -#if HAVE_SYS_POLL_H - if (mask) - { - short poll_events = 0; - - if (mask & ZOOM_SELECT_READ) - poll_events += POLLIN; - if (mask & ZOOM_SELECT_WRITE) - poll_events += POLLOUT; - if (mask & ZOOM_SELECT_EXCEPT) - poll_events += POLLERR; - pollfds[nfds].fd = fd; - pollfds[nfds].events = poll_events; - pollfds[nfds].revents = 0; - poll_cs[nfds] = c; - nfds++; - } -#else - if (mask & ZOOM_SELECT_READ) - { - FD_SET (fd, &input); - nfds++; - } - if (mask & ZOOM_SELECT_WRITE) - { - FD_SET (fd, &output); - nfds++; - } - if (mask & ZOOM_SELECT_EXCEPT) - { - FD_SET (fd, &except); - nfds++; - } -#endif - } - if (timeout >= 5000) - timeout = 30; - - if (!nfds) - return 0; - -#if HAVE_SYS_POLL_H - r = poll (pollfds, nfds, timeout * 1000); - for (i = 0; imask) - { - int mask = 0; - if (pollfds[i].revents & POLLIN) - mask += ZOOM_SELECT_READ; - if (pollfds[i].revents & POLLOUT) - mask += ZOOM_SELECT_WRITE; - if (pollfds[i].revents & POLLERR) - mask += ZOOM_SELECT_EXCEPT; - if (mask) - ZOOM_connection_do_io(c, mask); - } - else if (r == 0 && c->mask) - { - ZOOM_Event event = ZOOM_Event_create(ZOOM_EVENT_TIMEOUT); - /* timeout and this connection was waiting */ - set_ZOOM_error(c, ZOOM_ERROR_TIMEOUT, 0); - do_close (c); - ZOOM_connection_put_event(c, event); - } - } -#else - tv.tv_sec = timeout; - tv.tv_usec = 0; - yaz_log (LOG_DEBUG, "select start"); - r = select (max_fd+1, &input, &output, &except, &tv); - yaz_log (LOG_DEBUG, "select stop, returned r=%d", r); - for (i = 0; imask) - { - /* no timeout and real socket */ - if (FD_ISSET(fd, &input)) - mask += ZOOM_SELECT_READ; - if (FD_ISSET(fd, &output)) - mask += ZOOM_SELECT_WRITE; - if (FD_ISSET(fd, &except)) - mask += ZOOM_SELECT_EXCEPT; - if (mask) - ZOOM_connection_do_io(c, mask); - } - if (r == 0 && c->mask) - { - ZOOM_Event event = ZOOM_Event_create(ZOOM_EVENT_TIMEOUT); - /* timeout and this connection was waiting */ - set_ZOOM_error(c, ZOOM_ERROR_TIMEOUT, 0); - do_close (c); - yaz_log (LOG_DEBUG, "timeout"); - ZOOM_connection_put_event(c, event); - } - } -#endif - for (i = 0; i -#include "zoom-p.h" - -#include - -ZOOM_API(ZOOM_options) -ZOOM_options_create_with_parent (ZOOM_options parent) -{ - return ZOOM_options_create_with_parent2(parent, 0); -} - -ZOOM_API(ZOOM_options) -ZOOM_options_create (void) -{ - return ZOOM_options_create_with_parent (0); -} - - -ZOOM_API(ZOOM_options) -ZOOM_options_create_with_parent2 (ZOOM_options parent1, ZOOM_options parent2) -{ - ZOOM_options opt = (ZOOM_options) xmalloc (sizeof(*opt)); - - opt->refcount = 1; - opt->callback_func = 0; - opt->callback_handle = 0; - opt->entries = 0; - opt->parent1= parent1; - if (parent1) - (parent1->refcount)++; - opt->parent2= parent2; - if (parent2) - (parent2->refcount)++; - return opt; -} - - -void ZOOM_options_addref (ZOOM_options opt) -{ - (opt->refcount)++; -} - -ZOOM_API(ZOOM_options_callback) -ZOOM_options_set_callback ( - ZOOM_options opt, - ZOOM_options_callback callback_func, - void *callback_handle) -{ - ZOOM_options_callback callback_old; - - assert (opt); - callback_old = opt->callback_func; - opt->callback_func = callback_func; - opt->callback_handle = callback_handle; - return callback_old; -} - -ZOOM_API(void) -ZOOM_options_destroy (ZOOM_options opt) -{ - if (!opt) - return; - (opt->refcount)--; - if (opt->refcount == 0) - { - struct ZOOM_options_entry *e; - - ZOOM_options_destroy (opt->parent1); - ZOOM_options_destroy (opt->parent2); - e = opt->entries; - while (e) - { - struct ZOOM_options_entry *e0 = e; - xfree (e->name); - xfree (e->value); - e = e->next; - xfree (e0); - } - xfree (opt); - } -} - -ZOOM_API(void) -ZOOM_options_setl (ZOOM_options opt, const char *name, const char *value, - int len) -{ - struct ZOOM_options_entry **e; - - e = &opt->entries; - while (*e) - { - if (!strcmp((*e)->name, name)) - { - xfree ((*e)->value); - (*e)->value = 0; - if (value) - { - (*e)->value = (char *) xmalloc (len+1); - memcpy ((*e)->value, value, len); - (*e)->value[len] = '\0'; - } - return; - } - e = &(*e)->next; - } - *e = (struct ZOOM_options_entry *) xmalloc (sizeof(**e)); - (*e)->name = xstrdup (name); - (*e)->value = 0; - if (value) - { - (*e)->value = (char *) xmalloc (len+1); - memcpy ((*e)->value, value, len); - (*e)->value[len] = '\0'; - } - (*e)->next = 0; -} - -ZOOM_API(void) -ZOOM_options_set (ZOOM_options opt, const char *name, const char *value) -{ - ZOOM_options_setl (opt, name, value, value ? strlen(value): 0); -} - -ZOOM_API(const char *) -ZOOM_options_get (ZOOM_options opt, const char *name) -{ - const char *v = 0; - if (!opt) - return 0; - if (opt->callback_func) - v = (*opt->callback_func)(opt->callback_handle, name); - if (!v) - { - struct ZOOM_options_entry *e; - for (e = opt->entries; e; e = e->next) - if (!strcmp(e->name, name)) - { - v = e->value; - break; - } - } - if (!v) - v = ZOOM_options_get(opt->parent1, name); - if (!v) - v = ZOOM_options_get(opt->parent2, name); - return v; -} - -ZOOM_API(int) -ZOOM_options_get_bool (ZOOM_options opt, const char *name, int defa) -{ - const char *v = ZOOM_options_get (opt, name); - - if (!v) - return defa; - if (!strcmp (v, "1") || !strcmp(v, "T")) - return 1; - return 0; -} - -ZOOM_API(int) -ZOOM_options_get_int (ZOOM_options opt, const char *name, int defa) -{ - const char *v = ZOOM_options_get (opt, name); - - if (!v || !*v) - return defa; - return atoi(v); -} - -ZOOM_API(void) -ZOOM_options_set_int(ZOOM_options opt, const char *name, int value) -{ - char s[40]; - - sprintf (s, "%d", value); - ZOOM_options_set (opt, name, s); -} diff --git a/zutil/zoom-p.h b/zutil/zoom-p.h deleted file mode 100644 index 0e136ee..0000000 --- a/zutil/zoom-p.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Private C header for ZOOM C. - * $Id: zoom-p.h,v 1.10 2003-07-14 12:59:23 adam Exp $ - */ - -#if HAVE_XSLT -#include -#endif - -#include -#include -#include -#include -#include -typedef struct ZOOM_Event_p *ZOOM_Event; - -struct ZOOM_query_p { - Z_Query *z_query; - Z_SortKeySpecList *sort_spec; - int refcount; - ODR odr; - char *query_string; -}; - -#define STATE_IDLE 0 -#define STATE_CONNECTING 1 -#define STATE_ESTABLISHED 2 - -#define ZOOM_SELECT_READ 1 -#define ZOOM_SELECT_WRITE 2 -#define ZOOM_SELECT_EXCEPT 4 - -struct ZOOM_connection_p { - enum oid_proto proto; - COMSTACK cs; - char *host_port; - char *path; - int error; - char *addinfo; - const char *diagset; - int state; - int mask; - int reconnect_ok; - ODR odr_in; - ODR odr_out; - char *buf_in; - int len_in; - char *buf_out; - int len_out; - char *proxy; - char *charset; - char *lang; - char *cookie_out; - char *cookie_in; - char *client_IP; - int async; - int support_named_resultsets; - int last_event; - ZOOM_task tasks; - ZOOM_options options; - ZOOM_resultset resultsets; - ZOOM_Event m_queue_front; - ZOOM_Event m_queue_back; -}; - -struct ZOOM_options_entry { - char *name; - char *value; - struct ZOOM_options_entry *next; -}; - -struct ZOOM_options_p { - int refcount; - void *callback_handle; - ZOOM_options_callback callback_func; - struct ZOOM_options_entry *entries; - ZOOM_options parent1; - ZOOM_options parent2; -}; - -typedef struct ZOOM_record_cache_p *ZOOM_record_cache; - -struct ZOOM_resultset_p { - Z_SortKeySpecList *r_sort_spec; - ZOOM_query query; - int refcount; - int size; - int start; - int count; - int step; - int piggyback; - char *setname; - char *schema; - ODR odr; - ZOOM_record_cache record_cache; - ZOOM_options options; - ZOOM_connection connection; - ZOOM_resultset next; -}; - -struct ZOOM_record_p { - ODR odr; - WRBUF wrbuf_marc; - WRBUF wrbuf_iconv; - WRBUF wrbuf_opac; - Z_NamePlusRecord *npr; -}; - -struct ZOOM_record_cache_p { - struct ZOOM_record_p rec; - char *elementSetName; - char *syntax; - char *schema; - int pos; - ZOOM_record_cache next; -}; - -struct ZOOM_scanset_p { - int refcount; - ODR odr; - ZOOM_options options; - ZOOM_connection connection; - Z_AttributesPlusTerm *termListAndStartPoint; - Z_AttributeSetId *attributeSet; - Z_ScanResponse *scan_response; -}; - -struct ZOOM_package_p { - int refcount; - ODR odr_out; - ZOOM_options options; - ZOOM_connection connection; - char *buf_out; - int len_out; -}; - -struct ZOOM_task_p { - int running; - int which; - union { -#define ZOOM_TASK_SEARCH 1 - struct { - ZOOM_resultset resultset; - } search; -#define ZOOM_TASK_RETRIEVE 2 - struct { - int start; - ZOOM_resultset resultset; - int count; - } retrieve; -#define ZOOM_TASK_CONNECT 3 -#define ZOOM_TASK_SCAN 4 - struct { - ZOOM_scanset scan; - } scan; -#define ZOOM_TASK_PACKAGE 5 - ZOOM_package package; - } u; - ZOOM_task next; -}; - -struct ZOOM_Event_p { - int kind; - ZOOM_Event next; - ZOOM_Event prev; -}; - -void ZOOM_options_addref (ZOOM_options opt); -- 1.7.10.4