From: Adam Dickmeiss Date: Wed, 8 Jun 2005 13:29:03 +0000 (+0000) Subject: Updated for yaz++ API where Yaz_ was removed from many classes. X-Git-Tag: YAZPROXY.ERE2~11 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=ee8cfba95daa813ea4dd66ba9e99066db5e5b967;p=yazproxy-moved-to-github.git Updated for yaz++ API where Yaz_ was removed from many classes. --- diff --git a/include/yazproxy/proxy.h b/include/yazproxy/proxy.h index f217c97..da78301 100644 --- a/include/yazproxy/proxy.h +++ b/include/yazproxy/proxy.h @@ -1,4 +1,4 @@ -/* $Id: proxy.h,v 1.18 2005-06-02 06:40:46 adam Exp $ +/* $Id: proxy.h,v 1.19 2005-06-08 13:29:03 adam Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -52,7 +52,7 @@ enum YAZ_Proxy_MARCXML_mode { class Msg_Thread; /// Information Retrieval Proxy Server. -class YAZ_EXPORT Yaz_Proxy : public yazpp_1::Yaz_Z_Assoc { +class YAZ_EXPORT Yaz_Proxy : public yazpp_1::Z_Assoc { friend class Proxy_Msg; private: char *get_cookie(Z_OtherInformation **otherInfo); @@ -66,8 +66,8 @@ class YAZ_EXPORT Yaz_Proxy : public yazpp_1::Yaz_Z_Assoc { void shutdown(); void releaseClient(); Yaz_ProxyClient *m_client; - yazpp_1::IYaz_PDU_Observable *m_PDU_Observable; - yazpp_1::IYazSocketObservable *m_socket_observable; + yazpp_1::IPDU_Observable *m_PDU_Observable; + yazpp_1::ISocketObservable *m_socket_observable; Yaz_ProxyClient *m_clientPool; Yaz_Proxy *m_parent; int m_seqno; @@ -179,8 +179,8 @@ class YAZ_EXPORT Yaz_Proxy : public yazpp_1::Yaz_Z_Assoc { Yaz_usemarcon *m_usemarcon; Yaz_CharsetConverter *m_charset_converter; public: - Yaz_Proxy(yazpp_1::IYaz_PDU_Observable *the_PDU_Observable, - yazpp_1::IYazSocketObservable *the_socket_observable, + Yaz_Proxy(yazpp_1::IPDU_Observable *the_PDU_Observable, + yazpp_1::ISocketObservable *the_socket_observable, Yaz_Proxy *parent = 0); ~Yaz_Proxy(); int handle_authentication(Z_APDU *apdu); @@ -191,8 +191,8 @@ class YAZ_EXPORT Yaz_Proxy : public yazpp_1::Yaz_Z_Assoc { void handle_incoming_HTTP(Z_HTTP_Request *req); void handle_incoming_Z_PDU(Z_APDU *apdu); void handle_incoming_Z_PDU_2(Z_APDU *apdu); - IYaz_PDU_Observer* sessionNotify - (yazpp_1::IYaz_PDU_Observable *the_PDU_Observable, int fd); + IPDU_Observer *sessionNotify(yazpp_1::IPDU_Observable *the_PDU_Observable, + int fd); void failNotify(); void timeoutNotify(); void connectNotify(); diff --git a/src/msg-thread.cpp b/src/msg-thread.cpp index 78c3c31..78ea226 100644 --- a/src/msg-thread.cpp +++ b/src/msg-thread.cpp @@ -1,4 +1,4 @@ -/* $Id: msg-thread.cpp,v 1.2 2005-06-02 06:40:46 adam Exp $ +/* $Id: msg-thread.cpp,v 1.3 2005-06-08 13:29:03 adam Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -72,12 +72,12 @@ static void *tfunc(void *p) } -Msg_Thread::Msg_Thread(IYazSocketObservable *obs) +Msg_Thread::Msg_Thread(ISocketObservable *obs) : m_SocketObservable(obs) { pipe(m_fd); obs->addObserver(m_fd[0], this); - obs->maskObserver(this, YAZ_SOCKET_OBSERVE_READ); + obs->maskObserver(this, SOCKET_OBSERVE_READ); m_stop_flag = false; pthread_mutex_init(&m_mutex_input_data, 0); @@ -108,7 +108,7 @@ Msg_Thread::~Msg_Thread() void Msg_Thread::socketNotify(int event) { - if (event & YAZ_SOCKET_OBSERVE_READ) + if (event & SOCKET_OBSERVE_READ) { char buf[2]; read(m_fd[0], buf, 1); diff --git a/src/msg-thread.h b/src/msg-thread.h index 725c8ad..2ad7834 100644 --- a/src/msg-thread.h +++ b/src/msg-thread.h @@ -1,4 +1,4 @@ -/* $Id: msg-thread.h,v 1.2 2005-06-02 06:40:46 adam Exp $ +/* $Id: msg-thread.h,v 1.3 2005-06-08 13:29:03 adam Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -53,9 +53,9 @@ class Msg_Thread_Queue { Msg_Thread_Queue_List *m_list; }; -class Msg_Thread : public yazpp_1::IYazSocketObserver { +class Msg_Thread : public yazpp_1::ISocketObserver { public: - Msg_Thread(yazpp_1::IYazSocketObservable *obs); + Msg_Thread(yazpp_1::ISocketObservable *obs); virtual ~Msg_Thread(); void socketNotify(int event); void put(IMsg_Thread *m); @@ -63,7 +63,7 @@ class Msg_Thread : public yazpp_1::IYazSocketObserver { void run(void *p); int m_fd[2]; private: - yazpp_1::IYazSocketObservable *m_SocketObservable; + yazpp_1::ISocketObservable *m_SocketObservable; pthread_t m_thread_id; Msg_Thread_Queue m_input; Msg_Thread_Queue m_output; diff --git a/src/proxyp.h b/src/proxyp.h index 1019e55..98c25fc 100644 --- a/src/proxyp.h +++ b/src/proxyp.h @@ -1,4 +1,4 @@ -/* $Id: proxyp.h,v 1.6 2005-06-02 06:40:46 adam Exp $ +/* $Id: proxyp.h,v 1.7 2005-06-08 13:29:03 adam Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -138,16 +138,16 @@ public: class Yaz_ProxyConfigP *m_cp; }; -class Yaz_ProxyClient : public yazpp_1::Yaz_Z_Assoc { +class Yaz_ProxyClient : public yazpp_1::Z_Assoc { friend class Yaz_Proxy; - Yaz_ProxyClient(yazpp_1::IYaz_PDU_Observable *the_PDU_Observable, + Yaz_ProxyClient(yazpp_1::IPDU_Observable *the_PDU_Observable, Yaz_Proxy *parent); ~Yaz_ProxyClient(); void recv_GDU(Z_GDU *apdu, int len); void recv_Z_PDU(Z_APDU *apdu, int len); void recv_HTTP_response(Z_HTTP_Response *apdu, int len); - IYaz_PDU_Observer* sessionNotify - (yazpp_1::IYaz_PDU_Observable *the_PDU_Observable, int fd); + IPDU_Observer* sessionNotify + (yazpp_1::IPDU_Observable *the_PDU_Observable, int fd); void shutdown(); Yaz_Proxy *m_server; void failNotify(); @@ -177,7 +177,7 @@ class Yaz_ProxyClient : public yazpp_1::Yaz_Z_Assoc { Z_ProtocolVersion *m_initResponse_version; int m_initResponse_preferredMessageSize; int m_initResponse_maximumRecordSize; - yazpp_1::Yaz_RecordCache m_cache; + yazpp_1::RecordCache m_cache; void pre_init_client(); int m_target_idletime; Yaz_Proxy *m_root; diff --git a/src/tstthreads.cpp b/src/tstthreads.cpp index 60ca4f7..f721f40 100644 --- a/src/tstthreads.cpp +++ b/src/tstthreads.cpp @@ -1,4 +1,4 @@ -/* $Id: tstthreads.cpp,v 1.4 2005-06-02 06:40:46 adam Exp $ +/* $Id: tstthreads.cpp,v 1.5 2005-06-08 13:29:03 adam Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -52,23 +52,23 @@ void My_Msg::result() printf("My_Msg::result val=%d\n", m_val); } -class My_Timer_Thread : public IYazSocketObserver { +class My_Timer_Thread : public ISocketObserver { private: - IYazSocketObservable *m_obs; + ISocketObservable *m_obs; int m_fd[2]; Msg_Thread *m_t; public: - My_Timer_Thread(IYazSocketObservable *obs, Msg_Thread *t); + My_Timer_Thread(ISocketObservable *obs, Msg_Thread *t); void socketNotify(int event); }; -My_Timer_Thread::My_Timer_Thread(IYazSocketObservable *obs, +My_Timer_Thread::My_Timer_Thread(ISocketObservable *obs, Msg_Thread *t) : m_obs(obs) { pipe(m_fd); m_t = t; obs->addObserver(m_fd[0], this); - obs->maskObserver(this, YAZ_SOCKET_OBSERVE_READ); + obs->maskObserver(this, SOCKET_OBSERVE_READ); obs->timeoutObserver(this, 2); } @@ -83,7 +83,7 @@ void My_Timer_Thread::socketNotify(int event) int main(int argc, char **argv) { - Yaz_SocketManager mySocketManager; + SocketManager mySocketManager; Msg_Thread m(&mySocketManager); My_Timer_Thread t(&mySocketManager, &m) ; diff --git a/src/yaz-proxy-main.cpp b/src/yaz-proxy-main.cpp index b439ba4..b8a26d1 100644 --- a/src/yaz-proxy-main.cpp +++ b/src/yaz-proxy-main.cpp @@ -1,4 +1,4 @@ -/* $Id: yaz-proxy-main.cpp,v 1.14 2005-06-02 06:40:46 adam Exp $ +/* $Id: yaz-proxy-main.cpp,v 1.15 2005-06-08 13:29:03 adam Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -196,7 +196,7 @@ static void proxy_xml_error_handler(void *ctx, const char *fmt, ...) } #endif -static void child_run(Yaz_SocketManager *m, int run) +static void child_run(SocketManager *m, int run) { #ifdef WIN32 #else @@ -284,8 +284,8 @@ int main(int argc, char **argv) #endif int cont = 1; int run = 1; - Yaz_SocketManager mySocketManager; - Yaz_Proxy proxy(new Yaz_PDU_Assoc(&mySocketManager), &mySocketManager); + SocketManager mySocketManager; + Yaz_Proxy proxy(new PDU_Assoc(&mySocketManager), &mySocketManager); static_yaz_proxy = &proxy; diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index c1cc98f..9280b83 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -1,4 +1,4 @@ -/* $Id: yaz-proxy.cpp,v 1.29 2005-06-02 06:40:46 adam Exp $ +/* $Id: yaz-proxy.cpp,v 1.30 2005-06-08 13:29:03 adam Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -145,11 +145,11 @@ static const char *gdu_name(Z_GDU *gdu) return "Unknown request/response"; } -Yaz_Proxy::Yaz_Proxy(IYaz_PDU_Observable *the_PDU_Observable, - IYazSocketObservable *the_socket_observable, +Yaz_Proxy::Yaz_Proxy(IPDU_Observable *the_PDU_Observable, + ISocketObservable *the_socket_observable, Yaz_Proxy *parent) : - Yaz_Z_Assoc(the_PDU_Observable), m_bw_stat(60), m_pdu_stat(60) + Z_Assoc(the_PDU_Observable), m_bw_stat(60), m_pdu_stat(60) { m_PDU_Observable = the_PDU_Observable; m_socket_observable = the_socket_observable; @@ -338,8 +338,8 @@ Yaz_ProxyConfig *Yaz_Proxy::check_reconfigure() return cfg; } -IYaz_PDU_Observer *Yaz_Proxy::sessionNotify(IYaz_PDU_Observable - *the_PDU_Observable, int fd) +IPDU_Observer *Yaz_Proxy::sessionNotify(IPDU_Observable + *the_PDU_Observable, int fd) { check_reconfigure(); Yaz_Proxy *new_proxy = new Yaz_Proxy(the_PDU_Observable, @@ -2975,8 +2975,8 @@ void Yaz_ProxyClient::connectNotify() pre_init_client(); } -IYaz_PDU_Observer *Yaz_ProxyClient::sessionNotify(IYaz_PDU_Observable - *the_PDU_Observable, int fd) +IPDU_Observer *Yaz_ProxyClient::sessionNotify(IPDU_Observable + *the_PDU_Observable, int fd) { return new Yaz_ProxyClient(the_PDU_Observable, 0); } @@ -3177,9 +3177,9 @@ void Yaz_ProxyClient::timeoutNotify() shutdown(); } -Yaz_ProxyClient::Yaz_ProxyClient(IYaz_PDU_Observable *the_PDU_Observable, +Yaz_ProxyClient::Yaz_ProxyClient(IPDU_Observable *the_PDU_Observable, Yaz_Proxy *parent) : - Yaz_Z_Assoc (the_PDU_Observable) + Z_Assoc (the_PDU_Observable) { m_cookie = 0; m_next = 0; @@ -3364,7 +3364,7 @@ void Yaz_Proxy::low_socket_open() int Yaz_Proxy::server(const char *addr) { - int r = Yaz_Z_Assoc::server(addr); + int r = Z_Assoc::server(addr); if (!r) { yaz_log(YLOG_LOG, "%sStarted proxy "