1 /* $Id: util.hpp,v 1.9 2006-01-18 10:57:27 adam Exp $
2 Copyright (c) 2005, Index Data.
10 #include <yaz/z-core.h>
14 #include <boost/utility.hpp>
18 bool pqf(ODR odr, Z_APDU *apdu, const std::string &q);
19 Z_ReferenceId **get_referenceId(Z_APDU *apdu);
20 Z_APDU *create_APDU(ODR odr, int type, Z_APDU *in_apdu);
21 bool set_databases_from_zurl(ODR odr, std::string zurl,
22 int *db_num, char ***db_strings);
23 void split_zurl(std::string zurl, std::string &host,
24 std::list<std::string> &db);
26 int get_vhost_otherinfo(Z_OtherInformation **otherInformation,
28 std::list<std::string> &vhosts);
29 void set_vhost_otherinfo(Z_OtherInformation **otherInformation,
31 const std::list<std::string> &vhosts);
32 void get_init_diagnostics(Z_InitResponse *res,
33 int &error_code, std::string &addinfo);
34 void get_default_diag(Z_DefaultDiagFormat *r,
35 int &error_code, std::string &addinfo);
37 void piggyback(int smallSetUpperBound,
38 int largeSetLowerBound,
39 int mediumSetPresentNumber,
41 int &number_to_present);
44 class odr : public boost::noncopyable {
50 Z_APDU *create_close(Z_APDU *in_apdu,
51 int reason, const char *addinfo);
52 Z_APDU *create_initResponse(Z_APDU *in_apdu,
53 int error, const char *addinfo);
54 Z_APDU *create_searchResponse(Z_APDU *in_apdu,
55 int error, const char *addinfo);
56 Z_APDU *create_presentResponse(Z_APDU *in_apdu,
57 int error, const char *addinfo);
58 Z_APDU *create_scanResponse(Z_APDU *in_apdu,
59 int error, const char *addinfo);
60 Z_APDU *create_APDU(int type, Z_APDU *in_apdu);
70 * indent-tabs-mode: nil
71 * c-file-style: "stroustrup"
73 * vim: shiftwidth=4 tabstop=8 expandtab