From 0cc824e02bc2c69986bec8c9dd9ff53f07a0cd3d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 29 Mar 2006 13:14:13 +0000 Subject: [PATCH] The upgrade to automake 1.8/1.9 causes the product dist to be called yaz---. So we are using p rather than +, thus getting yazpp- instead. To be consistent header files and libs have moved too. --- Makefile.am | 2 +- configure.ac | 12 ++-- debian/changelog | 38 +--------- debian/control | 10 +-- debian/libyaz++1-dev.install | 9 --- debian/libyaz++1.install | 2 - debian/libyazpp1-dev.install | 9 +++ debian/libyazpp1.install | 2 + debian/rules | 6 +- debian/yaz++1-doc.install | 1 - debian/yazpp1-doc.install | 1 + doc/Makefile.am | 16 ++--- doc/yaz++.xml.in | 73 ------------------- doc/yazpp.xml.in | 73 +++++++++++++++++++ include/Makefile.am | 2 +- include/yaz++/Makefile.am | 16 ----- include/yaz++/cql2rpn.h | 31 -------- include/yaz++/gdu.h | 40 ----------- include/yaz++/gduqueue.h | 43 ----------- include/yaz++/ir-assoc.h | 90 ----------------------- include/yaz++/pdu-assoc.h | 104 --------------------------- include/yaz++/pdu-observer.h | 75 -------------------- include/yaz++/query.h | 34 --------- include/yaz++/record-cache.h | 46 ------------ include/yaz++/socket-manager.h | 75 -------------------- include/yaz++/socket-observer.h | 81 --------------------- include/yaz++/z-assoc.h | 111 ----------------------------- include/yaz++/z-databases.h | 36 ---------- include/yaz++/z-query.h | 55 -------------- include/yaz++/z-server.h | 150 --------------------------------------- include/yazpp/Makefile.am | 16 +++++ include/yazpp/cql2rpn.h | 31 ++++++++ include/yazpp/gdu.h | 40 +++++++++++ include/yazpp/gduqueue.h | 43 +++++++++++ include/yazpp/ir-assoc.h | 90 +++++++++++++++++++++++ include/yazpp/pdu-assoc.h | 104 +++++++++++++++++++++++++++ include/yazpp/pdu-observer.h | 75 ++++++++++++++++++++ include/yazpp/query.h | 34 +++++++++ include/yazpp/record-cache.h | 46 ++++++++++++ include/yazpp/socket-manager.h | 75 ++++++++++++++++++++ include/yazpp/socket-observer.h | 81 +++++++++++++++++++++ include/yazpp/z-assoc.h | 111 +++++++++++++++++++++++++++++ include/yazpp/z-databases.h | 36 ++++++++++ include/yazpp/z-query.h | 55 ++++++++++++++ include/yazpp/z-server.h | 150 +++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 12 ++-- src/gdu.cpp | 4 +- src/gduqueue.cpp | 6 +- src/pdu-observer.cpp | 4 +- src/query.cpp | 4 +- src/socket-observer.cpp | 4 +- src/tstquery.cpp | 4 +- src/yaz-cql2rpn.cpp | 4 +- src/yaz-ir-assoc.cpp | 4 +- src/yaz-marc-sample.cpp | 4 +- src/yaz-my-client.cpp | 8 +-- src/yaz-my-server.cpp | 8 +-- src/yaz-pdu-assoc-thread.cpp | 6 +- src/yaz-pdu-assoc.cpp | 4 +- src/yaz-socket-manager.cpp | 4 +- src/yaz-z-assoc.cpp | 4 +- src/yaz-z-cache.cpp | 4 +- src/yaz-z-databases.cpp | 4 +- src/yaz-z-query.cpp | 4 +- src/yaz-z-server-ill.cpp | 4 +- src/yaz-z-server-sr.cpp | 4 +- src/yaz-z-server-update.cpp | 4 +- src/yaz-z-server.cpp | 4 +- src/z-server.cpp | 4 +- win/makefile | 4 +- yaz++-config.in | 106 --------------------------- yazpp-config.in | 106 +++++++++++++++++++++++++++ yazpp.m4 | 12 ++-- zlint/Makefile.am | 4 +- zlint/main.cpp | 4 +- zlint/zlint.h | 4 +- zoom/Makefile.am | 10 +-- 77 files changed, 1280 insertions(+), 1316 deletions(-) delete mode 100644 debian/libyaz++1-dev.install delete mode 100644 debian/libyaz++1.install create mode 100644 debian/libyazpp1-dev.install create mode 100644 debian/libyazpp1.install delete mode 100644 debian/yaz++1-doc.install create mode 100644 debian/yazpp1-doc.install delete mode 100644 doc/yaz++.xml.in create mode 100644 doc/yazpp.xml.in delete mode 100644 include/yaz++/Makefile.am delete mode 100644 include/yaz++/cql2rpn.h delete mode 100644 include/yaz++/gdu.h delete mode 100644 include/yaz++/gduqueue.h delete mode 100644 include/yaz++/ir-assoc.h delete mode 100644 include/yaz++/pdu-assoc.h delete mode 100644 include/yaz++/pdu-observer.h delete mode 100644 include/yaz++/query.h delete mode 100644 include/yaz++/record-cache.h delete mode 100644 include/yaz++/socket-manager.h delete mode 100644 include/yaz++/socket-observer.h delete mode 100644 include/yaz++/z-assoc.h delete mode 100644 include/yaz++/z-databases.h delete mode 100644 include/yaz++/z-query.h delete mode 100644 include/yaz++/z-server.h create mode 100644 include/yazpp/Makefile.am create mode 100644 include/yazpp/cql2rpn.h create mode 100644 include/yazpp/gdu.h create mode 100644 include/yazpp/gduqueue.h create mode 100644 include/yazpp/ir-assoc.h create mode 100644 include/yazpp/pdu-assoc.h create mode 100644 include/yazpp/pdu-observer.h create mode 100644 include/yazpp/query.h create mode 100644 include/yazpp/record-cache.h create mode 100644 include/yazpp/socket-manager.h create mode 100644 include/yazpp/socket-observer.h create mode 100644 include/yazpp/z-assoc.h create mode 100644 include/yazpp/z-databases.h create mode 100644 include/yazpp/z-query.h create mode 100644 include/yazpp/z-server.h delete mode 100644 yaz++-config.in create mode 100644 yazpp-config.in diff --git a/Makefile.am b/Makefile.am index 8656fb6..e61093c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ SUBDIRS = src include zlint zoom doc aclocaldir=$(datadir)/aclocal aclocal_DATA = yazpp.m4 -EXTRA_DIST= LICENSE TODO yaz++-config.in yazpp.m4 buildconf.sh +EXTRA_DIST= LICENSE TODO yazpp-config.in yazpp.m4 buildconf.sh dist-hook: mkdir $(distdir)/win diff --git a/configure.ac b/configure.ac index 92a96b5..6bd70ff 100644 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,8 @@ dnl YAZ++ Toolkit, Index Data 1994-2006 dnl See the file LICENSE for details. -dnl $Id: configure.ac,v 1.1 2006-03-28 19:56:04 adam Exp $ +dnl $Id: configure.ac,v 1.2 2006-03-29 13:14:13 adam Exp $ AC_PREREQ(2.59) -AC_INIT([yaz++],[1.0.0],[adam@indexdata.dk]) +AC_INIT([yazpp],[1.0.0],[adam@indexdata.dk]) AC_CONFIG_SRCDIR(configure.ac) AC_CONFIG_AUX_DIR([config]) AM_INIT_AUTOMAKE([1.8]) @@ -33,12 +33,12 @@ AC_OUTPUT([ Makefile src/Makefile include/Makefile - include/yaz++/Makefile + include/yazpp/Makefile zlint/Makefile - yaz++-config + yazpp-config zoom/Makefile doc/Makefile - doc/yaz++.xml + doc/yazpp.xml doc/yazprint.dsl doc/yazphp.dsl doc/yazhtml.dsl doc/tkl.xsl -],[sed s%yaz_echo_source=yes%yaz_echo_source=no%g < yaz++-config >src/yaz++-config && chmod +x yaz++-config src/yaz++-config]) +],[sed s%yaz_echo_source=yes%yaz_echo_source=no%g < yazpp-config >src/yazpp-config && chmod +x yazpp-config src/yazpp-config]) diff --git a/debian/changelog b/debian/changelog index a36a4d0..72ca269 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,42 +1,6 @@ -yaz++ (1.0.0-1) unstable; urgency=low +yazpp (1.0.0-1) unstable; urgency=low * Upstream. -- Adam Dickmeiss Mon, 27 Mar 2006 16:50:06 +0200 -yaz++ (0.9-1) unstable; urgency=low - - * Upstream. - - -- Adam Dickmeiss Mon, 7 Feb 2005 10:08:13 +0100 - -yaz++ (0.8-1) unstable; urgency=low - - * Separate YAZ proxy. - - -- Adam Dickmeiss Fri, 23 Apr 2004 21:05:04 +0200 - -yaz++ (0.7.13-1) unstable; urgency=low - - * Upstream. - - -- Adam Dickmeiss Mon, 29 Mar 2004 23:39:01 +0200 - -yaz++ (0.7.9-1) unstable; urgency=low - - * Upstream. - - -- Adam Dickmeiss Wed, 25 Feb 2004 09:19:09 +0100 - -yaz++ (0.7.8-2) unstable; urgency=low - - * Added zlint. - - -- Adam Dickmeiss Wed, 18 Feb 2004 23:13:54 +0100 - -yaz++ (0.7.8-1) unstable; urgency=low - - * Initial Release. - - -- Adam Dickmeiss Wed, 11 Feb 2004 11:33:51 +0100 - diff --git a/debian/control b/debian/control index d5fdec6..2483574 100644 --- a/debian/control +++ b/debian/control @@ -1,25 +1,25 @@ -Source: yaz++ +Source: yazpp Priority: optional Maintainer: Adam Dickmeiss Standards-Version: 3.6.0 Build-Depends: debhelper (>= 4.0.0), docbook-utils, docbook, docbook-xml, docbook-dsssl, jade, jadetex, libxml2-dev, libyaz-dev (>= 2.1.14) -Package: libyaz++1 +Package: libyazpp1 Section: libs Architecture: any Depends: ${shlibs:Depends}, libyaz (>= 2.1.14) Description: YAZ++ and ZOOM library. YAZ++ is a C++ library with an object oriented interface to YAZ and ZOOM. -Package: libyaz++1-dev +Package: libyazpp1-dev Section: devel Architecture: any -Depends: libyaz++1 (= ${Source-Version}), libyaz-dev +Depends: libyazpp (= ${Source-Version}), libyaz-dev Conflicts: libyaz++-dev Description: Development libraries for YAZ++ and ZOOM. YAZ++ is a C++ library with an object oriented interface to YAZ and ZOOM. -Package: yaz++1-doc +Package: yazpp1-doc Section: doc Architecture: all Conflicts: yaz++-doc diff --git a/debian/libyaz++1-dev.install b/debian/libyaz++1-dev.install deleted file mode 100644 index 2b94fd7..0000000 --- a/debian/libyaz++1-dev.install +++ /dev/null @@ -1,9 +0,0 @@ -debian/tmp/usr/include/yaz++/*.h -debian/tmp/usr/lib/libyazcpp*.a -debian/tmp/usr/lib/libzoomcpp*.a -debian/tmp/usr/lib/libyazcpp.so -debian/tmp/usr/lib/libzoomcpp.so -debian/tmp/usr/lib/libyazcpp.la -debian/tmp/usr/lib/libzoomcpp.la -debian/tmp/usr/bin/yaz++-config -debian/tmp/usr/share/aclocal/yazpp.m4 diff --git a/debian/libyaz++1.install b/debian/libyaz++1.install deleted file mode 100644 index d15a942..0000000 --- a/debian/libyaz++1.install +++ /dev/null @@ -1,2 +0,0 @@ -debian/tmp/usr/lib/libyazcpp*.so.* -debian/tmp/usr/lib/libzoomcpp*.so.* diff --git a/debian/libyazpp1-dev.install b/debian/libyazpp1-dev.install new file mode 100644 index 0000000..14f3be2 --- /dev/null +++ b/debian/libyazpp1-dev.install @@ -0,0 +1,9 @@ +debian/tmp/usr/include/yazpp/*.h +debian/tmp/usr/lib/libyazpp*.a +debian/tmp/usr/lib/libzoompp*.a +debian/tmp/usr/lib/libyazpp.so +debian/tmp/usr/lib/libzoompp.so +debian/tmp/usr/lib/libyazpp.la +debian/tmp/usr/lib/libzoompp.la +debian/tmp/usr/bin/yazpp-config +debian/tmp/usr/share/aclocal/yazpp.m4 diff --git a/debian/libyazpp1.install b/debian/libyazpp1.install new file mode 100644 index 0000000..0f88fb3 --- /dev/null +++ b/debian/libyazpp1.install @@ -0,0 +1,2 @@ +debian/tmp/usr/lib/libyazpp*.so.* +debian/tmp/usr/lib/libzoompp*.so.* diff --git a/debian/rules b/debian/rules index f3e4865..a33ed51 100755 --- a/debian/rules +++ b/debian/rules @@ -88,7 +88,7 @@ binary-arch: build install dh_installchangelogs NEWS dh_installdocs dh_installexamples - mv debian/tmp/usr/share/doc/yaz++ debian/tmp/usr/share/doc/yaz++1-doc + mv debian/tmp/usr/share/doc/yazpp debian/tmp/usr/share/doc/yazpp1-doc dh_install # dh_installmenu # dh_installdebconf @@ -106,9 +106,9 @@ binary-arch: build install dh_fixperms # dh_perl # dh_python - dh_makeshlibs -V 'libyaz++1 (>= 1.0.0)' + dh_makeshlibs -V 'libyazpp1 (>= 1.0.0)' dh_installdeb - dh_shlibdeps -l debian/libyaz++1/usr/lib + dh_shlibdeps -l debian/libyazpp1/usr/lib dh_gencontrol dh_md5sums dh_builddeb diff --git a/debian/yaz++1-doc.install b/debian/yaz++1-doc.install deleted file mode 100644 index b2a19e3..0000000 --- a/debian/yaz++1-doc.install +++ /dev/null @@ -1 +0,0 @@ -debian/tmp/usr/share/doc/yaz++1-doc diff --git a/debian/yazpp1-doc.install b/debian/yazpp1-doc.install new file mode 100644 index 0000000..d484b02 --- /dev/null +++ b/debian/yazpp1-doc.install @@ -0,0 +1 @@ +debian/tmp/usr/share/doc/yazpp1-doc diff --git a/doc/Makefile.am b/doc/Makefile.am index 89126d7..76a1be1 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.15 2004-04-22 18:44:33 adam Exp $ +## $Id: Makefile.am,v 1.16 2006-03-29 13:14:14 adam Exp $ docdir=$(datadir)/doc/@PACKAGE@ SUPPORTFILES = \ @@ -13,9 +13,9 @@ XMLFILES = \ zoom.xml \ api.xml \ license.xml \ - yaz++.xml.in + yazpp.xml.in -TOP=yaz++.xml +TOP=yazpp.xml MANFILES= HTMLFILES = \ api.html \ @@ -32,7 +32,7 @@ HTMLFILES = \ zoom-resultset.html \ zoom.html -doc_DATA = $(HTMLFILES) yaz++.pdf id.png yaz.css +doc_DATA = $(HTMLFILES) yazpp.pdf id.png yaz.css man_MANS = $(MANFILES) @@ -44,12 +44,12 @@ $(HTMLFILES): $(XMLFILES) yazpp.php: $(XMLFILES) jade -E14 -D $(srcdir) -d yazphp.dsl -t sgml $(srcdir)/xml.dcl $(TOP) -yaz++.pdf: $(XMLFILES) +yazpp.pdf: $(XMLFILES) if test ! -f id.png ; then ln -s $(srcdir)/id.png .; fi jade -E14 -D $(srcdir) -d yazprint.dsl -t tex $(srcdir)/xml.dcl $(TOP) - pdfjadetex yaz++.tex >pdfjadetex.log 2>&1 - pdfjadetex yaz++.tex >pdfjadetex.log 2>&1 - pdfjadetex yaz++.tex >pdfjadetex.log 2>&1 + pdfjadetex yazpp.tex >pdfjadetex.log 2>&1 + pdfjadetex yazpp.tex >pdfjadetex.log 2>&1 + pdfjadetex yazpp.tex >pdfjadetex.log 2>&1 index.tkl: $(XMLFILES) tkl.xsl xsltproc tkl.xsl $(TOP) diff --git a/doc/yaz++.xml.in b/doc/yaz++.xml.in deleted file mode 100644 index 3660c45..0000000 --- a/doc/yaz++.xml.in +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - -]> - - - - YAZ++ User's Guide and Reference - - MikeTaylor - AdamDickmeiss - - - 1999 - 2000 - 2001 - 2002 - 2003 - 2004 - Index Data Aps and Mike Taylor - - - - YAZ++ - is a set of libraries and header files that make it easier - to use the popular C-language - YAZ toolkit - from C++, together with some utilities written using these - libraries. It includes an implementation of the C++ binding for - ZOOM (ZOOM-C++). - - - This manual covers version @VERSION@. - - - CVS ID: $Id: yaz++.xml.in,v 1.14 2005-08-10 09:14:02 adam Exp $ - - - - - - - - - - - - &chap-introduction; - &chap-installation; - &chap-zoom; - &chap-api; - &app-license; - - - diff --git a/doc/yazpp.xml.in b/doc/yazpp.xml.in new file mode 100644 index 0000000..901da07 --- /dev/null +++ b/doc/yazpp.xml.in @@ -0,0 +1,73 @@ + + + + + + +]> + + + + YAZ++ User's Guide and Reference + + MikeTaylor + AdamDickmeiss + + + 1999 + 2000 + 2001 + 2002 + 2003 + 2004 + Index Data Aps and Mike Taylor + + + + YAZ++ + is a set of libraries and header files that make it easier + to use the popular C-language + YAZ toolkit + from C++, together with some utilities written using these + libraries. It includes an implementation of the C++ binding for + ZOOM (ZOOM-C++). + + + This manual covers version @VERSION@. + + + CVS ID: $Id: yazpp.xml.in,v 1.1 2006-03-29 13:14:14 adam Exp $ + + + + + + + + + + + + &chap-introduction; + &chap-installation; + &chap-zoom; + &chap-api; + &app-license; + + + diff --git a/include/Makefile.am b/include/Makefile.am index 023dc50..5c407fd 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS = yaz++ +SUBDIRS = yazpp diff --git a/include/yaz++/Makefile.am b/include/yaz++/Makefile.am deleted file mode 100644 index 97de725..0000000 --- a/include/yaz++/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ - -pkginclude_HEADERS = \ - gdu.h \ - gduqueue.h \ - ir-assoc.h \ - pdu-assoc.h \ - pdu-observer.h \ - query.h \ - socket-manager.h \ - socket-observer.h \ - z-assoc.h \ - z-query.h \ - z-server.h \ - z-databases.h \ - record-cache.h \ - cql2rpn.h diff --git a/include/yaz++/cql2rpn.h b/include/yaz++/cql2rpn.h deleted file mode 100644 index 6d0454d..0000000 --- a/include/yaz++/cql2rpn.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 1998-2004, Index Data. - * See the file LICENSE for details. - * - * $Id: cql2rpn.h,v 1.3 2005-06-25 15:53:19 adam Exp $ - */ - -#include -#include - -namespace yazpp_1 { -class YAZ_EXPORT Yaz_cql2rpn { - public: - Yaz_cql2rpn(); - ~Yaz_cql2rpn(); - void set_pqf_file(const char *fname); - int query_transform(const char *cql, Z_RPNQuery **rpnquery, ODR o, - char **addinfop); - private: - cql_transform_t m_transform; -}; -}; - -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/include/yaz++/gdu.h b/include/yaz++/gdu.h deleted file mode 100644 index 5d20b91..0000000 --- a/include/yaz++/gdu.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 1998-2005, Index Data. - * See the file LICENSE for details. - * - * $Id: gdu.h,v 1.3 2005-10-13 09:56:38 adam Exp $ - */ - -#ifndef YAZPP_GDU_INCLUDED -#define YAZPP_GDU_INCLUDED - -#include -#include - -namespace yazpp_1 { - class YAZ_EXPORT GDU { - public: - GDU(const GDU &); - GDU(Z_GDU *gdu); - GDU(Z_APDU *apdu); - GDU(); - ~GDU(); - GDU &operator=(const GDU &); - Z_GDU *get() const; - void move_away_gdu(ODR dst, Z_GDU **gdu); - private: - void base(Z_GDU *gdu, ODR o); - Z_GDU *m_gdu; - ODR m_decode; - }; -}; - -#endif -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/include/yaz++/gduqueue.h b/include/yaz++/gduqueue.h deleted file mode 100644 index e05ec45..0000000 --- a/include/yaz++/gduqueue.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 1998-2005, Index Data. - * See the file LICENSE for details. - * - * $Id: gduqueue.h,v 1.1 2005-10-13 09:56:38 adam Exp $ - */ - -#ifndef YAZPP_GDUQUEUE_INCLUDED -#define YAZPP_GDUQUEUE_INCLUDED - -#include - -namespace yazpp_1 { - class GDU; - class GDUQueue_List { - friend class GDUQueue; - private: - GDU *m_item; - GDUQueue_List *m_next; - }; - - class GDUQueue { - public: - GDUQueue(); - ~GDUQueue(); - void clear(); - void enqueue(GDU *gdu); - GDU *dequeue(); - int size(); - private: - GDUQueue_List *m_list; - }; -}; - -#endif -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/include/yaz++/ir-assoc.h b/include/yaz++/ir-assoc.h deleted file mode 100644 index 6e5e12f..0000000 --- a/include/yaz++/ir-assoc.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1998-2005, Index Data. - * See the file LICENSE for details. - * - * $Id: ir-assoc.h,v 1.6 2005-06-25 15:53:19 adam Exp $ - */ - -#include -#include - -namespace yazpp_1 { -/** Information Retrieval Assocation. - This object implements the client - and server role of a generic - Z39.50 Association. -*/ -class YAZ_EXPORT IR_Assoc: public Z_Assoc { - public: - /// Create object using the PDU Observer specified - IR_Assoc(IPDU_Observable *the_PDU_Observable); - /// Destroy assocation and close PDU Observer - virtual ~IR_Assoc(); - /// Receive Z39.50 PDU - void recv_Z_PDU(Z_APDU *apdu, int len); - void recv_GDU(Z_GDU *apdu, int len); - /// Set Database Names - void set_databaseNames (int num, const char **list); - void set_databaseNames(const char *dblist, const char *sep); - /// Get Database Names - void get_databaseNames (int *num, char ***list); - - void client(const char *addr); - - /// Set Preferred Record Syntax - void set_preferredRecordSyntax (int value); - void set_preferredRecordSyntax (const char *syntax); - /// Get Preferred Record Syntax - void get_preferredRecordSyntax (int *val); - void get_preferredRecordSyntax (const char **syntax); - - /// Set ElementSetName - void set_elementSetName (const char *elementSetName); - /// Get ElementSetName - void get_elementSetName (const char **elementSetName); - void get_elementSetName (Z_ElementSetNames **elementSetNames); - - int get_lastReceived(); - void set_lastReceived(int lastReceived); - - /// Settings - void set_proxy(const char *str); - const char *get_proxy(); - const char *get_host(); - - void set_cookie(const char *str); - const char *get_cookie(); - - /// Send Services - int send_initRequest(char* pRefId=NULL); - int send_searchRequest(Yaz_Z_Query *query, char* pResultSetId = NULL, char* pRefId = NULL); - int send_presentRequest(int start, int number, char* pResultSetId = NULL, char* pRefId = NULL); - int send_deleteResultSetRequest(char* pResultSetId = 0, char* pRefId = 0); - - /// Recv Services - virtual void recv_initRequest(Z_InitRequest *initRequest); - virtual void recv_initResponse(Z_InitResponse *initResponse); - virtual void recv_searchRequest(Z_SearchRequest *searchRequest); - virtual void recv_presentRequest(Z_PresentRequest *presentRequest); - virtual void recv_searchResponse(Z_SearchResponse *searchResponse); - virtual void recv_presentResponse(Z_PresentResponse *presentResponse); - virtual void recv_extendedServicesResponse(Z_ExtendedServicesResponse *extendedServicesResponse); - private: - char *m_proxy; - char *m_host; - char *m_cookie; - int m_num_databaseNames; - char **m_databaseNames; - int m_preferredRecordSyntax; - Z_ElementSetNames *m_elementSetNames; - int m_lastReceived; - int m_log; -}; -}; -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/include/yaz++/pdu-assoc.h b/include/yaz++/pdu-assoc.h deleted file mode 100644 index b981174..0000000 --- a/include/yaz++/pdu-assoc.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 1998-2005, Index Data. - * See the file LICENSE for details. - * - * $Id: pdu-assoc.h,v 1.9 2006-03-28 19:51:38 adam Exp $ - */ - -#ifndef YAZ_PDU_ASSOC_INCLUDED -#define YAZ_PDU_ASSOC_INCLUDED - -#include -#include -#include - -namespace yazpp_1 { -/** Simple Protocol Data Unit Assocation. - This object sends - and receives PDU's using the COMSTACK - network utility. To use the association in client role, use - the method connect. The server role is initiated by using the - listen method. - */ -class YAZ_EXPORT PDU_Assoc : public IPDU_Observable, yazpp_1::ISocketObserver { - friend class PDU_AssocThread; - private: - enum { - Connecting, - Listen, - Ready, - Closed, - Writing, - Accepting - } m_state; - class PDU_Queue { - public: - PDU_Queue(const char *buf, int len); - ~PDU_Queue(); - char *m_buf; - int m_len; - PDU_Queue *m_next; - }; - PDU_Assoc *m_parent; - PDU_Assoc *m_children; - PDU_Assoc *m_next; - COMSTACK m_cs; - yazpp_1::ISocketObservable *m_socketObservable; - IPDU_Observer *m_PDU_Observer; - char *m_input_buf; - int m_input_len; - PDU_Queue *m_queue_out; - PDU_Queue *m_queue_in; - int flush_PDU(); - int *m_destroyed; - int m_idleTime; - int m_log; - void init(yazpp_1::ISocketObservable *socketObservable); - public: - COMSTACK comstack(const char *type_and_host, void **vp); - /// Create object using specified socketObservable - PDU_Assoc(yazpp_1::ISocketObservable *socketObservable); - /// Create Object using existing comstack - PDU_Assoc(yazpp_1::ISocketObservable *socketObservable, - COMSTACK cs); - /// Close socket and destroy object. - /// virtual ~PDU_Assoc(); - /// Clone the object - IPDU_Observable *clone(); - /// Send PDU - int send_PDU(const char *buf, int len); - /// connect to server (client role) - int connect(IPDU_Observer *observer, const char *addr); - /// listen for clients (server role) - int listen(IPDU_Observer *observer, const char *addr); - /// Socket notification - void socketNotify(int event); - /// Close socket - void close(); - /// Close and destroy - void destroy(); - /// Set Idle Time - void idleTime (int timeout); - /// Child start... - virtual void childNotify(COMSTACK cs); - const char *getpeername(); -}; - -class YAZ_EXPORT PDU_AssocThread : public PDU_Assoc { - public: - PDU_AssocThread(yazpp_1::ISocketObservable *socketObservable); - private: - void childNotify(COMSTACK cs); - -}; -}; - -#endif - -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/include/yaz++/pdu-observer.h b/include/yaz++/pdu-observer.h deleted file mode 100644 index 965ffee..0000000 --- a/include/yaz++/pdu-observer.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 1998-2005, Index Data. - * See the file LICENSE for details. - * - * $Id: pdu-observer.h,v 1.9 2005-09-23 13:11:04 adam Exp $ - */ - -#ifndef YAZ_PDU_OBSERVER_H -#define YAZ_PDU_OBSERVER_H - -#include - -namespace yazpp_1 { - -class IPDU_Observer; - -/** Protocol Data Unit Observable. - This interface implements a Protocol Data Unit (PDU) network driver. - The PDU's is not encoded/decoded by this interface. They are simply - transmitted/received over the network. To use this interface the - IPDU_Observer interface must be implemented. - */ -class YAZ_EXPORT IPDU_Observable { - public: - /// Send encoded PDU buffer of specified length - virtual int send_PDU(const char *buf, int len) = 0; - /// Connect with server specified by addr. - virtual int connect(IPDU_Observer *observer, const char *addr) = 0; - /// Listen on address addr. - virtual int listen(IPDU_Observer *observer, const char *addr) = 0; - /// Close connection - virtual void close() = 0; - /// Make clone of this object using this interface - virtual IPDU_Observable *clone() = 0; - /// Destroy completely - virtual void destroy() = 0; - /// Set Idle Time - virtual void idleTime (int timeout) = 0; - /// Get peername - virtual const char *getpeername() = 0; - - virtual ~IPDU_Observable(); -}; - -/** Protocol Data Unit Observer. - This interface is used together with the IPDU_Observable interface - and acts as a callback interface for it. - */ -class YAZ_EXPORT IPDU_Observer { - public: - /// A PDU has been received - virtual void recv_PDU(const char *buf, int len) = 0; - /// Called when Iyaz_PDU_Observable::connect was successful. - virtual void connectNotify() = 0; - /// Called whenever the connection was closed - virtual void failNotify() = 0; - /// Called whenever there is a timeout - virtual void timeoutNotify() = 0; - /// Make clone of observer using IPDU_Observable interface - virtual IPDU_Observer *sessionNotify( - IPDU_Observable *the_PDU_Observable, int fd) = 0; - - virtual ~IPDU_Observer(); -}; -}; - -#endif -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/include/yaz++/query.h b/include/yaz++/query.h deleted file mode 100644 index d27a33c..0000000 --- a/include/yaz++/query.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 1998-2005, Index Data. - * See the file LICENSE for details. - * - * $Id: query.h,v 1.5 2005-09-23 13:11:04 adam Exp $ - */ - -#ifndef YAZ_PP_QUERY_H -#define YAZ_PP_QUERY_H - -#include - -namespace yazpp_1 { -/** Query - Generic Query. -*/ -class YAZ_EXPORT Yaz_Query { - public: - /// Print query in buffer described by str and len - virtual void print (char *str, int len) = 0; - virtual ~Yaz_Query(); -}; -}; - -#endif - -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/include/yaz++/record-cache.h b/include/yaz++/record-cache.h deleted file mode 100644 index 95fbba4..0000000 --- a/include/yaz++/record-cache.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2002-2004, Index Data. - * See the file LICENSE for details. - * - * $Id: record-cache.h,v 1.4 2005-06-25 15:53:19 adam Exp $ - */ - - -#include -#include - -namespace yazpp_1 { -class RecordCache_Entry; - -class YAZ_EXPORT RecordCache { - public: - RecordCache (); - ~RecordCache (); - void add (ODR o, Z_NamePlusRecordList *npr, int start, int hits); - - int lookup (ODR o, Z_NamePlusRecordList **npr, int start, int num, - Odr_oid *syntax, Z_RecordComposition *comp); - void clear(); - - void copy_searchRequest(Z_SearchRequest *sr); - void copy_presentRequest(Z_PresentRequest *pr); - void set_max_size(int sz); - private: - NMEM m_mem; - RecordCache_Entry *m_entries; - Z_SearchRequest *m_searchRequest; - Z_PresentRequest *m_presentRequest; - int match (RecordCache_Entry *entry, - Odr_oid *syntax, int offset, - Z_RecordComposition *comp); - int m_max_size; -}; -}; -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/include/yaz++/socket-manager.h b/include/yaz++/socket-manager.h deleted file mode 100644 index d239465..0000000 --- a/include/yaz++/socket-manager.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 1998-2005, Index Data. - * See the file LICENSE for details. - * - * $Id: socket-manager.h,v 1.7 2006-03-28 19:51:38 adam Exp $ - */ - -#ifndef YAZ_SOCKET_MANAGER_INCLUDED -#define YAZ_SOCKET_MANAGER_INCLUDED - -#include -#include - -namespace yazpp_1 { - -/** Simple Socket Manager. - Implements a stand-alone simple model that uses select(2) to - observe socket events. -*/ -class YAZ_EXPORT SocketManager : public ISocketObservable { - private: - struct SocketEntry { - ISocketObserver *observer; - int fd; - unsigned mask; - int timeout; - int timeout_this; - time_t last_activity; - SocketEntry *next; - }; - SocketEntry *m_observers; // all registered observers - struct SocketEvent { - ISocketObserver *observer; - int event; - SocketEvent *next; // front in queue - SocketEvent *prev; // back in queue - }; - SocketEvent *m_queue_front; - SocketEvent *m_queue_back; - - SocketEntry **lookupObserver - (ISocketObserver *observer); - SocketEvent *getEvent(); - void putEvent(SocketEvent *event); - void removeEvent(ISocketObserver *observer); - int m_log; - public: - /// Add an observer - virtual void addObserver(int fd, ISocketObserver *observer); - /// Delete an observer - virtual void deleteObserver(ISocketObserver *observer); - /// Delete all observers - virtual void deleteObservers(); - /// Set event mask for observer - virtual void maskObserver(ISocketObserver *observer, int mask); - /// Set timeout - virtual void timeoutObserver(ISocketObserver *observer, - int timeout); - /// Process one event. return > 0 if event could be processed; - int processEvent(); - SocketManager(); - virtual ~SocketManager(); -}; - -}; - -#endif -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/include/yaz++/socket-observer.h b/include/yaz++/socket-observer.h deleted file mode 100644 index fee5088..0000000 --- a/include/yaz++/socket-observer.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 1998-2005, Index Data. - * See the file LICENSE for details. - * - * $Id: socket-observer.h,v 1.8 2005-09-23 13:11:04 adam Exp $ - */ - -#ifndef YAZ_SOCKET_OBSERVER_H -#define YAZ_SOCKET_OBSERVER_H - -#include - -namespace yazpp_1 { - - enum SocketObserve { - SOCKET_OBSERVE_READ=1, - SOCKET_OBSERVE_WRITE=2, - SOCKET_OBSERVE_EXCEPT=4, - SOCKET_OBSERVE_TIMEOUT=8 - }; - -/** - Forward reference -*/ - class ISocketObserver; - -/** Socket Observable. - This interface implements notification of socket events. - The module interested in (observing) the sockets - must implement the ISocketObserver interface. The - ISocketObserver only have to implement one function, so it's - quite simple to observe sockets change state. - The socket events below specifies read, write, exception, - and timeout respectively: -
-    SOCKET_OBSERVE_READ
-    SOCKET_OBSERVE_WRITE
-    SOCKET_OBSERVE_EXCEPT
-    SOCKET_OBSERVE_TIMEOUT
-    
- The maskObserver method specifies which of these events the - observer is intertested in. -*/ - class YAZ_EXPORT ISocketObservable { - public: - /// Add an observer interested in socket fd - virtual void addObserver(int fd, ISocketObserver *observer) = 0; - /// Delete an observer - virtual void deleteObserver(ISocketObserver *observer) = 0; - /// Delete all observers - virtual void deleteObservers() = 0; - /// Specify the events that the observer is intersted in. - virtual void maskObserver(ISocketObserver *observer, int mask) = 0; - /// Specify timeout - virtual void timeoutObserver(ISocketObserver *observer, - int timeout)=0; - virtual ~ISocketObservable(); - }; - -/** Socket Observer. - The ISocketObserver interface implements a module interested - socket events. Look for objects that implements the - ISocketObservable interface! -*/ - class YAZ_EXPORT ISocketObserver { - public: - /// Notify the observer that something happened to socket - virtual void socketNotify(int event) = 0; - virtual ~ISocketObserver(); - }; - -}; -#endif -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/include/yaz++/z-assoc.h b/include/yaz++/z-assoc.h deleted file mode 100644 index 1a6e673..0000000 --- a/include/yaz++/z-assoc.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 1998-2005, Index Data. - * See the file LICENSE for details. - * - * $Id: z-assoc.h,v 1.10 2005-06-25 15:53:19 adam Exp $ - */ - -#ifndef YAZ_Z_ASSOC_INCLUDED -#define YAZ_Z_ASSOC_INCLUDED - -#include -#include -#include -#include - -namespace yazpp_1 { -/** Z39.50 Assocation. - This object implements the client - and server role of a generic - Z39.50 Association. -*/ -class YAZ_EXPORT Z_Assoc : public IPDU_Observer { - public: - /// Create object using the PDU Observer specified - Z_Assoc(IPDU_Observable *the_PDU_Observable); - /// Destroy assocation and close PDU Observer - virtual ~Z_Assoc(); - /// Receive PDU - void recv_PDU(const char *buf, int len); - /// Connect notification - virtual void connectNotify() = 0; - /// Failure notification - virtual void failNotify() = 0; - /// Timeout notification - virtual void timeoutNotify() = 0; - /// Timeout specify - void timeout(int timeout); - /// Begin Z39.50 client role - int client(const char *addr); - /// Begin Z39.50 server role - int server(const char *addr); - /// Close connection - void close(); - /// Decode Z39.50 PDU. - Z_GDU *decode_GDU(const char *buf, int len); - /// Encode Z39.50 PDU. - int encode_GDU(Z_GDU *apdu, char **buf, int *len); - /// Send Z39.50 PDU - int send_Z_PDU(Z_APDU *apdu, int *len); - int send_GDU(Z_GDU *apdu, int *len); - /// Receive Z39.50 PDU - virtual void recv_GDU(Z_GDU *apdu, int len) = 0; - /// Create Z39.50 PDU with reasonable defaults - Z_APDU *create_Z_PDU(int type); - /// Request Alloc - ODR odr_encode (); - ODR odr_decode (); - ODR odr_print (); - - void set_APDU_log(const char *fname); - const char *get_APDU_log(); - - /// OtherInformation - void get_otherInfoAPDU(Z_APDU *apdu, Z_OtherInformation ***oip); - Z_OtherInformationUnit *update_otherInformation ( - Z_OtherInformation **otherInformationP, int createFlag, - int *oid, int categoryValue, int deleteFlag); - void set_otherInformationString ( - Z_OtherInformation **otherInformationP, - int *oid, int categoryValue, - const char *str); - void set_otherInformationString ( - Z_OtherInformation **otherInformation, - int oidval, int categoryValue, - const char *str); - void set_otherInformationString ( - Z_APDU *apdu, - int oidval, int categoryValue, - const char *str); - - Z_ReferenceId *getRefID(char* str); - Z_ReferenceId **get_referenceIdP(Z_APDU *apdu); - void transfer_referenceId(Z_APDU *from, Z_APDU *to); - - const char *get_hostname(); - - int set_APDU_yazlog(int v); - - private: - static int yaz_init_flag; - static int yaz_init_func(); - IPDU_Observable *m_PDU_Observable; - ODR m_odr_in; - ODR m_odr_out; - ODR m_odr_print; - int m_log; - FILE *m_APDU_file; - char *m_APDU_fname; - char *m_hostname; - int m_APDU_yazlog; -}; -}; - -#endif -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/include/yaz++/z-databases.h b/include/yaz++/z-databases.h deleted file mode 100644 index c33179b..0000000 --- a/include/yaz++/z-databases.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2001, Index Data. - * See the file LICENSE for details. - * - * $Id: z-databases.h,v 1.3 2005-06-25 15:53:19 adam Exp $ - */ - -#include - -namespace yazpp_1 { -/** Z39.50 Databases list - */ -class YAZ_EXPORT Yaz_Z_Databases { -public: -/// Make Query from rpn string - Yaz_Z_Databases(); - ~Yaz_Z_Databases(); - void set (int num, const char **db); - void get (NMEM n, int *num, char ***db); - void get (ODR o, int *num, char ***db); - int match (Yaz_Z_Databases &db); - int match (int num, const char **db); - private: - char **m_list; - int m_num; - NMEM nmem; -}; -}; -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/include/yaz++/z-query.h b/include/yaz++/z-query.h deleted file mode 100644 index 6e762b1..0000000 --- a/include/yaz++/z-query.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 1998-2005, Index Data. - * See the file LICENSE for details. - * - * $Id: z-query.h,v 1.8 2006-03-28 19:51:38 adam Exp $ - */ - -#ifndef YAZPP_Z_QUERY_INCLUDED -#define YAZPP_Z_QUERY_INCLUDED - -#include -#include - -namespace yazpp_1 { -/** Z39.50 Query - RPN, etc. -*/ -class YAZ_EXPORT Yaz_Z_Query : public Yaz_Query { - public: - /// Make Query from rpn string - Yaz_Z_Query(); - /// Delete Query - virtual ~Yaz_Z_Query(); - /// Set RPN - int set_rpn (const char *rpn); - /// Set Z Query - void set_Z_Query (Z_Query *z_query); - /// Get Z Query - Z_Query *get_Z_Query (); - /// print query - void print(char *str, int len); - /// match query - int match(Yaz_Z_Query *other); - /// Copy - Yaz_Z_Query &operator=(const Yaz_Z_Query &); - /// Assign RPN string to it - Yaz_Z_Query& operator=(const char *rpn); - private: - char *m_buf; - int m_len; - ODR odr_decode; - ODR odr_encode; - ODR odr_print; - WRBUF zquery2pquery(Z_Query *q); -}; -}; -#endif -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/include/yaz++/z-server.h b/include/yaz++/z-server.h deleted file mode 100644 index 738701c..0000000 --- a/include/yaz++/z-server.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2000-2005, Index Data. - * See the file LICENSE for details. - * - * $Id: z-server.h,v 1.10 2006-03-28 19:51:38 adam Exp $ - */ - -#include - -namespace yazpp_1 { - -class Z_Server; - -class YAZ_EXPORT Z_ServerUtility { - public: - void create_databaseRecord (ODR odr, Z_NamePlusRecord *rec, - const char *dbname, int format, - const void *buf, int len); - void create_surrogateDiagnostics(ODR odr, Z_NamePlusRecord *rec, - const char *dbname, int error, - char *const addinfo); - - Z_Records *create_nonSurrogateDiagnostics (ODR odr, int error, - const char *addinfo); - - void create_diagnostics ( - ODR odr, int error, const char *addinfo, - Z_DiagRec ***dreca, int *num); - - virtual ~Z_ServerUtility() = 0; -}; - -class YAZ_EXPORT IServer_Facility { - public: - virtual int init(Z_Server *server, - Z_InitRequest *initRequest, - Z_InitResponse *initResponse) = 0; - virtual int recv(Z_Server *server, Z_APDU *apdu) = 0; - - virtual ~IServer_Facility() = 0; -}; - -class YAZ_EXPORT Yaz_Facility_ILL : public IServer_Facility { - public: - virtual void ill_service (Z_ExtendedServicesRequest *req, - Z_ItemOrder *io, - Z_ExtendedServicesResponse *res) = 0; - - int init(Z_Server *server, - Z_InitRequest *initRequest, - Z_InitResponse *initResponse); - int recv(Z_Server *server, Z_APDU *apdu); -}; - -class YAZ_EXPORT Yaz_Facility_Update : public IServer_Facility { - public: - virtual void update_service (Z_ExtendedServicesRequest *req, - Z_IUUpdate *io, - Z_ExtendedServicesResponse *res) = 0; - - virtual void update_service0 (Z_ExtendedServicesRequest *req, - Z_IU0Update *io, - Z_ExtendedServicesResponse *res) = 0; - - int init(Z_Server *server, - Z_InitRequest *initRequest, - Z_InitResponse *initResponse); - int recv(Z_Server *server, Z_APDU *apdu); -}; - - -class YAZ_EXPORT Yaz_Facility_Retrieval : public IServer_Facility, - public Z_ServerUtility { - public: - - virtual int sr_init (Z_InitRequest *initRequest, - Z_InitResponse *initResponse) = 0; - virtual void sr_search (Z_SearchRequest *searchRequest, - Z_SearchResponse *searchResponse) = 0; - virtual void sr_present (Z_PresentRequest *presentRequest, - Z_PresentResponse *presentResponse) = 0; - virtual void sr_record (const char *resultSetName, - int position, - int *format, - Z_RecordComposition *comp, - Z_NamePlusRecord *namePlusRecord, - Z_Records *diagnostics) = 0; - int init(Z_Server *server, - Z_InitRequest *initRequest, - Z_InitResponse *initResponse); - int recv(Z_Server *server, Z_APDU *apdu); - - ODR odr_encode(); - ODR odr_decode(); - private: - Z_Records *pack_records (Z_Server *s, - const char *resultSetName, - int start, int num, - Z_RecordComposition *comp, - int *next, int *pres, - int *oid); - - void fetch_via_piggyback (Z_Server *s, - Z_SearchRequest *searchRequest, - Z_SearchResponse *searchResponse); - void fetch_via_present (Z_Server *s, - Z_PresentRequest *req, Z_PresentResponse *res); - - int m_preferredMessageSize; - int m_maximumRecordSize; - ODR m_odr_encode; - ODR m_odr_decode; -}; - -class YAZ_EXPORT Z_Server_Facility_Info { - friend class Z_Server; - IServer_Facility *m_facility; - char *m_name; - Z_Server_Facility_Info *m_next; -}; - - - -class YAZ_EXPORT Z_Server : public Z_Assoc { -public: - Z_Server(IPDU_Observable *the_PDU_Observable); - virtual ~Z_Server(); - void recv_Z_PDU(Z_APDU *apdu, int len); - virtual void recv_GDU(Z_GDU *apdu, int len); - void facility_add(IServer_Facility *facility, const char *name); - void facility_reset (); - - - private: - Z_Server_Facility_Info *m_facilities; -}; - -class YAZ_EXPORT Yaz_USMARC { - public: - const char *get_record(size_t position); -}; -}; -/* - * Local variables: - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/include/yazpp/Makefile.am b/include/yazpp/Makefile.am new file mode 100644 index 0000000..97de725 --- /dev/null +++ b/include/yazpp/Makefile.am @@ -0,0 +1,16 @@ + +pkginclude_HEADERS = \ + gdu.h \ + gduqueue.h \ + ir-assoc.h \ + pdu-assoc.h \ + pdu-observer.h \ + query.h \ + socket-manager.h \ + socket-observer.h \ + z-assoc.h \ + z-query.h \ + z-server.h \ + z-databases.h \ + record-cache.h \ + cql2rpn.h diff --git a/include/yazpp/cql2rpn.h b/include/yazpp/cql2rpn.h new file mode 100644 index 0000000..9424643 --- /dev/null +++ b/include/yazpp/cql2rpn.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 1998-2004, Index Data. + * See the file LICENSE for details. + * + * $Id: cql2rpn.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + +#include +#include + +namespace yazpp_1 { +class YAZ_EXPORT Yaz_cql2rpn { + public: + Yaz_cql2rpn(); + ~Yaz_cql2rpn(); + void set_pqf_file(const char *fname); + int query_transform(const char *cql, Z_RPNQuery **rpnquery, ODR o, + char **addinfop); + private: + cql_transform_t m_transform; +}; +}; + +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/include/yazpp/gdu.h b/include/yazpp/gdu.h new file mode 100644 index 0000000..9e5094a --- /dev/null +++ b/include/yazpp/gdu.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1998-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: gdu.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + +#ifndef YAZPP_GDU_INCLUDED +#define YAZPP_GDU_INCLUDED + +#include +#include + +namespace yazpp_1 { + class YAZ_EXPORT GDU { + public: + GDU(const GDU &); + GDU(Z_GDU *gdu); + GDU(Z_APDU *apdu); + GDU(); + ~GDU(); + GDU &operator=(const GDU &); + Z_GDU *get() const; + void move_away_gdu(ODR dst, Z_GDU **gdu); + private: + void base(Z_GDU *gdu, ODR o); + Z_GDU *m_gdu; + ODR m_decode; + }; +}; + +#endif +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/include/yazpp/gduqueue.h b/include/yazpp/gduqueue.h new file mode 100644 index 0000000..fb32544 --- /dev/null +++ b/include/yazpp/gduqueue.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 1998-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: gduqueue.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + +#ifndef YAZPP_GDUQUEUE_INCLUDED +#define YAZPP_GDUQUEUE_INCLUDED + +#include + +namespace yazpp_1 { + class GDU; + class GDUQueue_List { + friend class GDUQueue; + private: + GDU *m_item; + GDUQueue_List *m_next; + }; + + class GDUQueue { + public: + GDUQueue(); + ~GDUQueue(); + void clear(); + void enqueue(GDU *gdu); + GDU *dequeue(); + int size(); + private: + GDUQueue_List *m_list; + }; +}; + +#endif +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/include/yazpp/ir-assoc.h b/include/yazpp/ir-assoc.h new file mode 100644 index 0000000..eb3d110 --- /dev/null +++ b/include/yazpp/ir-assoc.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 1998-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: ir-assoc.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + +#include +#include + +namespace yazpp_1 { +/** Information Retrieval Assocation. + This object implements the client - and server role of a generic + Z39.50 Association. +*/ +class YAZ_EXPORT IR_Assoc: public Z_Assoc { + public: + /// Create object using the PDU Observer specified + IR_Assoc(IPDU_Observable *the_PDU_Observable); + /// Destroy assocation and close PDU Observer + virtual ~IR_Assoc(); + /// Receive Z39.50 PDU + void recv_Z_PDU(Z_APDU *apdu, int len); + void recv_GDU(Z_GDU *apdu, int len); + /// Set Database Names + void set_databaseNames (int num, const char **list); + void set_databaseNames(const char *dblist, const char *sep); + /// Get Database Names + void get_databaseNames (int *num, char ***list); + + void client(const char *addr); + + /// Set Preferred Record Syntax + void set_preferredRecordSyntax (int value); + void set_preferredRecordSyntax (const char *syntax); + /// Get Preferred Record Syntax + void get_preferredRecordSyntax (int *val); + void get_preferredRecordSyntax (const char **syntax); + + /// Set ElementSetName + void set_elementSetName (const char *elementSetName); + /// Get ElementSetName + void get_elementSetName (const char **elementSetName); + void get_elementSetName (Z_ElementSetNames **elementSetNames); + + int get_lastReceived(); + void set_lastReceived(int lastReceived); + + /// Settings + void set_proxy(const char *str); + const char *get_proxy(); + const char *get_host(); + + void set_cookie(const char *str); + const char *get_cookie(); + + /// Send Services + int send_initRequest(char* pRefId=NULL); + int send_searchRequest(Yaz_Z_Query *query, char* pResultSetId = NULL, char* pRefId = NULL); + int send_presentRequest(int start, int number, char* pResultSetId = NULL, char* pRefId = NULL); + int send_deleteResultSetRequest(char* pResultSetId = 0, char* pRefId = 0); + + /// Recv Services + virtual void recv_initRequest(Z_InitRequest *initRequest); + virtual void recv_initResponse(Z_InitResponse *initResponse); + virtual void recv_searchRequest(Z_SearchRequest *searchRequest); + virtual void recv_presentRequest(Z_PresentRequest *presentRequest); + virtual void recv_searchResponse(Z_SearchResponse *searchResponse); + virtual void recv_presentResponse(Z_PresentResponse *presentResponse); + virtual void recv_extendedServicesResponse(Z_ExtendedServicesResponse *extendedServicesResponse); + private: + char *m_proxy; + char *m_host; + char *m_cookie; + int m_num_databaseNames; + char **m_databaseNames; + int m_preferredRecordSyntax; + Z_ElementSetNames *m_elementSetNames; + int m_lastReceived; + int m_log; +}; +}; +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/include/yazpp/pdu-assoc.h b/include/yazpp/pdu-assoc.h new file mode 100644 index 0000000..d0fdeb7 --- /dev/null +++ b/include/yazpp/pdu-assoc.h @@ -0,0 +1,104 @@ +/* + * Copyright (c) 1998-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: pdu-assoc.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + +#ifndef YAZ_PDU_ASSOC_INCLUDED +#define YAZ_PDU_ASSOC_INCLUDED + +#include +#include +#include + +namespace yazpp_1 { +/** Simple Protocol Data Unit Assocation. + This object sends - and receives PDU's using the COMSTACK + network utility. To use the association in client role, use + the method connect. The server role is initiated by using the + listen method. + */ +class YAZ_EXPORT PDU_Assoc : public IPDU_Observable, yazpp_1::ISocketObserver { + friend class PDU_AssocThread; + private: + enum { + Connecting, + Listen, + Ready, + Closed, + Writing, + Accepting + } m_state; + class PDU_Queue { + public: + PDU_Queue(const char *buf, int len); + ~PDU_Queue(); + char *m_buf; + int m_len; + PDU_Queue *m_next; + }; + PDU_Assoc *m_parent; + PDU_Assoc *m_children; + PDU_Assoc *m_next; + COMSTACK m_cs; + yazpp_1::ISocketObservable *m_socketObservable; + IPDU_Observer *m_PDU_Observer; + char *m_input_buf; + int m_input_len; + PDU_Queue *m_queue_out; + PDU_Queue *m_queue_in; + int flush_PDU(); + int *m_destroyed; + int m_idleTime; + int m_log; + void init(yazpp_1::ISocketObservable *socketObservable); + public: + COMSTACK comstack(const char *type_and_host, void **vp); + /// Create object using specified socketObservable + PDU_Assoc(yazpp_1::ISocketObservable *socketObservable); + /// Create Object using existing comstack + PDU_Assoc(yazpp_1::ISocketObservable *socketObservable, + COMSTACK cs); + /// Close socket and destroy object. + /// virtual ~PDU_Assoc(); + /// Clone the object + IPDU_Observable *clone(); + /// Send PDU + int send_PDU(const char *buf, int len); + /// connect to server (client role) + int connect(IPDU_Observer *observer, const char *addr); + /// listen for clients (server role) + int listen(IPDU_Observer *observer, const char *addr); + /// Socket notification + void socketNotify(int event); + /// Close socket + void close(); + /// Close and destroy + void destroy(); + /// Set Idle Time + void idleTime (int timeout); + /// Child start... + virtual void childNotify(COMSTACK cs); + const char *getpeername(); +}; + +class YAZ_EXPORT PDU_AssocThread : public PDU_Assoc { + public: + PDU_AssocThread(yazpp_1::ISocketObservable *socketObservable); + private: + void childNotify(COMSTACK cs); + +}; +}; + +#endif + +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/include/yazpp/pdu-observer.h b/include/yazpp/pdu-observer.h new file mode 100644 index 0000000..3af0bd9 --- /dev/null +++ b/include/yazpp/pdu-observer.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1998-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: pdu-observer.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + +#ifndef YAZ_PDU_OBSERVER_H +#define YAZ_PDU_OBSERVER_H + +#include + +namespace yazpp_1 { + +class IPDU_Observer; + +/** Protocol Data Unit Observable. + This interface implements a Protocol Data Unit (PDU) network driver. + The PDU's is not encoded/decoded by this interface. They are simply + transmitted/received over the network. To use this interface the + IPDU_Observer interface must be implemented. + */ +class YAZ_EXPORT IPDU_Observable { + public: + /// Send encoded PDU buffer of specified length + virtual int send_PDU(const char *buf, int len) = 0; + /// Connect with server specified by addr. + virtual int connect(IPDU_Observer *observer, const char *addr) = 0; + /// Listen on address addr. + virtual int listen(IPDU_Observer *observer, const char *addr) = 0; + /// Close connection + virtual void close() = 0; + /// Make clone of this object using this interface + virtual IPDU_Observable *clone() = 0; + /// Destroy completely + virtual void destroy() = 0; + /// Set Idle Time + virtual void idleTime (int timeout) = 0; + /// Get peername + virtual const char *getpeername() = 0; + + virtual ~IPDU_Observable(); +}; + +/** Protocol Data Unit Observer. + This interface is used together with the IPDU_Observable interface + and acts as a callback interface for it. + */ +class YAZ_EXPORT IPDU_Observer { + public: + /// A PDU has been received + virtual void recv_PDU(const char *buf, int len) = 0; + /// Called when Iyaz_PDU_Observable::connect was successful. + virtual void connectNotify() = 0; + /// Called whenever the connection was closed + virtual void failNotify() = 0; + /// Called whenever there is a timeout + virtual void timeoutNotify() = 0; + /// Make clone of observer using IPDU_Observable interface + virtual IPDU_Observer *sessionNotify( + IPDU_Observable *the_PDU_Observable, int fd) = 0; + + virtual ~IPDU_Observer(); +}; +}; + +#endif +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/include/yazpp/query.h b/include/yazpp/query.h new file mode 100644 index 0000000..695d007 --- /dev/null +++ b/include/yazpp/query.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 1998-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: query.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + +#ifndef YAZ_PP_QUERY_H +#define YAZ_PP_QUERY_H + +#include + +namespace yazpp_1 { +/** Query + Generic Query. +*/ +class YAZ_EXPORT Yaz_Query { + public: + /// Print query in buffer described by str and len + virtual void print (char *str, int len) = 0; + virtual ~Yaz_Query(); +}; +}; + +#endif + +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/include/yazpp/record-cache.h b/include/yazpp/record-cache.h new file mode 100644 index 0000000..d53533f --- /dev/null +++ b/include/yazpp/record-cache.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002-2004, Index Data. + * See the file LICENSE for details. + * + * $Id: record-cache.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + + +#include +#include + +namespace yazpp_1 { +class RecordCache_Entry; + +class YAZ_EXPORT RecordCache { + public: + RecordCache (); + ~RecordCache (); + void add (ODR o, Z_NamePlusRecordList *npr, int start, int hits); + + int lookup (ODR o, Z_NamePlusRecordList **npr, int start, int num, + Odr_oid *syntax, Z_RecordComposition *comp); + void clear(); + + void copy_searchRequest(Z_SearchRequest *sr); + void copy_presentRequest(Z_PresentRequest *pr); + void set_max_size(int sz); + private: + NMEM m_mem; + RecordCache_Entry *m_entries; + Z_SearchRequest *m_searchRequest; + Z_PresentRequest *m_presentRequest; + int match (RecordCache_Entry *entry, + Odr_oid *syntax, int offset, + Z_RecordComposition *comp); + int m_max_size; +}; +}; +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/include/yazpp/socket-manager.h b/include/yazpp/socket-manager.h new file mode 100644 index 0000000..f7be9e6 --- /dev/null +++ b/include/yazpp/socket-manager.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1998-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: socket-manager.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + +#ifndef YAZ_SOCKET_MANAGER_INCLUDED +#define YAZ_SOCKET_MANAGER_INCLUDED + +#include +#include + +namespace yazpp_1 { + +/** Simple Socket Manager. + Implements a stand-alone simple model that uses select(2) to + observe socket events. +*/ +class YAZ_EXPORT SocketManager : public ISocketObservable { + private: + struct SocketEntry { + ISocketObserver *observer; + int fd; + unsigned mask; + int timeout; + int timeout_this; + time_t last_activity; + SocketEntry *next; + }; + SocketEntry *m_observers; // all registered observers + struct SocketEvent { + ISocketObserver *observer; + int event; + SocketEvent *next; // front in queue + SocketEvent *prev; // back in queue + }; + SocketEvent *m_queue_front; + SocketEvent *m_queue_back; + + SocketEntry **lookupObserver + (ISocketObserver *observer); + SocketEvent *getEvent(); + void putEvent(SocketEvent *event); + void removeEvent(ISocketObserver *observer); + int m_log; + public: + /// Add an observer + virtual void addObserver(int fd, ISocketObserver *observer); + /// Delete an observer + virtual void deleteObserver(ISocketObserver *observer); + /// Delete all observers + virtual void deleteObservers(); + /// Set event mask for observer + virtual void maskObserver(ISocketObserver *observer, int mask); + /// Set timeout + virtual void timeoutObserver(ISocketObserver *observer, + int timeout); + /// Process one event. return > 0 if event could be processed; + int processEvent(); + SocketManager(); + virtual ~SocketManager(); +}; + +}; + +#endif +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/include/yazpp/socket-observer.h b/include/yazpp/socket-observer.h new file mode 100644 index 0000000..d2541da --- /dev/null +++ b/include/yazpp/socket-observer.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 1998-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: socket-observer.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + +#ifndef YAZ_SOCKET_OBSERVER_H +#define YAZ_SOCKET_OBSERVER_H + +#include + +namespace yazpp_1 { + + enum SocketObserve { + SOCKET_OBSERVE_READ=1, + SOCKET_OBSERVE_WRITE=2, + SOCKET_OBSERVE_EXCEPT=4, + SOCKET_OBSERVE_TIMEOUT=8 + }; + +/** + Forward reference +*/ + class ISocketObserver; + +/** Socket Observable. + This interface implements notification of socket events. + The module interested in (observing) the sockets + must implement the ISocketObserver interface. The + ISocketObserver only have to implement one function, so it's + quite simple to observe sockets change state. + The socket events below specifies read, write, exception, + and timeout respectively: +
+    SOCKET_OBSERVE_READ
+    SOCKET_OBSERVE_WRITE
+    SOCKET_OBSERVE_EXCEPT
+    SOCKET_OBSERVE_TIMEOUT
+    
+ The maskObserver method specifies which of these events the + observer is intertested in. +*/ + class YAZ_EXPORT ISocketObservable { + public: + /// Add an observer interested in socket fd + virtual void addObserver(int fd, ISocketObserver *observer) = 0; + /// Delete an observer + virtual void deleteObserver(ISocketObserver *observer) = 0; + /// Delete all observers + virtual void deleteObservers() = 0; + /// Specify the events that the observer is intersted in. + virtual void maskObserver(ISocketObserver *observer, int mask) = 0; + /// Specify timeout + virtual void timeoutObserver(ISocketObserver *observer, + int timeout)=0; + virtual ~ISocketObservable(); + }; + +/** Socket Observer. + The ISocketObserver interface implements a module interested + socket events. Look for objects that implements the + ISocketObservable interface! +*/ + class YAZ_EXPORT ISocketObserver { + public: + /// Notify the observer that something happened to socket + virtual void socketNotify(int event) = 0; + virtual ~ISocketObserver(); + }; + +}; +#endif +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/include/yazpp/z-assoc.h b/include/yazpp/z-assoc.h new file mode 100644 index 0000000..0796491 --- /dev/null +++ b/include/yazpp/z-assoc.h @@ -0,0 +1,111 @@ +/* + * Copyright (c) 1998-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: z-assoc.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + +#ifndef YAZ_Z_ASSOC_INCLUDED +#define YAZ_Z_ASSOC_INCLUDED + +#include +#include +#include +#include + +namespace yazpp_1 { +/** Z39.50 Assocation. + This object implements the client - and server role of a generic + Z39.50 Association. +*/ +class YAZ_EXPORT Z_Assoc : public IPDU_Observer { + public: + /// Create object using the PDU Observer specified + Z_Assoc(IPDU_Observable *the_PDU_Observable); + /// Destroy assocation and close PDU Observer + virtual ~Z_Assoc(); + /// Receive PDU + void recv_PDU(const char *buf, int len); + /// Connect notification + virtual void connectNotify() = 0; + /// Failure notification + virtual void failNotify() = 0; + /// Timeout notification + virtual void timeoutNotify() = 0; + /// Timeout specify + void timeout(int timeout); + /// Begin Z39.50 client role + int client(const char *addr); + /// Begin Z39.50 server role + int server(const char *addr); + /// Close connection + void close(); + /// Decode Z39.50 PDU. + Z_GDU *decode_GDU(const char *buf, int len); + /// Encode Z39.50 PDU. + int encode_GDU(Z_GDU *apdu, char **buf, int *len); + /// Send Z39.50 PDU + int send_Z_PDU(Z_APDU *apdu, int *len); + int send_GDU(Z_GDU *apdu, int *len); + /// Receive Z39.50 PDU + virtual void recv_GDU(Z_GDU *apdu, int len) = 0; + /// Create Z39.50 PDU with reasonable defaults + Z_APDU *create_Z_PDU(int type); + /// Request Alloc + ODR odr_encode (); + ODR odr_decode (); + ODR odr_print (); + + void set_APDU_log(const char *fname); + const char *get_APDU_log(); + + /// OtherInformation + void get_otherInfoAPDU(Z_APDU *apdu, Z_OtherInformation ***oip); + Z_OtherInformationUnit *update_otherInformation ( + Z_OtherInformation **otherInformationP, int createFlag, + int *oid, int categoryValue, int deleteFlag); + void set_otherInformationString ( + Z_OtherInformation **otherInformationP, + int *oid, int categoryValue, + const char *str); + void set_otherInformationString ( + Z_OtherInformation **otherInformation, + int oidval, int categoryValue, + const char *str); + void set_otherInformationString ( + Z_APDU *apdu, + int oidval, int categoryValue, + const char *str); + + Z_ReferenceId *getRefID(char* str); + Z_ReferenceId **get_referenceIdP(Z_APDU *apdu); + void transfer_referenceId(Z_APDU *from, Z_APDU *to); + + const char *get_hostname(); + + int set_APDU_yazlog(int v); + + private: + static int yaz_init_flag; + static int yaz_init_func(); + IPDU_Observable *m_PDU_Observable; + ODR m_odr_in; + ODR m_odr_out; + ODR m_odr_print; + int m_log; + FILE *m_APDU_file; + char *m_APDU_fname; + char *m_hostname; + int m_APDU_yazlog; +}; +}; + +#endif +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/include/yazpp/z-databases.h b/include/yazpp/z-databases.h new file mode 100644 index 0000000..26e4c14 --- /dev/null +++ b/include/yazpp/z-databases.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2001, Index Data. + * See the file LICENSE for details. + * + * $Id: z-databases.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + +#include + +namespace yazpp_1 { +/** Z39.50 Databases list + */ +class YAZ_EXPORT Yaz_Z_Databases { +public: +/// Make Query from rpn string + Yaz_Z_Databases(); + ~Yaz_Z_Databases(); + void set (int num, const char **db); + void get (NMEM n, int *num, char ***db); + void get (ODR o, int *num, char ***db); + int match (Yaz_Z_Databases &db); + int match (int num, const char **db); + private: + char **m_list; + int m_num; + NMEM nmem; +}; +}; +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/include/yazpp/z-query.h b/include/yazpp/z-query.h new file mode 100644 index 0000000..7f1965e --- /dev/null +++ b/include/yazpp/z-query.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 1998-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: z-query.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + +#ifndef YAZPP_Z_QUERY_INCLUDED +#define YAZPP_Z_QUERY_INCLUDED + +#include +#include + +namespace yazpp_1 { +/** Z39.50 Query + RPN, etc. +*/ +class YAZ_EXPORT Yaz_Z_Query : public Yaz_Query { + public: + /// Make Query from rpn string + Yaz_Z_Query(); + /// Delete Query + virtual ~Yaz_Z_Query(); + /// Set RPN + int set_rpn (const char *rpn); + /// Set Z Query + void set_Z_Query (Z_Query *z_query); + /// Get Z Query + Z_Query *get_Z_Query (); + /// print query + void print(char *str, int len); + /// match query + int match(Yaz_Z_Query *other); + /// Copy + Yaz_Z_Query &operator=(const Yaz_Z_Query &); + /// Assign RPN string to it + Yaz_Z_Query& operator=(const char *rpn); + private: + char *m_buf; + int m_len; + ODR odr_decode; + ODR odr_encode; + ODR odr_print; + WRBUF zquery2pquery(Z_Query *q); +}; +}; +#endif +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/include/yazpp/z-server.h b/include/yazpp/z-server.h new file mode 100644 index 0000000..c8085c7 --- /dev/null +++ b/include/yazpp/z-server.h @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2000-2005, Index Data. + * See the file LICENSE for details. + * + * $Id: z-server.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + +#include + +namespace yazpp_1 { + +class Z_Server; + +class YAZ_EXPORT Z_ServerUtility { + public: + void create_databaseRecord (ODR odr, Z_NamePlusRecord *rec, + const char *dbname, int format, + const void *buf, int len); + void create_surrogateDiagnostics(ODR odr, Z_NamePlusRecord *rec, + const char *dbname, int error, + char *const addinfo); + + Z_Records *create_nonSurrogateDiagnostics (ODR odr, int error, + const char *addinfo); + + void create_diagnostics ( + ODR odr, int error, const char *addinfo, + Z_DiagRec ***dreca, int *num); + + virtual ~Z_ServerUtility() = 0; +}; + +class YAZ_EXPORT IServer_Facility { + public: + virtual int init(Z_Server *server, + Z_InitRequest *initRequest, + Z_InitResponse *initResponse) = 0; + virtual int recv(Z_Server *server, Z_APDU *apdu) = 0; + + virtual ~IServer_Facility() = 0; +}; + +class YAZ_EXPORT Yaz_Facility_ILL : public IServer_Facility { + public: + virtual void ill_service (Z_ExtendedServicesRequest *req, + Z_ItemOrder *io, + Z_ExtendedServicesResponse *res) = 0; + + int init(Z_Server *server, + Z_InitRequest *initRequest, + Z_InitResponse *initResponse); + int recv(Z_Server *server, Z_APDU *apdu); +}; + +class YAZ_EXPORT Yaz_Facility_Update : public IServer_Facility { + public: + virtual void update_service (Z_ExtendedServicesRequest *req, + Z_IUUpdate *io, + Z_ExtendedServicesResponse *res) = 0; + + virtual void update_service0 (Z_ExtendedServicesRequest *req, + Z_IU0Update *io, + Z_ExtendedServicesResponse *res) = 0; + + int init(Z_Server *server, + Z_InitRequest *initRequest, + Z_InitResponse *initResponse); + int recv(Z_Server *server, Z_APDU *apdu); +}; + + +class YAZ_EXPORT Yaz_Facility_Retrieval : public IServer_Facility, + public Z_ServerUtility { + public: + + virtual int sr_init (Z_InitRequest *initRequest, + Z_InitResponse *initResponse) = 0; + virtual void sr_search (Z_SearchRequest *searchRequest, + Z_SearchResponse *searchResponse) = 0; + virtual void sr_present (Z_PresentRequest *presentRequest, + Z_PresentResponse *presentResponse) = 0; + virtual void sr_record (const char *resultSetName, + int position, + int *format, + Z_RecordComposition *comp, + Z_NamePlusRecord *namePlusRecord, + Z_Records *diagnostics) = 0; + int init(Z_Server *server, + Z_InitRequest *initRequest, + Z_InitResponse *initResponse); + int recv(Z_Server *server, Z_APDU *apdu); + + ODR odr_encode(); + ODR odr_decode(); + private: + Z_Records *pack_records (Z_Server *s, + const char *resultSetName, + int start, int num, + Z_RecordComposition *comp, + int *next, int *pres, + int *oid); + + void fetch_via_piggyback (Z_Server *s, + Z_SearchRequest *searchRequest, + Z_SearchResponse *searchResponse); + void fetch_via_present (Z_Server *s, + Z_PresentRequest *req, Z_PresentResponse *res); + + int m_preferredMessageSize; + int m_maximumRecordSize; + ODR m_odr_encode; + ODR m_odr_decode; +}; + +class YAZ_EXPORT Z_Server_Facility_Info { + friend class Z_Server; + IServer_Facility *m_facility; + char *m_name; + Z_Server_Facility_Info *m_next; +}; + + + +class YAZ_EXPORT Z_Server : public Z_Assoc { +public: + Z_Server(IPDU_Observable *the_PDU_Observable); + virtual ~Z_Server(); + void recv_Z_PDU(Z_APDU *apdu, int len); + virtual void recv_GDU(Z_GDU *apdu, int len); + void facility_add(IServer_Facility *facility, const char *name); + void facility_reset (); + + + private: + Z_Server_Facility_Info *m_facilities; +}; + +class YAZ_EXPORT Yaz_USMARC { + public: + const char *get_record(size_t position); +}; +}; +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/src/Makefile.am b/src/Makefile.am index af2eb8f..210dbe3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,19 +1,19 @@ -## $Id: Makefile.am,v 1.30 2006-03-27 15:10:41 adam Exp $ +## $Id: Makefile.am,v 1.31 2006-03-29 13:14:15 adam Exp $ check_PROGRAMS = tstquery noinst_PROGRAMS = yaz-my-server yaz-my-client -bin_SCRIPTS = yaz++-config +bin_SCRIPTS = yazpp-config TESTS = $(check_PROGRAMS) AM_CXXFLAGS = -I$(srcdir)/../include $(YAZINC) -lib_LTLIBRARIES = libyazcpp.la -libyazcpp_la_LDFLAGS=-version-info 2:0:0 +lib_LTLIBRARIES = libyazpp.la +libyazpp_la_LDFLAGS=-version-info 1:0:0 DISTCLEANFILES = yaz++-config -libyazcpp_la_SOURCES=socket-observer.cpp pdu-observer.cpp query.cpp \ +libyazpp_la_SOURCES=socket-observer.cpp pdu-observer.cpp query.cpp \ z-server.cpp \ yaz-socket-manager.cpp yaz-pdu-assoc.cpp \ yaz-z-assoc.cpp yaz-z-query.cpp yaz-ir-assoc.cpp \ @@ -28,4 +28,4 @@ yaz_my_server_SOURCES=yaz-my-server.cpp yaz-marc-sample.cpp tstquery_SOURCES=tstquery.cpp -LDADD=libyazcpp.la $(YAZLALIB) +LDADD=libyazpp.la $(YAZLALIB) diff --git a/src/gdu.cpp b/src/gdu.cpp index 1f660ea..9fb99a0 100644 --- a/src/gdu.cpp +++ b/src/gdu.cpp @@ -2,10 +2,10 @@ * Copyright (c) 1998-2005, Index Data. * See the file LICENSE for details. * - * $Id: gdu.cpp,v 1.3 2005-10-13 09:56:38 adam Exp $ + * $Id: gdu.cpp,v 1.4 2006-03-29 13:14:15 adam Exp $ */ -#include +#include using namespace yazpp_1; diff --git a/src/gduqueue.cpp b/src/gduqueue.cpp index b0886cb..0478d3a 100644 --- a/src/gduqueue.cpp +++ b/src/gduqueue.cpp @@ -2,11 +2,11 @@ * Copyright (c) 1998-2005, Index Data. * See the file LICENSE for details. * - * $Id: gduqueue.cpp,v 1.1 2005-10-13 09:56:38 adam Exp $ + * $Id: gduqueue.cpp,v 1.2 2006-03-29 13:14:15 adam Exp $ */ -#include -#include +#include +#include using namespace yazpp_1; diff --git a/src/pdu-observer.cpp b/src/pdu-observer.cpp index bb9ad17..a19e797 100644 --- a/src/pdu-observer.cpp +++ b/src/pdu-observer.cpp @@ -2,10 +2,10 @@ * Copyright (c) 1998-2005, Index Data. * See the file LICENSE for details. * - * $Id: pdu-observer.cpp,v 1.1 2005-09-22 12:40:45 adam Exp $ + * $Id: pdu-observer.cpp,v 1.2 2006-03-29 13:14:15 adam Exp $ */ -#include +#include using namespace yazpp_1; diff --git a/src/query.cpp b/src/query.cpp index 12ba858..488a335 100644 --- a/src/query.cpp +++ b/src/query.cpp @@ -2,10 +2,10 @@ * Copyright (c) 1998-2000, Index Data. * See the file LICENSE for details. * - * $Id: query.cpp,v 1.1 2005-09-22 12:40:45 adam Exp $ + * $Id: query.cpp,v 1.2 2006-03-29 13:14:15 adam Exp $ */ -#include +#include using namespace yazpp_1; diff --git a/src/socket-observer.cpp b/src/socket-observer.cpp index ddd506a..b0224a0 100644 --- a/src/socket-observer.cpp +++ b/src/socket-observer.cpp @@ -2,10 +2,10 @@ * Copyright (c) 1998-2005, Index Data. * See the file LICENSE for details. * - * $Id: socket-observer.cpp,v 1.1 2005-09-22 12:40:45 adam Exp $ + * $Id: socket-observer.cpp,v 1.2 2006-03-29 13:14:15 adam Exp $ */ -#include +#include using namespace yazpp_1; diff --git a/src/tstquery.cpp b/src/tstquery.cpp index a93198a..16cfe0a 100644 --- a/src/tstquery.cpp +++ b/src/tstquery.cpp @@ -2,11 +2,11 @@ * Copyright (c) 1998-2005, Index Data. * See the file LICENSE for details. * - * $Id: tstquery.cpp,v 1.1 2005-09-27 17:57:51 adam Exp $ + * $Id: tstquery.cpp,v 1.2 2006-03-29 13:14:15 adam Exp $ */ #include -#include +#include using namespace yazpp_1; diff --git a/src/yaz-cql2rpn.cpp b/src/yaz-cql2rpn.cpp index 3906dff..e145791 100644 --- a/src/yaz-cql2rpn.cpp +++ b/src/yaz-cql2rpn.cpp @@ -2,12 +2,12 @@ * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-cql2rpn.cpp,v 1.8 2005-06-25 15:53:19 adam Exp $ + * $Id: yaz-cql2rpn.cpp,v 1.9 2006-03-29 13:14:15 adam Exp $ */ #include #include -#include +#include using namespace yazpp_1; diff --git a/src/yaz-ir-assoc.cpp b/src/yaz-ir-assoc.cpp index 4a004cb..5f5d00c 100644 --- a/src/yaz-ir-assoc.cpp +++ b/src/yaz-ir-assoc.cpp @@ -2,13 +2,13 @@ * Copyright (c) 1998-2003, Index Data. * See the file LICENSE for details. * - * $Id: yaz-ir-assoc.cpp,v 1.26 2005-06-25 15:53:19 adam Exp $ + * $Id: yaz-ir-assoc.cpp,v 1.27 2006-03-29 13:14:15 adam Exp $ */ #include #include -#include +#include using namespace yazpp_1; diff --git a/src/yaz-marc-sample.cpp b/src/yaz-marc-sample.cpp index 906fdd2..3f3181d 100644 --- a/src/yaz-marc-sample.cpp +++ b/src/yaz-marc-sample.cpp @@ -2,10 +2,10 @@ * Copyright (c) 2000-2001, Index Data. * See the file LICENSE for details. * - * $Id: yaz-marc-sample.cpp,v 1.9 2005-06-25 15:53:19 adam Exp $ + * $Id: yaz-marc-sample.cpp,v 1.10 2006-03-29 13:14:15 adam Exp $ */ -#include +#include using namespace yazpp_1; diff --git a/src/yaz-my-client.cpp b/src/yaz-my-client.cpp index 7884415..6ea5fa3 100644 --- a/src/yaz-my-client.cpp +++ b/src/yaz-my-client.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-my-client.cpp,v 1.22 2006-03-28 19:51:38 adam Exp $ + * $Id: yaz-my-client.cpp,v 1.23 2006-03-29 13:14:16 adam Exp $ */ #include @@ -10,9 +10,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include extern "C" { #if HAVE_READLINE_READLINE_H diff --git a/src/yaz-my-server.cpp b/src/yaz-my-server.cpp index 86ff26e..2c66628 100644 --- a/src/yaz-my-server.cpp +++ b/src/yaz-my-server.cpp @@ -2,16 +2,16 @@ * Copyright (c) 1998-2001, Index Data. * See the file LICENSE for details. * - * $Id: yaz-my-server.cpp,v 1.19 2005-06-25 15:53:19 adam Exp $ + * $Id: yaz-my-server.cpp,v 1.20 2006-03-29 13:14:16 adam Exp $ */ #include #include #include #include -#include -#include -#include +#include +#include +#include using namespace yazpp_1; diff --git a/src/yaz-pdu-assoc-thread.cpp b/src/yaz-pdu-assoc-thread.cpp index 23b9308..e48c051 100644 --- a/src/yaz-pdu-assoc-thread.cpp +++ b/src/yaz-pdu-assoc-thread.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-pdu-assoc-thread.cpp,v 1.13 2005-10-10 15:59:43 adam Exp $ + * $Id: yaz-pdu-assoc-thread.cpp,v 1.14 2006-03-29 13:14:17 adam Exp $ */ #ifdef WIN32 @@ -30,8 +30,8 @@ #include #include -#include -#include +#include +#include using namespace yazpp_1; diff --git a/src/yaz-pdu-assoc.cpp b/src/yaz-pdu-assoc.cpp index d92f2ec..cc4094c 100644 --- a/src/yaz-pdu-assoc.cpp +++ b/src/yaz-pdu-assoc.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-pdu-assoc.cpp,v 1.44 2005-09-23 13:11:04 adam Exp $ + * $Id: yaz-pdu-assoc.cpp,v 1.45 2006-03-29 13:14:17 adam Exp $ */ #include @@ -10,7 +10,7 @@ #include #include -#include +#include using namespace yazpp_1; diff --git a/src/yaz-socket-manager.cpp b/src/yaz-socket-manager.cpp index bfee990..1a2d472 100644 --- a/src/yaz-socket-manager.cpp +++ b/src/yaz-socket-manager.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2005, Index Data. * See the file LICENSE for details. * - * $Id: yaz-socket-manager.cpp,v 1.35 2005-06-25 15:53:19 adam Exp $ + * $Id: yaz-socket-manager.cpp,v 1.36 2006-03-29 13:14:17 adam Exp $ */ #ifdef WIN32 #include @@ -23,7 +23,7 @@ #include #include -#include +#include using namespace yazpp_1; diff --git a/src/yaz-z-assoc.cpp b/src/yaz-z-assoc.cpp index 3764293..bf82970 100644 --- a/src/yaz-z-assoc.cpp +++ b/src/yaz-z-assoc.cpp @@ -2,14 +2,14 @@ * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-z-assoc.cpp,v 1.38 2005-06-25 15:53:19 adam Exp $ + * $Id: yaz-z-assoc.cpp,v 1.39 2006-03-29 13:14:18 adam Exp $ */ #include #include #include -#include +#include #include using namespace yazpp_1; diff --git a/src/yaz-z-cache.cpp b/src/yaz-z-cache.cpp index 90c3c4b..fd35f7c 100644 --- a/src/yaz-z-cache.cpp +++ b/src/yaz-z-cache.cpp @@ -2,12 +2,12 @@ * Copyright (c) 2002-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-z-cache.cpp,v 1.14 2005-06-25 15:53:19 adam Exp $ + * $Id: yaz-z-cache.cpp,v 1.15 2006-03-29 13:14:18 adam Exp $ */ #include #include -#include +#include using namespace yazpp_1; diff --git a/src/yaz-z-databases.cpp b/src/yaz-z-databases.cpp index 5e1112d..c5a0d3d 100644 --- a/src/yaz-z-databases.cpp +++ b/src/yaz-z-databases.cpp @@ -2,12 +2,12 @@ * Copyright (c) 2001, Index Data. * See the file LICENSE for details. * - * $Id: yaz-z-databases.cpp,v 1.6 2005-06-25 15:53:19 adam Exp $ + * $Id: yaz-z-databases.cpp,v 1.7 2006-03-29 13:14:18 adam Exp $ */ #include -#include +#include using namespace yazpp_1; diff --git a/src/yaz-z-query.cpp b/src/yaz-z-query.cpp index f8bb4a4..d027640 100644 --- a/src/yaz-z-query.cpp +++ b/src/yaz-z-query.cpp @@ -2,11 +2,11 @@ * Copyright (c) 1998-2005, Index Data. * See the file LICENSE for details. * - * $Id: yaz-z-query.cpp,v 1.18 2005-09-27 17:57:51 adam Exp $ + * $Id: yaz-z-query.cpp,v 1.19 2006-03-29 13:14:18 adam Exp $ */ #include -#include +#include #include using namespace yazpp_1; diff --git a/src/yaz-z-server-ill.cpp b/src/yaz-z-server-ill.cpp index add09e9..7805b5e 100644 --- a/src/yaz-z-server-ill.cpp +++ b/src/yaz-z-server-ill.cpp @@ -2,11 +2,11 @@ * Copyright (c) 2000-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-z-server-ill.cpp,v 1.14 2005-06-25 15:53:19 adam Exp $ + * $Id: yaz-z-server-ill.cpp,v 1.15 2006-03-29 13:14:18 adam Exp $ */ #include -#include +#include using namespace yazpp_1; diff --git a/src/yaz-z-server-sr.cpp b/src/yaz-z-server-sr.cpp index 401b8e3..88e1d2d 100644 --- a/src/yaz-z-server-sr.cpp +++ b/src/yaz-z-server-sr.cpp @@ -2,12 +2,12 @@ * Copyright (c) 2000-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-z-server-sr.cpp,v 1.11 2005-06-25 15:53:19 adam Exp $ + * $Id: yaz-z-server-sr.cpp,v 1.12 2006-03-29 13:14:18 adam Exp $ * */ #include -#include +#include using namespace yazpp_1; diff --git a/src/yaz-z-server-update.cpp b/src/yaz-z-server-update.cpp index 2d5dc1e..2b1fe51 100644 --- a/src/yaz-z-server-update.cpp +++ b/src/yaz-z-server-update.cpp @@ -2,11 +2,11 @@ * Copyright (c) 2000-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-z-server-update.cpp,v 1.11 2005-06-25 15:53:19 adam Exp $ + * $Id: yaz-z-server-update.cpp,v 1.12 2006-03-29 13:14:18 adam Exp $ */ #include -#include +#include using namespace yazpp_1; diff --git a/src/yaz-z-server.cpp b/src/yaz-z-server.cpp index 68bab4c..ea59a4c 100644 --- a/src/yaz-z-server.cpp +++ b/src/yaz-z-server.cpp @@ -2,11 +2,11 @@ * Copyright (c) 2000-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-z-server.cpp,v 1.23 2005-06-25 15:53:19 adam Exp $ + * $Id: yaz-z-server.cpp,v 1.24 2006-03-29 13:14:18 adam Exp $ */ #include -#include +#include using namespace yazpp_1; diff --git a/src/z-server.cpp b/src/z-server.cpp index 044baa8..7a59b64 100644 --- a/src/z-server.cpp +++ b/src/z-server.cpp @@ -2,10 +2,10 @@ * Copyright (c) 2000-2005, Index Data. * See the file LICENSE for details. * - * $Id: z-server.cpp,v 1.1 2005-09-22 12:40:45 adam Exp $ + * $Id: z-server.cpp,v 1.2 2006-03-29 13:14:18 adam Exp $ */ -#include +#include using namespace yazpp_1; diff --git a/win/makefile b/win/makefile index 5056deb..cfdc57d 100644 --- a/win/makefile +++ b/win/makefile @@ -1,6 +1,6 @@ # Copyright (C) 1995-2005, Index Data ApS # All rights reserved. -# $Id: makefile,v 1.9 2005-11-03 14:48:06 adam Exp $ +# $Id: makefile,v 1.10 2006-03-29 13:14:19 adam Exp $ ########################################################### ############### Parameters @@ -28,7 +28,7 @@ nsishelp: ########################################################### # The current directory is supposed to be something like # ..../yaz/win, everything is relative to that -ROOTDIR=.. # The home of yaz++ +ROOTDIR=.. # The home of yazpp INCLDIR=$(ROOTDIR)\include # our includes LIBDIR=$(ROOTDIR)\lib # We produce .lib, .exp etc there diff --git a/yaz++-config.in b/yaz++-config.in deleted file mode 100644 index 052e142..0000000 --- a/yaz++-config.in +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/sh -# $Id: yaz++-config.in,v 1.7 2004-03-29 22:46:50 adam Exp $ -yazppprefix=@prefix@ -yaz_echo_cflags=no -yaz_echo_libs=no -yaz_echo_help=no -yaz_echo_tabs=no -yaz_echo_source=yes -yaz_echo_lalibs=no -yazpp_src_root=@YAZPP_SRC_ROOT@ -yazpp_build_root=@YAZPP_BUILD_ROOT@ - -yazlibs="@YAZLIB@ @LIBS@" -yazlalibs="@YAZLALIB@ @LIBS@" -YAZPPVERSION=@VERSION@ - -usage() -{ - cat <&2 -fi -if test "$yaz_echo_cflags" = "yes"; then - echo $YAZPPINC -fi -if test "$yaz_echo_libs" = "yes"; then - echo $YAZPPLIB -fi -if test "$yaz_echo_lalibs" = "yes"; then - echo $YAZPPLALIB -fi diff --git a/yazpp-config.in b/yazpp-config.in new file mode 100644 index 0000000..4f362e3 --- /dev/null +++ b/yazpp-config.in @@ -0,0 +1,106 @@ +#!/bin/sh +# $Id: yazpp-config.in,v 1.1 2006-03-29 13:14:13 adam Exp $ +yazppprefix=@prefix@ +yaz_echo_cflags=no +yaz_echo_libs=no +yaz_echo_help=no +yaz_echo_tabs=no +yaz_echo_source=yes +yaz_echo_lalibs=no +yazpp_src_root=@YAZPP_SRC_ROOT@ +yazpp_build_root=@YAZPP_BUILD_ROOT@ + +yazlibs="@YAZLIB@ @LIBS@" +yazlalibs="@YAZLALIB@ @LIBS@" +YAZPPVERSION=@VERSION@ + +usage() +{ + cat <&2 +fi +if test "$yaz_echo_cflags" = "yes"; then + echo $YAZPPINC +fi +if test "$yaz_echo_libs" = "yes"; then + echo $YAZPPLIB +fi +if test "$yaz_echo_lalibs" = "yes"; then + echo $YAZPPLALIB +fi diff --git a/yazpp.m4 b/yazpp.m4 index 63be11e..cf121a0 100644 --- a/yazpp.m4 +++ b/yazpp.m4 @@ -6,24 +6,24 @@ AC_DEFUN([YAZPP_INIT], AC_SUBST(YAZPPVERSION) yazppconfig=NONE yazpppath=NONE - AC_ARG_WITH(yazpp, [ --with-yazpp=DIR yaz++-config in DIR (example /home/yaz++-0.8)], [yazpppath=$withval]) + AC_ARG_WITH(yazpp, [ --with-yazpp=DIR yazpp-config in DIR (example /home/yazpp-1.0.0)], [yazpppath=$withval]) if test "x$yazpppath" != "xNONE"; then - yazppconfig=$yazpppath/yaz++-config + yazppconfig=$yazpppath/yazpp-config else if test "x$srcdir" = "x"; then yazppsrcdir=. else yazppsrcdir=$srcdir fi - for i in ${yazppsrcdir}/../../yaz++ ${yazppsrcdir}/../yaz++-* ${yazppsrcdir}/../yaz++; do + for i in ${yazppsrcdir}/../../yazpp ${yazppsrcdir}/../yazpp-* ${yazppsrcdir}/../yazpp; do if test -d $i; then - if test -r $i/yaz++-config; then - yazppconfig=$i/yaz++-config + if test -r $i/yazpp-config; then + yazppconfig=$i/yazpp-config fi fi done if test "x$yazppconfig" = "xNONE"; then - AC_PATH_PROG(yazppconfig, yaz++-config, NONE) + AC_PATH_PROG(yazppconfig, yazpp-config, NONE) fi fi AC_MSG_CHECKING(for YAZ++) diff --git a/zlint/Makefile.am b/zlint/Makefile.am index d1ba481..189febc 100644 --- a/zlint/Makefile.am +++ b/zlint/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.6 2004-04-11 12:21:17 adam Exp $ +## $Id: Makefile.am,v 1.7 2006-03-29 13:14:19 adam Exp $ AM_CXXFLAGS = $(YAZINC) -I$(srcdir)/../include @@ -17,4 +17,4 @@ zlint_SOURCES=zlint.cpp zlint.h \ noinst_PROGRAMS = zlint -LDADD=../src/libyazcpp.la $(YAZLALIB) +LDADD=../src/libyazpp.la $(YAZLALIB) diff --git a/zlint/main.cpp b/zlint/main.cpp index f05e61a..9dc8aab 100644 --- a/zlint/main.cpp +++ b/zlint/main.cpp @@ -1,7 +1,7 @@ #include -#include -#include +#include +#include #include diff --git a/zlint/zlint.h b/zlint/zlint.h index 5f898d2..0ac1717 100644 --- a/zlint/zlint.h +++ b/zlint/zlint.h @@ -2,10 +2,10 @@ * Copyright (c) 2004-2005, Index Data. * See the file LICENSE for details. * - * $Id: zlint.h,v 1.6 2005-09-23 13:11:04 adam Exp $ + * $Id: zlint.h,v 1.7 2006-03-29 13:14:20 adam Exp $ */ -#include +#include using namespace yazpp_1; diff --git a/zoom/Makefile.am b/zoom/Makefile.am index e813f86..151a66b 100644 --- a/zoom/Makefile.am +++ b/zoom/Makefile.am @@ -1,17 +1,17 @@ -# $Header: /home/cvsroot/yaz++/zoom/Makefile.am,v 1.12 2006-03-27 15:10:42 adam Exp $ +# $Header: /home/cvsroot/yaz++/zoom/Makefile.am,v 1.13 2006-03-29 13:14:20 adam Exp $ AM_CXXFLAGS= $(YAZINC) if ZOOM -lib_LTLIBRARIES = libzoomcpp.la +lib_LTLIBRARIES = libzoompp.la noinst_PROGRAMS = zclient endif -libzoomcpp_la_LDFLAGS=-version-info 2:0:0 -LDADD=libzoomcpp.la $(YAZLALIB) +libzoompp_la_LDFLAGS=-version-info 1:0:0 +LDADD=libzoompp.la $(YAZLALIB) mirk_sources = zexcept.cpp zconn.cpp zquery.cpp zrs.cpp zrec.cpp -libzoomcpp_la_SOURCES = $(mirk_sources) interface.h +libzoompp_la_SOURCES = $(mirk_sources) interface.h pkginclude_HEADERS=zoom.h zclient_SOURCES=zclient.cpp -- 1.7.10.4