From: Adam Dickmeiss Date: Wed, 19 Sep 2012 13:38:03 +0000 (+0200) Subject: Reformat: delete trailing whitespace X-Git-Tag: v1.3.3~6 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=711105a336b155f2b7f098cf84f2e30952cb8588;p=yazpp-moved-to-github.git Reformat: delete trailing whitespace --- diff --git a/include/yazpp/ir-assoc.h b/include/yazpp/ir-assoc.h index a1c9f3e..1b83e14 100644 --- a/include/yazpp/ir-assoc.h +++ b/include/yazpp/ir-assoc.h @@ -79,7 +79,7 @@ class YAZ_EXPORT IR_Assoc: public Z_Assoc { int send_searchRequest(Yaz_Z_Query *query, char* pResultSetId = NULL, char* pRefId = NULL); int send_presentRequest(Odr_int start, Odr_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); diff --git a/include/yazpp/limit-connect.h b/include/yazpp/limit-connect.h index 27b431e..47ae13e 100644 --- a/include/yazpp/limit-connect.h +++ b/include/yazpp/limit-connect.h @@ -41,8 +41,8 @@ namespace yazpp_1 { void set_period(int sec); private: struct Peer; - - int m_period; + + int m_period; Peer *m_peers; Peer **lookup(const char *peername); }; diff --git a/include/yazpp/pdu-assoc.h b/include/yazpp/pdu-assoc.h index 869f950..ac86329 100644 --- a/include/yazpp/pdu-assoc.h +++ b/include/yazpp/pdu-assoc.h @@ -42,7 +42,7 @@ namespace yazpp_1 { class YAZ_EXPORT PDU_Assoc : public IPDU_Observable, yazpp_1::ISocketObserver { friend class PDU_AssocThread; private: - enum { + enum { Connecting, Listen, Ready, diff --git a/include/yazpp/record-cache.h b/include/yazpp/record-cache.h index 088680d..b7f1e31 100644 --- a/include/yazpp/record-cache.h +++ b/include/yazpp/record-cache.h @@ -37,7 +37,7 @@ class YAZ_EXPORT RecordCache { 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(); diff --git a/include/yazpp/socket-manager.h b/include/yazpp/socket-manager.h index 25f99e8..ec65c29 100644 --- a/include/yazpp/socket-manager.h +++ b/include/yazpp/socket-manager.h @@ -58,7 +58,7 @@ class YAZ_EXPORT SocketManager : public ISocketObservable { }; SocketEvent *m_queue_front; SocketEvent *m_queue_back; - + SocketEntry **lookupObserver (ISocketObserver *observer); SocketEvent *getEvent(); diff --git a/include/yazpp/socket-observer.h b/include/yazpp/socket-observer.h index 447c4ef..e6942bc 100644 --- a/include/yazpp/socket-observer.h +++ b/include/yazpp/socket-observer.h @@ -31,7 +31,7 @@ #include namespace yazpp_1 { - + enum SocketObserve { SOCKET_OBSERVE_READ=1, SOCKET_OBSERVE_WRITE=2, @@ -43,7 +43,7 @@ namespace yazpp_1 { Forward reference */ class ISocketObserver; - + /** Socket Observable. This interface implements notification of socket events. The module interested in (observing) the sockets @@ -76,7 +76,7 @@ namespace yazpp_1 { int timeout)=0; virtual ~ISocketObservable(); }; - + /** Socket Observer. The ISocketObserver interface implements a module interested socket events. Look for objects that implements the @@ -88,7 +88,7 @@ namespace yazpp_1 { virtual void socketNotify(int event) = 0; virtual ~ISocketObserver(); }; - + }; #endif /* diff --git a/include/yazpp/z-databases.h b/include/yazpp/z-databases.h index 2be3f41..a2c9e68 100644 --- a/include/yazpp/z-databases.h +++ b/include/yazpp/z-databases.h @@ -28,7 +28,7 @@ #include namespace yazpp_1 { -/** Z39.50 Databases list +/** Z39.50 Databases list */ class YAZ_EXPORT Yaz_Z_Databases { public: diff --git a/include/yazpp/z-server.h b/include/yazpp/z-server.h index f4aafa7..e17dff6 100644 --- a/include/yazpp/z-server.h +++ b/include/yazpp/z-server.h @@ -39,7 +39,7 @@ class YAZ_EXPORT Z_ServerUtility { 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); diff --git a/src/gdu.cpp b/src/gdu.cpp index 1d4b7b2..d84a45e 100644 --- a/src/gdu.cpp +++ b/src/gdu.cpp @@ -42,7 +42,7 @@ void GDU::base(Z_GDU *gdu, ODR encode) { int len; char *buf = odr_getbuf(encode, &len, 0); - + odr_setbuf(m_decode, buf, len, 0); z_GDU(m_decode, &m_gdu, 0, 0); } diff --git a/src/limit-connect.cpp b/src/limit-connect.cpp index 57cb5bd..9f1b7f4 100644 --- a/src/limit-connect.cpp +++ b/src/limit-connect.cpp @@ -39,11 +39,11 @@ using namespace yazpp_1; struct LimitConnect::Peer { friend class LimitConnect; - + Peer(int sz, const char *peername); ~Peer(); void add_connect(); - + char *m_peername; TimeStat m_bw; Peer *m_next; diff --git a/src/pdu-observer.cpp b/src/pdu-observer.cpp index e375756..5c18f60 100644 --- a/src/pdu-observer.cpp +++ b/src/pdu-observer.cpp @@ -7,7 +7,7 @@ #include #endif #include - + using namespace yazpp_1; IPDU_Observable::~IPDU_Observable() diff --git a/src/yaz-cql2rpn.cpp b/src/yaz-cql2rpn.cpp index f49ff19..ce0e18a 100644 --- a/src/yaz-cql2rpn.cpp +++ b/src/yaz-cql2rpn.cpp @@ -38,7 +38,7 @@ bool Yaz_cql2rpn::parse_spec_file(const char *fname, int *error) return m_transform ? true : false; } -int Yaz_cql2rpn::query_transform(const char *cql_query, +int Yaz_cql2rpn::query_transform(const char *cql_query, Z_RPNQuery **rpnquery, ODR o, char **addinfop) { @@ -55,7 +55,7 @@ int Yaz_cql2rpn::query_transform(const char *cql_query, else { char rpn_buf[10240]; - r = cql_transform_buf(m_transform, cql_parser_result(cp), + r = cql_transform_buf(m_transform, cql_parser_result(cp), rpn_buf, sizeof(rpn_buf)-1); if (!r) { @@ -75,7 +75,7 @@ int Yaz_cql2rpn::query_transform(const char *cql_query, { r = cql_transform_error(m_transform, &addinfo); } - } + } cql_parser_destroy(cp); if (addinfo) *addinfop = odr_strdup(o, addinfo); diff --git a/src/yaz-ir-assoc.cpp b/src/yaz-ir-assoc.cpp index e93694d..c40ebda 100644 --- a/src/yaz-ir-assoc.cpp +++ b/src/yaz-ir-assoc.cpp @@ -95,7 +95,7 @@ void IR_Assoc::set_databaseNames(const char *dblist, const char *sep) void IR_Assoc::set_preferredRecordSyntax (const char *syntax) { xfree(m_preferredRecordSyntax); - m_preferredRecordSyntax = 0; + m_preferredRecordSyntax = 0; if (syntax && *syntax) m_preferredRecordSyntax = xstrdup(syntax); } @@ -165,7 +165,7 @@ void IR_Assoc::recv_Z_PDU(Z_APDU *apdu, int len) recv_searchRequest(apdu->u.searchRequest); break; case Z_APDU_searchResponse: - yaz_log (m_log, "recv searchResponse"); + yaz_log (m_log, "recv searchResponse"); recv_searchResponse(apdu->u.searchResponse); break; case Z_APDU_presentRequest: @@ -206,7 +206,7 @@ int IR_Assoc::send_searchRequest(Yaz_Z_Query *query, assert (req->otherInfo == 0); if (m_cookie) { - set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie, + set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie, 1, m_cookie); assert (req->otherInfo); } @@ -224,8 +224,8 @@ int IR_Assoc::send_searchRequest(Yaz_Z_Query *query, return send_Z_PDU(apdu, 0); } -int IR_Assoc::send_presentRequest(Odr_int start, - Odr_int number, +int IR_Assoc::send_presentRequest(Odr_int start, + Odr_int number, char* pResultSetId, char* pRefId) { @@ -254,7 +254,7 @@ int IR_Assoc::send_presentRequest(Odr_int start, } if (m_cookie) - set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie, + set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie, 1, m_cookie); if ( pRefId ) @@ -366,7 +366,7 @@ int IR_Assoc::send_initRequest(char* pRefId) { Z_APDU *apdu = create_Z_PDU(Z_APDU_initRequest); Z_InitRequest *req = apdu->u.initRequest; - + ODR_MASK_SET(req->options, Z_Options_search); ODR_MASK_SET(req->options, Z_Options_present); ODR_MASK_SET(req->options, Z_Options_namedResultSets); @@ -386,10 +386,10 @@ int IR_Assoc::send_initRequest(char* pRefId) } if (m_proxy && m_host) - set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_proxy, + set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_proxy, 1, m_host); if (m_cookie) - set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie, + set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie, 1, m_cookie); return send_Z_PDU(apdu, 0); } @@ -412,17 +412,17 @@ int IR_Assoc::send_deleteResultSetRequest(char* pResultSetId, char* pRefId) { *req->deleteFunction = Z_DeleteResultSetRequest_all; } - + if ( pRefId ) { req->referenceId = getRefID(pRefId); } if (m_proxy && m_host) - set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_proxy, + set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_proxy, 1, m_host); if (m_cookie) - set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie, + set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie, 1, m_cookie); return send_Z_PDU(apdu, 0); diff --git a/src/yaz-my-client.cpp b/src/yaz-my-client.cpp index 1e1b06b..f4a0fc8 100644 --- a/src/yaz-my-client.cpp +++ b/src/yaz-my-client.cpp @@ -91,7 +91,7 @@ void MyClient::failNotify() IPDU_Observer *MyClient::sessionNotify(IPDU_Observable *the_PDU_Observable, int fd) -{ +{ return new MyClient(the_PDU_Observable, m_socketManager); } @@ -193,7 +193,7 @@ void MyClient::recv_record(Z_DatabaseRecord *record, int offset, if (r->direct_reference) { char name_oid_str[OID_STR_MAX]; - const char *name_oid = yaz_oid_to_string_buf(r->direct_reference, 0, + const char *name_oid = yaz_oid_to_string_buf(r->direct_reference, 0, name_oid_str); printf("Record type: %s\n", name_oid ? name_oid : "unknown"); } @@ -223,7 +223,7 @@ void MyClient::recv_record(Z_DatabaseRecord *record, int offset, (size_t) r->u.sutrs->len); else if (r->which == Z_External_grs1) recv_genericRecord(r->u.grs1); - else + else { printf("Unknown record representation.\n"); if (!z_External(odr_print(), &r, 0, 0)) @@ -231,7 +231,7 @@ void MyClient::recv_record(Z_DatabaseRecord *record, int offset, odr_perror(odr_print(), "Printing external"); odr_reset(odr_print()); } - } + } } void MyClient::recv_namePlusRecord (Z_NamePlusRecord *zpr, int offset) @@ -414,14 +414,14 @@ int MyClient::processCommand(const char *commandLine) {"proxy", &MyClient::cmd_proxy, ":[':']"}, {0,0,0} }; - + if (sscanf(commandLine, "%s %[^;]", cmdStr, cmdArgs) < 1) return 1; int i; for (i = 0; cmd[i].cmd; i++) if (!strncmp(cmd[i].cmd, cmdStr, strlen(cmdStr))) break; - + int res = 1; if (cmd[i].cmd) // Invoke command handler res = (this->*cmd[i].fun)(cmdArgs); @@ -450,7 +450,7 @@ const char *MyClient::getCommand() strncpy(m_thisCommand,line_in, 1023); m_thisCommand[1023] = '\0'; free (line_in); -#else +#else // Read using fgets(3) printf (C_PROMPT); fflush(stdout); diff --git a/src/yaz-my-server.cpp b/src/yaz-my-server.cpp index b2a428b..67b21ac 100644 --- a/src/yaz-my-server.cpp +++ b/src/yaz-my-server.cpp @@ -194,14 +194,14 @@ int main(int argc, char **argv) char *prog = *argv; const char *addr = "tcp:@:9999"; char *apdu_log = 0; - + SocketManager mySocketManager; - + PDU_Assoc *my_PDU_Assoc = 0; - + MyServer *z = 0; int ret; - + while ((ret = options("a:v:T", argv, argc, &arg)) != -2) { switch (ret) @@ -231,7 +231,7 @@ int main(int argc, char **argv) #else my_PDU_Assoc = new PDU_Assoc(&mySocketManager); #endif - + z = new MyServer(my_PDU_Assoc); z->server(addr); if (apdu_log) diff --git a/src/yaz-pdu-assoc-thread.cpp b/src/yaz-pdu-assoc-thread.cpp index e13297e..673af8d 100644 --- a/src/yaz-pdu-assoc-thread.cpp +++ b/src/yaz-pdu-assoc-thread.cpp @@ -47,7 +47,7 @@ PDU_AssocThread::PDU_AssocThread( ISocketObservable *socketObservable) : PDU_Assoc(socketObservable) { - + } void worker::run() @@ -64,7 +64,7 @@ void worker::run() void __cdecl #else void * -#endif +#endif events(void *p) { worker *w = (worker *) p; @@ -83,7 +83,7 @@ void PDU_AssocThread::childNotify(COMSTACK cs) /// Clone PDU Observer new_observable->m_PDU_Observer = m_PDU_Observer->sessionNotify(new_observable, cs_fileno(cs)); - + if (!new_observable->m_PDU_Observer) { new_observable->shutdown(); diff --git a/src/yaz-pdu-assoc.cpp b/src/yaz-pdu-assoc.cpp index ded89bd..9af1ab7 100644 --- a/src/yaz-pdu-assoc.cpp +++ b/src/yaz-pdu-assoc.cpp @@ -116,7 +116,7 @@ void PDU_Assoc::socketNotify(int event) m_state = Ready; flush_PDU(); } - else + else { // accept still incomplete. yaz_log(m_log, "maskObserver 2"); m_socketObservable->maskObserver(this, @@ -125,7 +125,7 @@ void PDU_Assoc::socketNotify(int event) } break; case Connecting: - if (event & SOCKET_OBSERVE_READ && + if (event & SOCKET_OBSERVE_READ && event & SOCKET_OBSERVE_WRITE) { // For Unix: if both read and write is set, then connect failed. @@ -160,7 +160,7 @@ void PDU_Assoc::socketNotify(int event) { int res; COMSTACK new_line; - + if ((res = cs_listen(m_cs, 0, 0)) == 1) return; if (res < 0) @@ -170,7 +170,7 @@ void PDU_Assoc::socketNotify(int event) } if (!(new_line = cs_accept(m_cs))) return; - /* 1. create socket-manager + /* 1. create socket-manager 2. create pdu-assoc 3. create top-level object setup observer for child fileid in pdu-assoc @@ -220,7 +220,7 @@ void PDU_Assoc::socketNotify(int event) PDU_Queue **pq = &m_queue_in; while (*pq) pq = &(*pq)->m_next; - + *pq = new PDU_Queue(m_input_buf, res); #else m_PDU_Observer->recv_PDU(m_input_buf, res); @@ -332,7 +332,7 @@ PDU_Assoc::PDU_Queue::~PDU_Queue() int PDU_Assoc::flush_PDU() { int r; - + if (m_state != Ready && m_state != Writing) { yaz_log (m_log, "YAZ_PDU_Assoc::flush_PDU, not ready"); @@ -377,7 +377,7 @@ int PDU_Assoc::flush_PDU() yaz_log (m_log, "PDU_Assoc::flush_PDU cs_put %d bytes fd=%d (inc)", q->m_len, cs_fileno(m_cs)); return r; - } + } yaz_log (m_log, "PDU_Assoc::flush_PDU cs_put %d bytes", q->m_len); // whole packet sent... delete this and proceed to next ... m_queue_out = q->m_next; @@ -400,7 +400,7 @@ int PDU_Assoc::send_PDU(const char *buf, int len) yaz_log (m_log, "PDU_Assoc::send_PDU"); PDU_Queue **pq = &m_queue_out; int is_idle = (*pq ? 0 : 1); - + if (!m_cs) { yaz_log (m_log, "PDU_Assoc::send_PDU failed, m_cs == 0"); @@ -443,7 +443,7 @@ int PDU_Assoc::listen(IPDU_Observer *observer, const char *addr) xfree (m_input_buf); m_input_buf = 0; m_input_len = 0; - + return 0; } @@ -533,7 +533,7 @@ void PDU_Assoc::childNotify(COMSTACK cs) { PDU_Assoc *new_observable = new PDU_Assoc (m_socketObservable, cs); - + // Clone PDU Observer new_observable->m_PDU_Observer = m_PDU_Observer->sessionNotify (new_observable, cs_fileno(cs)); diff --git a/src/yaz-socket-manager.cpp b/src/yaz-socket-manager.cpp index 2cb2fde..0a3797a 100644 --- a/src/yaz-socket-manager.cpp +++ b/src/yaz-socket-manager.cpp @@ -32,7 +32,7 @@ SocketManager::SocketEntry **SocketManager::lookupObserver( ISocketObserver *observer) { SocketEntry **se; - + for (se = &m_observers; *se; se = &(*se)->next) if ((*se)->observer == observer) break; @@ -81,7 +81,7 @@ void SocketManager::deleteObserver(ISocketObserver *observer) void SocketManager::deleteObservers() { SocketEntry *se = m_observers; - + while (se) { SocketEntry *se_next = se->next; @@ -150,7 +150,7 @@ void SocketManager::inspect_poll_result(int res, struct yaz_poll_fd *fds, if (output_mask & yaz_poll_except) mask |= SOCKET_OBSERVE_EXCEPT; - + if (mask) { SocketEvent *event = new SocketEvent; @@ -172,7 +172,7 @@ void SocketManager::inspect_poll_result(int res, struct yaz_poll_fd *fds, event->event = SOCKET_OBSERVE_TIMEOUT; putEvent (event); no_put_events++; - + } } SocketEvent *event = getEvent(); @@ -241,7 +241,7 @@ int SocketManager::processEvent() if (timeout == -1 || timeout_this < timeout) timeout = timeout_this; p->timeout_this = timeout_this; - yaz_log (m_log, "SocketManager::select timeout_this=%d", + yaz_log (m_log, "SocketManager::select timeout_this=%d", p->timeout_this); } else diff --git a/src/yaz-z-assoc.cpp b/src/yaz-z-assoc.cpp index e268248..da2156d 100644 --- a/src/yaz-z-assoc.cpp +++ b/src/yaz-z-assoc.cpp @@ -24,7 +24,7 @@ int Z_Assoc::yaz_init_func() return 1; } -int Z_Assoc::yaz_init_flag = Z_Assoc::yaz_init_func(); +int Z_Assoc::yaz_init_flag = Z_Assoc::yaz_init_func(); Z_Assoc::Z_Assoc(IPDU_Observable *the_PDU_Observable) { @@ -49,7 +49,7 @@ void Z_Assoc::set_APDU_log(const char *fname) delete [] m_APDU_fname; m_APDU_fname = 0; - if (fname) + if (fname) { m_APDU_fname = new char[strlen(fname)+1]; strcpy (m_APDU_fname, fname); @@ -77,7 +77,7 @@ const char *Z_Assoc::get_APDU_log() Z_Assoc::~Z_Assoc() { - m_PDU_Observable->destroy(); + m_PDU_Observable->destroy(); delete m_PDU_Observable; odr_destroy (m_odr_print); // note: also runs fclose on m_APDU_file .. odr_destroy (m_odr_out); @@ -120,7 +120,7 @@ Z_ReferenceId **Z_Assoc::get_referenceIdP(Z_APDU *apdu) switch (apdu->which) { case Z_APDU_initRequest: - return &apdu->u.initRequest->referenceId; + return &apdu->u.initRequest->referenceId; case Z_APDU_initResponse: return &apdu->u.initResponse->referenceId; case Z_APDU_searchRequest: @@ -258,7 +258,7 @@ int Z_Assoc::encode_GDU(Z_GDU *apdu, char **buf, int *len) if (!r) // decoding failed. Get the failed element element = odr_getelement(m_odr_out); - + if (m_APDU_yazlog || !r) { if (!r) diff --git a/src/yaz-z-cache.cpp b/src/yaz-z-cache.cpp index ed1c51a..3ab0ba6 100644 --- a/src/yaz-z-cache.cpp +++ b/src/yaz-z-cache.cpp @@ -72,7 +72,7 @@ void RecordCache::copy_presentRequest(Z_PresentRequest *pr) { ODR encode = odr_createmem(ODR_ENCODE); ODR decode = odr_createmem(ODR_DECODE); - + m_searchRequest = 0; m_presentRequest = 0; int v = z_PresentRequest (encode, &pr, 1, 0); @@ -133,7 +133,7 @@ int RecordCache::match (RecordCache_Entry *entry, int match = 0; ODR o1 = odr_createmem(ODR_ENCODE); ODR o2 = odr_createmem(ODR_ENCODE); - + z_RecordComposition(o1, &comp, 1, 0); z_RecordComposition(o2, &entry->m_comp, 1, 0); @@ -141,12 +141,12 @@ int RecordCache::match (RecordCache_Entry *entry, char *buf1 = odr_getbuf(o1, &len1, 0); int len2 = -1; char *buf2 = odr_getbuf(o2, &len2, 0); - + if (buf1 && buf2 && len1 && len1 == len2 && !memcmp(buf1, buf2, len1)) match = 1; else if (!buf1 && !buf2 && !len1 && !len2) match = 1; - + odr_destroy(o1); odr_destroy(o2); if (!match) diff --git a/src/yaz-z-databases.cpp b/src/yaz-z-databases.cpp index 97c0b91..5c52e51 100644 --- a/src/yaz-z-databases.cpp +++ b/src/yaz-z-databases.cpp @@ -27,7 +27,7 @@ Yaz_Z_Databases::~Yaz_Z_Databases() void Yaz_Z_Databases::set (int num, const char **db) { nmem_reset (nmem); - + m_list = (char **) nmem_malloc (nmem, num * sizeof(char*)); m_num = num; for (int i = 0; ioptions; Z_Options *res = initResponse->options; - + if (ODR_MASK_GET(req, Z_Options_extendedServices)) ODR_MASK_SET(res, Z_Options_extendedServices); return 1; } int Yaz_Facility_ILL::recv(Z_Server *s, Z_APDU *apdu_request) -{ +{ Z_APDU *apdu_response; if (apdu_request->which != Z_APDU_extendedServicesRequest) diff --git a/src/yaz-z-server-sr.cpp b/src/yaz-z-server-sr.cpp index 08f1a39..e194306 100644 --- a/src/yaz-z-server-sr.cpp +++ b/src/yaz-z-server-sr.cpp @@ -111,15 +111,15 @@ void Yaz_Facility_Retrieval::fetch_via_piggyback (Z_Server *s, { bool_t *sr = (bool_t *)odr_malloc (odr_encode(), sizeof(*sr)); *sr = 1; - + int toget = 0; - + Z_RecordComposition comp, *compp = 0; int hits = *res->resultCount; - + Odr_int *nulint = (Odr_int *)odr_malloc (odr_encode(), sizeof(*nulint)); *nulint = 0; - + comp.which = Z_RecordComp_simple; /* how many records does the user agent want, then? */ if (hits <= *req->smallSetUpperBound) @@ -136,14 +136,14 @@ void Yaz_Facility_Retrieval::fetch_via_piggyback (Z_Server *s, if ((comp.u.simple = req->mediumSetElementSetNames)) compp = ∁ } - + if (toget && !res->records) { res->presentStatus = (Odr_int *) odr_malloc (odr_encode(), sizeof(Odr_int)); *res->presentStatus = Z_PresentStatus_success; res->records = - pack_records(s, req->resultSetName, 1, toget, compp, + pack_records(s, req->resultSetName, 1, toget, compp, res->nextResultSetPosition, res->presentStatus, req->preferredRecordSyntax); @@ -171,7 +171,7 @@ void Yaz_Facility_Retrieval::fetch_via_present (Z_Server *s, Z_PresentResponse *res) { res->records = - pack_records (s, req->resultSetId,*req->resultSetStartPoint, + pack_records (s, req->resultSetId,*req->resultSetStartPoint, *req->numberOfRecordsRequested, req->recordComposition, res->nextResultSetPosition, @@ -187,7 +187,7 @@ int Yaz_Facility_Retrieval::init(Z_Server *s, Z_InitRequest *initRequest, { Z_Options *req = initRequest->options; Z_Options *res = initResponse->options; - + if (ODR_MASK_GET(req, Z_Options_search)) ODR_MASK_SET(res, Z_Options_search); if (ODR_MASK_GET(req, Z_Options_present)) @@ -208,7 +208,7 @@ ODR Yaz_Facility_Retrieval::odr_decode() } int Yaz_Facility_Retrieval::recv(Z_Server *s, Z_APDU *apdu_request) -{ +{ Z_APDU *apdu_response; m_odr_encode = s->odr_encode(); m_odr_decode = s->odr_decode(); diff --git a/src/yaz-z-server-update.cpp b/src/yaz-z-server-update.cpp index e6ff501..cd5f57d 100644 --- a/src/yaz-z-server-update.cpp +++ b/src/yaz-z-server-update.cpp @@ -16,14 +16,14 @@ int Yaz_Facility_Update::init(Z_Server *s, Z_InitRequest *initRequest, { Z_Options *req = initRequest->options; Z_Options *res = initResponse->options; - + if (ODR_MASK_GET(req, Z_Options_extendedServices)) ODR_MASK_SET(res, Z_Options_extendedServices); return 1; } int Yaz_Facility_Update::recv(Z_Server *s, Z_APDU *apdu_request) -{ +{ Z_APDU *apdu_response; if (apdu_request->which != Z_APDU_extendedServicesRequest) diff --git a/src/yaz-z-server.cpp b/src/yaz-z-server.cpp index 43e22f9..4e63b78 100644 --- a/src/yaz-z-server.cpp +++ b/src/yaz-z-server.cpp @@ -61,16 +61,16 @@ void Z_Server::recv_GDU (Z_GDU *apdu, int len) } void Z_Server::recv_Z_PDU (Z_APDU *apdu_request, int len) -{ +{ Z_Server_Facility_Info *f = m_facilities; - + if (apdu_request->which == Z_APDU_initRequest) { Z_APDU *apdu_response = create_Z_PDU(Z_APDU_initResponse); Z_InitRequest *req = apdu_request->u.initRequest; Z_InitResponse *resp = apdu_response->u.initResponse; - + if (ODR_MASK_GET(req->protocolVersion, Z_ProtocolVersion_1)) { ODR_MASK_SET(resp->protocolVersion, Z_ProtocolVersion_1); @@ -135,7 +135,7 @@ void Z_ServerUtility::create_surrogateDiagnostics( Z_DiagRec *drec = (Z_DiagRec *)odr_malloc (odr, sizeof(*drec)); Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *) odr_malloc (odr, sizeof(*dr)); - + yaz_log(YLOG_DEBUG, "SurrogateDiagnotic: %d -- %s", error, addinfo); *err = error; rec->databaseName = dbname ? odr_strdup (odr, dbname) : 0; @@ -180,11 +180,11 @@ void Z_ServerUtility::create_diagnostics ( Z_DiagRec *drec = (Z_DiagRec *) odr_malloc (odr, sizeof(*drec)); Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *) odr_malloc (odr, sizeof(*dr)); - + *num = 1; *dreca = (Z_DiagRec **) odr_malloc (odr, sizeof(*dreca)); (*dreca)[0] = drec; - + drec->which = Z_DiagRec_defaultFormat; drec->u.defaultFormat = dr; dr->diagnosticSetId = odr_oiddup(odr, yaz_oid_diagset_bib_1); diff --git a/zlint/main.cpp b/zlint/main.cpp index 22a89f0..80a1560 100644 --- a/zlint/main.cpp +++ b/zlint/main.cpp @@ -12,7 +12,7 @@ int main(int argc, char **argv) { SocketManager mySocketManager; Zlint z(new PDU_Assoc(&mySocketManager)); - + if (argc > 1) z.set_host(argv[1]); else diff --git a/zlint/test-init-01.cpp b/zlint/test-init-01.cpp index 9728b30..92f97f2 100644 --- a/zlint/test-init-01.cpp +++ b/zlint/test-init-01.cpp @@ -30,7 +30,7 @@ Zlint_code Zlint_test_init_01::init(Zlint *z) ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_1); ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_2); ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3); - + int r = z->send_Z_PDU(apdu, &len); if (r < 0) { diff --git a/zlint/test-init-02.cpp b/zlint/test-init-02.cpp index a3a0a2f..779b39b 100644 --- a/zlint/test-init-02.cpp +++ b/zlint/test-init-02.cpp @@ -29,7 +29,7 @@ Zlint_code Zlint_test_init_02::init(Zlint *z) ODR_MASK_ZERO(init->protocolVersion); ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_1); ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_2); - + int r = z->send_Z_PDU(apdu, &len); if (r < 0) { diff --git a/zlint/test-init-03.cpp b/zlint/test-init-03.cpp index 9644ce1..611d27e 100644 --- a/zlint/test-init-03.cpp +++ b/zlint/test-init-03.cpp @@ -30,7 +30,7 @@ Zlint_code Zlint_test_init_03::init(Zlint *z) int i; for (i = 0; i< 9; i++) ODR_MASK_SET(init->protocolVersion, i); - + int r = z->send_Z_PDU(apdu, &len); if (r < 0) { diff --git a/zlint/test-init-04.cpp b/zlint/test-init-04.cpp index bda5674..cd1d840 100644 --- a/zlint/test-init-04.cpp +++ b/zlint/test-init-04.cpp @@ -47,7 +47,7 @@ Zlint_code Zlint_test_init_04::recv_gdu(Zlint *z, Z_GDU *gdu) gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_initResponse) { Z_InitResponse *init = gdu->u.z3950->u.initResponse; - + if (!init->referenceId) z->msg_check_fail("missing referenceID from init response"); else if (init->referenceId->len != REFID_LEN1 diff --git a/zlint/test-init-05.cpp b/zlint/test-init-05.cpp index 536d0f7..a1b7600 100644 --- a/zlint/test-init-05.cpp +++ b/zlint/test-init-05.cpp @@ -31,7 +31,7 @@ Zlint_code Zlint_test_init_05::init(Zlint *z) Z_InitRequest *init = apdu->u.initRequest; z->msg_check_for("for double init"); - + /* send double init with differnet refID's */ ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3); ODR_MASK_SET(init->options, Z_Options_concurrentOperations); @@ -43,13 +43,13 @@ Zlint_code Zlint_test_init_05::init(Zlint *z) z->msg_check_fail("unable to send init request"); return TEST_FINISHED; } - + apdu = z->create_Z_PDU(Z_APDU_initRequest); init = apdu->u.initRequest; - + ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3); ODR_MASK_SET(init->options, Z_Options_concurrentOperations); - + init->referenceId = z->mk_refid(REFID_BUF2, REFID_LEN2); r = z->send_Z_PDU(apdu, &len); @@ -68,7 +68,7 @@ Zlint_code Zlint_test_init_05::recv_gdu(Zlint *z, Z_GDU *gdu) { Z_InitResponse *init = gdu->u.z3950->u.initResponse; int result = init->result ? *init->result : 0; - + if (m_init_response_no == 0) { if (!init->referenceId) @@ -95,7 +95,7 @@ Zlint_code Zlint_test_init_05::recv_gdu(Zlint *z, Z_GDU *gdu) z->msg_check_fail("reference ID does not match from " "second init response"); } - + if (!result) { z->msg_check_fail("init rejected (result false)"); diff --git a/zlint/test-init-06.cpp b/zlint/test-init-06.cpp index 3b9b2cd..a819534 100644 --- a/zlint/test-init-06.cpp +++ b/zlint/test-init-06.cpp @@ -25,7 +25,7 @@ Zlint_code Zlint_test_init_06::init(Zlint *z) Z_InitRequest *init = apdu->u.initRequest; z->msg_check_for("for init options"); - + /* set all options.. see what target really supports .. */ ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3); ODR_MASK_ZERO(init->options); @@ -48,7 +48,7 @@ Zlint_code Zlint_test_init_06::recv_gdu(Zlint *z, Z_GDU *gdu) gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_initResponse) { Z_InitResponse *init = gdu->u.z3950->u.initResponse; - + if (init->options) { int i; diff --git a/zlint/test-init-07.cpp b/zlint/test-init-07.cpp index 95fabb1..732e673 100644 --- a/zlint/test-init-07.cpp +++ b/zlint/test-init-07.cpp @@ -28,7 +28,7 @@ Zlint_code Zlint_test_init_07::init(Zlint *z) Z_OtherInformation **oi; z->msg_check_for("for character set negotiation"); - + /* set all options.. see what target really supports .. */ ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3); yaz_oi_APDU(apdu, &oi); @@ -48,13 +48,13 @@ Zlint_code Zlint_test_init_07::init(Zlint *z) "ISO-8859-1" }; char *yazLang = 0; - + if ((p0=yaz_oi_update(oi, z->odr_encode(), NULL, 0, 0))) { ODR_MASK_SET(init->options, Z_Options_negotiationModel); - + p0->which = Z_OtherInfo_externallyDefinedInfo; p0->information.externallyDefinedInfo = - + yaz_set_proposal_charneg( z->odr_encode(), negotiationCharset, 5, @@ -81,13 +81,13 @@ Zlint_code Zlint_test_init_07::recv_gdu(Zlint *z, Z_GDU *gdu) { Z_CharSetandLanguageNegotiation *p = yaz_get_charneg_record(init->otherInfo); - + if (p) { - + char *charset=NULL, *lang=NULL; int selected; NMEM m = nmem_create(); - + yaz_get_response_charneg(m, p, &charset, &lang, &selected); z->msg_check_ok(); diff --git a/zlint/test-init-08.cpp b/zlint/test-init-08.cpp index fd57e64..1d16943 100644 --- a/zlint/test-init-08.cpp +++ b/zlint/test-init-08.cpp @@ -28,7 +28,7 @@ Zlint_code Zlint_test_init_08::init(Zlint *z) Z_InitRequest *init = apdu->u.initRequest; z->msg_check_for("for init message sizes %d", m_no); - + /* set all options.. see what target really supports .. */ ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3); @@ -50,7 +50,7 @@ Zlint_code Zlint_test_init_08::recv_gdu(Zlint *z, Z_GDU *gdu) gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_initResponse) { Z_InitResponse *init = gdu->u.z3950->u.initResponse; - + if (m_no * m_no * 100000 + 2000 < *init->maximumRecordSize) z->msg_check_fail("maximumRecordSize bigger than proposed size"); if (m_no * m_no * 100000 + 2000 < *init->preferredMessageSize) diff --git a/zlint/test-scan-01.cpp b/zlint/test-scan-01.cpp index 567874c..3e588ea 100644 --- a/zlint/test-scan-01.cpp +++ b/zlint/test-scan-01.cpp @@ -37,7 +37,7 @@ Zlint_code Zlint_test_scan_01::init(Zlint *z) ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3); ODR_MASK_SET(init->options, Z_Options_namedResultSets); ODR_MASK_SET(init->options, Z_Options_scan); - + int r = z->send_Z_PDU(apdu, &len); if (r < 0) { @@ -61,9 +61,9 @@ Zlint_code Zlint_test_scan_01::sendTest(Zlint *z) z->odr_encode(), &sr->attributeSet, try_scan[m_scan_no]); - + z->getDatabase(&sr->databaseNames, &sr->num_databaseNames); - + yaz_pqf_destroy (pqf_parser); z->send_Z_PDU(apdu, &len); return TEST_CONTINUE; diff --git a/zlint/test-search-01.cpp b/zlint/test-search-01.cpp index e44fce4..2df1ef5 100644 --- a/zlint/test-search-01.cpp +++ b/zlint/test-search-01.cpp @@ -99,14 +99,14 @@ Zlint_code Zlint_test_search_01::sendTest(Zlint *z) sr->query->which = Z_Query_type_1; Z_RPNQuery *rpn; YAZ_PQF_Parser pqf_parser = yaz_pqf_create (); - + z->getDatabase(&sr->databaseNames, &sr->num_databaseNames); - + rpn = yaz_pqf_parse(pqf_parser, z->odr_encode(), try_query[m_query_no]); - + yaz_pqf_destroy (pqf_parser); - + if (!rpn) { z->msg_check_fail("Query %s invalid", try_query[m_query_no]); @@ -149,7 +149,7 @@ Zlint_code Zlint_test_search_01::sendTest(Zlint *z) const char *setstring = "default"; int len; Z_SortRequest *sr = apdu->u.sortRequest; - + sr->num_inputResultSetNames = 1; sr->num_inputResultSetNames = 1; sr->inputResultSetNames = (Z_InternationalString **) @@ -189,8 +189,8 @@ Zlint_code Zlint_test_search_01::recv_gdu(Zlint *z, Z_GDU *gdu) gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_searchResponse) { Z_SearchResponse *sr = gdu->u.z3950->u.searchResponse; - if (sr->records && (sr->records->which == Z_Records_NSD - || + if (sr->records && (sr->records->which == Z_Records_NSD + || sr->records->which == Z_Records_multipleNSD)) m_query_no++; else if (!sr->resultCount || *sr->resultCount == 0) @@ -204,12 +204,12 @@ Zlint_code Zlint_test_search_01::recv_gdu(Zlint *z, Z_GDU *gdu) } return sendTest(z); } - else if (gdu->which == Z_GDU_Z3950 && + else if (gdu->which == Z_GDU_Z3950 && gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_presentResponse) { Z_PresentResponse *sr = gdu->u.z3950->u.presentResponse; - if (sr->records && (sr->records->which == Z_Records_NSD - || + if (sr->records && (sr->records->which == Z_Records_NSD + || sr->records->which == Z_Records_multipleNSD)) { z->msg_check_ok(); @@ -257,7 +257,7 @@ Zlint_code Zlint_test_search_01::recv_gdu(Zlint *z, Z_GDU *gdu) m_record_syntax_no++; return sendTest(z); } - else if (gdu->which == Z_GDU_Z3950 && + else if (gdu->which == Z_GDU_Z3950 && gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_sortResponse) { Z_SortResponse *sr = gdu->u.z3950->u.sortResponse; diff --git a/zlint/zlint.cpp b/zlint/zlint.cpp index 73179fe..11e6ccd 100644 --- a/zlint/zlint.cpp +++ b/zlint/zlint.cpp @@ -35,9 +35,9 @@ private: int m_test_reported; }; -Zlint::Zlint(IPDU_Observable *the_PDU_Observable) : +Zlint::Zlint(IPDU_Observable *the_PDU_Observable) : Z_Assoc(the_PDU_Observable) - + { m_PDU_Observable = the_PDU_Observable; m_host = 0; @@ -149,7 +149,7 @@ IPDU_Observer *Zlint::sessionNotify( Z_ReferenceId *Zlint::mk_refid(const char *buf, int len) { - Z_ReferenceId *id = + Z_ReferenceId *id = (Z_ReferenceId *) odr_malloc(odr_encode(), sizeof(*id)); id->size = id->len = len; id->buf = (unsigned char*) odr_malloc(odr_encode(), len); diff --git a/zoom/zexcept.cpp b/zoom/zexcept.cpp index 282177b..aeca4bc 100644 --- a/zoom/zexcept.cpp +++ b/zoom/zexcept.cpp @@ -57,7 +57,7 @@ namespace ZOOM { } - + bib1Exception::bib1Exception(int errcode, const std::string &addinfo) : exception(errcode), info(addinfo) { // std::cerr << "WARNING: made bib1Exception(" << errcode << "=" <<