X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fyaz%2B%2B%2Fz-assoc.h;h=1a6e673fed43f10ddaf3149ef915cd41e4230b70;hb=76d66b222afff97cf367a3e7b8bfe045a62d0d57;hp=13f57feff3a998aff9c12fb12c40995080817ed9;hpb=7fc0fddcb85cd64461c7b3dd3e68791eb88b40be;p=yazpp-moved-to-github.git diff --git a/include/yaz++/z-assoc.h b/include/yaz++/z-assoc.h index 13f57fe..1a6e673 100644 --- a/include/yaz++/z-assoc.h +++ b/include/yaz++/z-assoc.h @@ -1,27 +1,29 @@ /* - * Copyright (c) 1998-2000, Index Data. + * Copyright (c) 1998-2005, Index Data. * See the file LICENSE for details. * - * $Id: z-assoc.h,v 1.3 2003-10-10 12:37:26 adam Exp $ + * $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 Yaz_Z_Assoc : public IYaz_PDU_Observer { +class YAZ_EXPORT Z_Assoc : public IPDU_Observer { public: /// Create object using the PDU Observer specified - Yaz_Z_Assoc(IYaz_PDU_Observable *the_PDU_Observable); + Z_Assoc(IPDU_Observable *the_PDU_Observable); /// Destroy assocation and close PDU Observer - virtual ~Yaz_Z_Assoc(); + virtual ~Z_Assoc(); /// Receive PDU void recv_PDU(const char *buf, int len); /// Connect notification @@ -35,17 +37,18 @@ class YAZ_EXPORT Yaz_Z_Assoc : public IYaz_PDU_Observer { /// Begin Z39.50 client role int client(const char *addr); /// Begin Z39.50 server role - void server(const char *addr); + int server(const char *addr); /// Close connection void close(); /// Decode Z39.50 PDU. - Z_APDU *decode_Z_PDU(const char *buf, int len); + Z_GDU *decode_GDU(const char *buf, int len); /// Encode Z39.50 PDU. - int encode_Z_PDU(Z_APDU *apdu, char **buf, int *len); + 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_Z_PDU(Z_APDU *apdu, int len) = 0; + 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 @@ -59,20 +62,20 @@ class YAZ_EXPORT Yaz_Z_Assoc : public IYaz_PDU_Observer { /// 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); + Z_OtherInformation **otherInformationP, int createFlag, + int *oid, int categoryValue, int deleteFlag); void set_otherInformationString ( - Z_OtherInformation **otherInformationP, - int *oid, int categoryValue, - const char *str); + Z_OtherInformation **otherInformationP, + int *oid, int categoryValue, + const char *str); void set_otherInformationString ( - Z_OtherInformation **otherInformation, - int oidval, int categoryValue, - const char *str); + Z_OtherInformation **otherInformation, + int oidval, int categoryValue, + const char *str); void set_otherInformationString ( - Z_APDU *apdu, - int oidval, int categoryValue, - const char *str); + Z_APDU *apdu, + int oidval, int categoryValue, + const char *str); Z_ReferenceId *getRefID(char* str); Z_ReferenceId **get_referenceIdP(Z_APDU *apdu); @@ -80,10 +83,12 @@ class YAZ_EXPORT Yaz_Z_Assoc : public IYaz_PDU_Observer { const char *get_hostname(); + int set_APDU_yazlog(int v); + private: static int yaz_init_flag; static int yaz_init_func(); - IYaz_PDU_Observable *m_PDU_Observable; + IPDU_Observable *m_PDU_Observable; ODR m_odr_in; ODR m_odr_out; ODR m_odr_print; @@ -91,6 +96,16 @@ class YAZ_EXPORT Yaz_Z_Assoc : public IYaz_PDU_Observer { 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 + */ +